Save before navigate in workspace#1960
Conversation
| 'Navigate Away', | ||
| true, | ||
| const { confirm, value } = await showUnsavedChangesModal( | ||
| 'There are unsaved changes. What would you like to do before navigating away from the current file?', |
There was a problem hiding this comment.
Is it possible to extract the invocation of showUnsavedChangesModal to a function that can be used here and reused in the beforeNavigate?
There was a problem hiding this comment.
Oh! Sorry. I meant to also include the messages and labels as hardcoded into the function itself so that they wouldn't be repeated in separate places. Is there a desire to make this function flexible?
There was a problem hiding this comment.
Ah I see what you mean, there are differences in copy between these invocations so I did a bit more streamlining so that there should be no duplication now. See what you think.
3014833 to
096ba25
Compare
5eb82b2 to
151d535
Compare
|



Summary
Adds a Save and Navigate option to the workspace "unsaved changes" prompt. Previously, leaving a file with unsaved edits meant either discarding them or staying put. Now you can save and continue in one step. Also fixes a couple of related bugs found along the way. Closes #1959
Details
Visible UX Changes
Verification
e2e-tests/tests/workspace.test.tsManual steps (open a workspace with a couple of sequence files):