Page MenuHomePhabricator

[native] Handle unsaved changes when 'cancel' is pressed
ClosedPublic

Authored by rohan on Jun 9 2023, 11:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 7:46 AM
Unknown Object (File)
Tue, Mar 5, 11:57 PM
Unknown Object (File)
Tue, Mar 5, 11:57 PM
Unknown Object (File)
Tue, Mar 5, 11:56 PM
Unknown Object (File)
Mon, Mar 4, 3:07 AM
Unknown Object (File)
Feb 19 2024, 12:25 PM
Unknown Object (File)
Feb 19 2024, 11:31 AM
Unknown Object (File)
Feb 19 2024, 9:44 AM
Subscribers

Details

Summary

As a second part to the header left button, we want to ensure that a user is prompted with an alert warning them that they are discarding changes if they've selected a different role but not saved.

Depends on D8158

Test Plan

Please see the video below

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Jun 9 2023, 11:53 AM
rohan added inline comments.
native/roles/change-roles-header-left-button.react.js
32–41 ↗(On Diff #27588)

I think the wording here may be a bit confusing. In my experience, 'cancel' typically means close the alert, and there's another option like 'confirm' or something that will mean you're ok with discarding changes.

Here it seems like 'cancel' means we're ok with discarding changes. Not sure if it's just me though (cc @ted)

native/roles/change-roles-header-left-button.react.js
32–41 ↗(On Diff #27588)

What do we do in the current edit-message workflow? Heads-up I generally handle copy, not @ted

native/roles/change-roles-header-left-button.react.js
32–41 ↗(On Diff #27588)

Ah my bad. It looks like in message editing: Continue editing closes the alert and continues editing while Discard edit closes the alert and exits editing

native/roles/change-roles-header-left-button.react.js
32–41 ↗(On Diff #27588)
  1. I agree we shouldn't use the term Cancel here... how about Leave?
  2. I don't think we need { cancelable: true }... we can just default to Stay if the user dismisses the Alert
  3. Can we try to match copy for title / description with the edit-message workflow?
native/roles/change-roles-header-left-button.react.js
32–41 ↗(On Diff #27588)

Yeah that makes sense, I'll update the diff

atul requested changes to this revision.Jun 12 2023, 1:12 PM

Requesting changes for changes suggested by @ashoat.

It's not clear to me as of this diff how the user is supposed to save their changes, maybe that's more clear in a subsequent diff?

This revision now requires changes to proceed.Jun 12 2023, 1:12 PM
In D8159#241874, @atul wrote:

It's not clear to me as of this diff how the user is supposed to save their changes, maybe that's more clear in a subsequent diff?

Yeah changes are handled with the header right button in D8160

This revision is now accepted and ready to land.Jun 13 2023, 6:42 PM
native/roles/change-roles-header-left-button.react.js
34 ↗(On Diff #27667)

Missing a period at the end

This revision was landed with ongoing or failed builds.Jun 21 2023, 8:42 AM
This revision was automatically updated to reflect the committed changes.
native/roles/change-roles-header-left-button.react.js
34

Still missing a period at the end

native/roles/change-roles-header-left-button.react.js
34

Ah looks like it was addressed in D8277