feat(designer): dismissable barrier warnings#803
Open
johannesvedder wants to merge 3 commits into
Open
Conversation
|
Visit the preview URL for this PR (updated for commit 35141f1):
(expires Mon, 30 Mar 2026 15:40:35 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b |
mohiuddinshahrukh
requested changes
Apr 28, 2026
Collaborator
There was a problem hiding this comment.
Thanks for the PR.
AFter running it locally, I think this needs changes before merge because the main unsaved-changes protection can be bypassed in a common path.
Change
When editing a survey question sidesheet, I changed the question title and clicked the sidesheet Cancel button while the text field was still focused. The sidesheet closed immediately without showing the unsaved-changes dialog, and the edit was discarded.
The console showed:
[PopEntry] _handleDismiss isDirty=false```
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 pull request introduces several improvements to the form handling and sidesheet modal logic, especially around unsaved changes and form dirty state detection. The changes enhance user experience by providing better prompts for unsaved changes, improving form state management, and making the modal sidesheet more flexible.
Form Dirty State Handling and Modal Dismissal:
FormViewModelby introducing a more reliable way to compare the initial and current form state, using a new_getFullFormValue()method and a dedicatedfinalizeInitializationBaseline()function. This ensures that programmatic changes to the form do not incorrectly mark it as dirty. [1] [2] [3] [4]_FormSidesheetPopEntrywidget and integrated it into the form sidesheet flow. This widget intercepts the modal pop action and, if the form is dirty, prompts the user with anUnsavedChangesDialog. If the user confirms, the form cancels and the modal is dismissed; otherwise, the modal remains open. [1] [2] [3]barrierDismissibleinshowFormSideSheettotrue, allowing users to dismiss the modal by clicking outside it, but with proper handling of unsaved changes.Sidesheet Modal Enhancements:
showModalSideSheetto accept a newwrapRouteparameter, allowing the modal content to be wrapped with custom widgets (such as_FormSidesheetPopEntryfor pop interception). [1] [2] [3]Minor Improvements:
DismissButtoninform_buttons.dartto directly pop the navigation stack, removing unnecessary async logic.prevFormValueis initialized inInviteCodeFormViewModelfor correct dirty state tracking.