Repository navigation
Restore the previous screen when exiting offline mode - #10102
Open
khanak0509 wants to merge 2 commits into
Open
khanak0509 wants to merge 2 commits into
khanak0509 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to return users to their previous page when exiting offline mode in DevTools, rather than always redirecting them to the home page. It tracks the previous page in the OfflineDataController and utilizes it in the ExitOfflineButton if the app remains connected. Corresponding unit and widget tests have been added to verify this behavior. The review feedback highlights a potential issue where entering offline mode from a direct snapshot URL would incorrectly return the user to an empty snapshot page upon exiting. A code suggestion is provided to prevent setting previousPage to snapshotScreenId to ensure a fallback to the home page in this scenario.
This branch has not been deployed
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.
Fixes #5047
This PR fixes issue #5047 where clicking "Exit offline mode" always took you to the home screen instead of the screen you were on before loading the snapshot. Now DevTools remembers the page when entering offline mode and goes back to it on exit (or to the home screen if the app has disconnected).
The previous page and app are only saved when first entering offline mode, so loading another snapshot while already in offline mode doesn't overwrite them.
Before
before.mov
After
after.mov
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.