Skip to content

fix: use context.push() instead of context.go() for sub-page navigation - #240

Merged
richardthe3rd merged 1 commit into
mainfrom
copilot/fix-navigation-to-push
May 10, 2026
Merged

fix: use context.push() instead of context.go() for sub-page navigation#240
richardthe3rd merged 1 commit into
mainfrom
copilot/fix-navigation-to-push

Conversation

Copilot AI commented May 10, 2026

Copy link
Copy Markdown
Contributor

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

  • Sub-page navigation → context.push(): drink detail (from drinks list, favorites, drink list sections), brewery, style, festival info, and about screens
  • Tab/home navigation unchanged as context.go(): bottom nav tab switching, home button, back-to-root from about/info screens
// Before – replaces stack, no back button
onTap: () => context.go(buildDrinkDetailPath(festivalId, drink.id)),

// After – pushes onto stack, back button works
onTap: () => context.push(buildDrinkDetailPath(festivalId, drink.id)),

Known 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 (/about sits outside the parent ShellRoute). go_router should handle imperative push across shell boundaries, but this path has no automated coverage.

@richardthe3rd
richardthe3rd marked this pull request as ready for review May 10, 2026 07:40
Copilot AI review requested due to automatic review settings May 10, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() with context.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.

Comment thread lib/widgets/overflow_menu.dart
Comment thread lib/widgets/festival_menu_sheets.dart
@richardthe3rd
richardthe3rd force-pushed the copilot/fix-navigation-to-push branch from 4742987 to fd4c5da Compare May 10, 2026 08:58
@github-actions

Copy link
Copy Markdown
Contributor

LCOV of commit fd4c5da during CI #110

Summary coverage rate:
  lines......: 78.2% (2321 of 2967 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate:
                                                      |Lines       |Functions  |Branches    
  Filename                                            |Rate     Num|Rate    Num|Rate     Num
  ==========================================================================================
  lib/main.dart                                       | 0.0%     84|    -     0|    -      0
  lib/screens/drink_detail_screen.dart                | 0.0%    182|    -     0|    -      0
  lib/screens/drinks_screen.dart                      | 0.0%    259|    -     0|    -      0
  lib/widgets/drink_list_section.dart                 | 0.0%     53|    -     0|    -      0
  lib/widgets/festival_menu_sheets.dart               | 0.0%    176|    -     0|    -      0
  lib/widgets/overflow_menu.dart                      | 0.0%      4|    -     0|    -      0

@codecov

codecov Bot commented May 10, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your 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.

@richardthe3rd
richardthe3rd merged commit 4860b62 into main May 10, 2026
10 of 11 checks passed
@richardthe3rd
richardthe3rd deleted the copilot/fix-navigation-to-push branch May 10, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants