Repository navigation
Feat/team unsaved changes - #329
Merged
Merged
Conversation
Following an in-app link off Manage Teams dropped unsaved changes without a word, because only closing the tab was guarded. A beforeNavigate guard now asks first. A sticky bar with the change summary, Discard and Save appears while anything is unsaved, so Save stays in reach however far down the projects one scrolls, and it repeats a failed save's message.
The save bar moves to the top, sticks below the nav bar and is always there — quiet while everything is saved, warning-colored once anything is not — so Save is in one place. People whose team changed and teams that are new or renamed carry the same warning color until saved, so the page shows what the bar is counting.
The native confirm() cannot be styled, introduces itself as "localhost:8081 says" and only offers "OK". A ConfirmDialog component, built on <dialog> with showModal(), asks instead: themed, with Cancel focused and a confirm button that names its action. Manage Teams uses it for replacing teams on upload, deleting a saved team, and leaving with unsaved changes; the navigation guard cancels, asks, and resumes the navigation on a "leave".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manage Teams: see and keep unsaved team changes
As an organizer rearranging teams, I can see exactly what I have not saved
yet, Save is always in reach, and I can no longer lose my work by clicking a
link. Before, clicking the sidebar or "← Settings" with unsaved changes threw
them away without asking; only closing the tab was guarded. The only hint of
unsaved work was a small line of text next to a Save button that scrolled out of
view.
"No unsaved changes", warning-colored with a summary, Discard and Save as soon
as anything changes. It shows "Saving…" and repeats a failed save's error.
same warning color until saved.
unsaved changes asks first; closing the tab still gets the browser's own
prompt.
appear in the app's own dialog instead of the browser's: themed, with Cancel
focused and a confirm button that names its action. The dialog is a new
reusable component,
ConfirmDialog.Deliberately left out
still counts them.
button opens that page as a new history entry rather than stepping back,
because the navigation has to be cancelled before the dialog can ask.
confirm()(e.g. submissions); theycan move to
ConfirmDialogseparately.