Simpler nav guard for SideModalForm#2328
Merged
david-crespo merged 14 commits intomainfrom Nov 19, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Collaborator
|
This is great. Modal on top of modal is a little funny, but I can live with it, the QoL improvement is huge. Text is a little tight when there's only one line. Like a McDonald's hamburger, super thin patty. @benjaminleonard ?
|
Collaborator
|
Before/after on overlay fix. Note how in the before, the background gets double-dark when the confirm modal opens. 2024-11-19-modal-hide-overlay.mp4 |
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Nov 19, 2024
oxidecomputer/console@0517a28...6fe6936 * [6fe6936d](oxidecomputer/console@6fe6936d) oxidecomputer/console#2328 * [fcd34418](oxidecomputer/console@fcd34418) oxidecomputer/console#2563 * [6e389ec6](oxidecomputer/console@6e389ec6) oxidecomputer/console#2561 * [41c4c5db](oxidecomputer/console@41c4c5db) oxidecomputer/console#2560 * [92472558](oxidecomputer/console@92472558) oxidecomputer/console#2562 * [9b60d5c9](oxidecomputer/console@9b60d5c9) oxidecomputer/console#2559 * [1e0486c2](oxidecomputer/console@1e0486c2) chore: npm audit fix * [7d35d268](oxidecomputer/console@7d35d268) oxidecomputer/console#2544
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Nov 19, 2024
oxidecomputer/console@0517a28...6fe6936 * [6fe6936d](oxidecomputer/console@6fe6936d) oxidecomputer/console#2328 * [fcd34418](oxidecomputer/console@fcd34418) oxidecomputer/console#2563 * [6e389ec6](oxidecomputer/console@6e389ec6) oxidecomputer/console#2561 * [41c4c5db](oxidecomputer/console@41c4c5db) oxidecomputer/console#2560 * [92472558](oxidecomputer/console@92472558) oxidecomputer/console#2562 * [9b60d5c9](oxidecomputer/console@9b60d5c9) oxidecomputer/console#2559 * [1e0486c2](oxidecomputer/console@1e0486c2) chore: npm audit fix * [7d35d268](oxidecomputer/console@7d35d268) oxidecomputer/console#2544
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.

This adds a modal for the SideModalForm that protects it from getting accidentally closed when the form is dirty.
I had experimented with a more involved approach, using useBlocker, but as Crespo and I were talking through it, he noted that side modal forms don't always require a route change, so this is possibly both more reliable and simpler.
The deeper question: is the benefit of adding this bit of friction worth it? I'm leaning towards "yes", as the friction is pretty minimal and the potential for data loss is … low-to-moderate? … but am open to alternate takes.
Fixes #2186