Repository navigation
refactor(frontend): one shared save bar for every edit-then-save page - #452
Merged
Merged
Conversation
Settings, Manage Teams, a team's submission and an admin's user page each carried their own copy of the same save bar and leave guard. They now use SaveBar, which brings LeaveGuard along: the bar names what Save would write, Discard puts it back, and leaving with unsaved changes asks first. LeaveGuard stands on its own for a form without a bar. Visible differences: the bar now sticks below the nav bar on the submission and user pages too, and reads "Unsaved changes: …" everywhere rather than "…, marked below/on the page" on two of them. The test setup stubs ResizeObserver, which jsdom lacks and the bar's height binding needs.
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.
The save bar works the same on every page that has one
Four pages already showed which changes weren't saved yet and asked before you left:
Each had its own copy of that bar, and they had drifted apart. On the submission and user pages, the bar scrolled out of view on a long page. The wording differed from page to page. The admin user page asked a differently worded question when you left. Now all four use one shared bar, so they look and behave the same.
SaveandDiscardare always in reach.Unsaved changes: …everywhere. The "…, marked below" and "…, marked on the page" variants are gone.Leave without saving?question on every page.Left out: other edit forms (public page, tracks, phases and so on) get the bar in follow-up PRs, one per form. Create forms keep their plain buttons.