fix: use context.push() instead of context.go() for sub-page navigation - #240
Merged
Conversation
Copilot created this pull request from a session on behalf of
richardthe3rd
May 10, 2026 07:32
View session
richardthe3rd
marked this pull request as ready for review
May 10, 2026 07:40
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates in-app navigation so that “sub-page” routes (detail/info screens) are pushed onto the navigation stack instead of replacing it, restoring expected OS back button and app back arrow behavior across the festival browsing experience.
Changes:
- Replaced
context.go()withcontext.push()for sub-page navigation (drink detail, brewery, style, festival info, about). - Kept “tab/home” navigation behavior unchanged (still stack-replacing where appropriate).
- Updated a widget test comment to reflect the new navigation method.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/drink_detail_screen_test.dart | Updates note/comment about navigation now using context.push(). |
| lib/widgets/overflow_menu.dart | Switches About navigation from go to push in overflow menu selection. |
| lib/widgets/festival_menu_sheets.dart | Switches festival info navigation from go to push from the festival selector sheet. |
| lib/widgets/drink_list_section.dart | Pushes drink detail routes from drink list section cards (including “Similar Drinks”). |
| lib/screens/drinks_screen.dart | Pushes festival info and drink detail routes from the main drinks screen. |
| lib/screens/drink_detail_screen.dart | Pushes style and brewery routes from drink detail interactions. |
| lib/main.dart | Pushes drink detail routes from Favorites list items. |
Agent-Logs-Url: https://github.com/richardthe3rd/cambridge-beer-festival-app/sessions/e4a51184-7a0f-4c00-bb90-51257a2e5996 Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
richardthe3rd
force-pushed
the
copilot/fix-navigation-to-push
branch
from
May 10, 2026 08:58
4742987 to
fd4c5da
Compare
Contributor
LCOV of commit
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://copilot-fix-navigation-to-pu.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
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.
context.go()replaces the entire navigation stack, so navigating into detail screens destroyed back-navigation history. Sub-pages should be pushed so the OS back button and in-app back arrow work correctly.Changes
context.push(): drink detail (from drinks list, favorites, drink list sections), brewery, style, festival info, and about screenscontext.go(): bottom nav tab switching, home button, back-to-root from about/info screensKnown behavioural change
Circular navigation (drink → brewery → drink → brewery) now accumulates stack depth rather than replacing in place. The back button will retrace every step. This is standard native app behaviour but worth verifying feels right in practice.
Worth manual testing
context.push('/about')crosses a go_router shell boundary (/aboutsits outside the parentShellRoute). go_router should handle imperative push across shell boundaries, but this path has no automated coverage.