Skip to content

fix(router): update browser URL when navigating to drink detail on web - #289

Merged
richardthe3rd merged 2 commits into
mainfrom
claude/fix-drink-deep-links-uBA9g
May 17, 2026
Merged

fix(router): update browser URL when navigating to drink detail on web#289
richardthe3rd merged 2 commits into
mainfrom
claude/fix-drink-deep-links-uBA9g

Conversation

@richardthe3rd

Copy link
Copy Markdown
Owner

GoRouter's push() from within a ShellRoute does not update
currentConfiguration.uri on web, so the URL stayed stale after
tapping a drink card. Fix by introducing navigateToRoute(), which
calls context.go() on web (URL-updating) and context.push() on
mobile (stack-preserving).

Drink detail route now includes category segment
(/:festivalId/drink/:category/:id) for SEO and App Links alignment.
buildDrinkDetailPath gains a required category param; all call sites
updated (drinks_screen, drink_detail_screen, main, drink_list_section).

Share URLs now include the category segment so shared links resolve
correctly to the new route format.

New router_test covers that the URL contains all four segments after
navigation. E2e routing spec updated to the four-segment URL format.

https://claude.ai/code/session_01FqdVsDvtHXyWSszZA8tvno

Copilot AI review requested due to automatic review settings May 17, 2026 16:30
@github-actions

github-actions Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

LCOV of commit 47abd6e during CI #224

Summary coverage rate:
  lines......: 78.2% (2501 of 3198 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%    113|    -     0|    -      0
  lib/screens/drink_detail_screen.dart                | 0.0%    191|    -     0|    -      0
  lib/screens/drinks_screen.dart                      | 0.0%    262|    -     0|    -      0
  lib/utils/navigation_helpers.dart                   | 0.0%     47|    -     0|    -      0
  lib/widgets/drink_list_section.dart                 | 0.0%     54|    -     0|    -      0

@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/utils/navigation_helpers.dart 66.66% 1 Missing ⚠️
lib/widgets/drink_list_section.dart 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Updates festival-scoped routing to ensure drink-detail navigation updates the browser URL on Flutter web, and standardizes drink deep-link format to include a category path segment for better SEO/App Links alignment.

Changes:

  • Added navigateToRoute() to use go() on web (URL updates) and push() on non-web (preserves native back stack).
  • Updated drink-detail path building to /\:festivalId/drink/\:category/\:id and migrated navigation call sites accordingly.
  • Updated router/widget/E2E tests to assert the new 4-segment drink URL format.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/screens_test.dart Uses a const Festival in setup to match immutable model usage.
test/router_test.dart Adds widget coverage asserting drink-detail URLs include festivalId/drink/category/id.
test-e2e/routing.spec.ts Updates Playwright routing expectations to the new drink deep-link format.
mise.lock Updates the pinned Node.js version used by mise-managed tooling.
lib/widgets/drink_list_section.dart Routes drink card taps through navigateToRoute() for web URL correctness.
lib/utils/navigation_helpers.dart Introduces navigateToRoute() and updates drink-detail path builder to include category.
lib/screens/drinks_screen.dart Uses navigateToRoute() for drink-detail navigation; minor const cleanup.
lib/screens/drink_detail_screen.dart Routes style/brewery navigations through navigateToRoute().
lib/main.dart Routes favorites-list drink taps through navigateToRoute().

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your preview deployment is ready!

Preview URL: https://claude-fix-drink-deep-links.staging-cambeerfestival.pages.dev

This preview will be automatically updated when you push new commits to this PR.

@richardthe3rd

Copy link
Copy Markdown
Owner Author

@copilot review

Copilot AI commented May 17, 2026

Copy link
Copy Markdown
Contributor

@copilot review

Reviewed the current PR state; no additional changes were needed from this comment request. Current reviewed commit: 16102e2.

claude added 2 commits May 17, 2026 19:39
GoRouter's push() from within a ShellRoute does not update
currentConfiguration.uri on web, so the URL stayed stale after
tapping a drink card. Fix by introducing navigateToRoute(), which
calls context.go() on web (URL-updating) and context.push() on
mobile (stack-preserving).

Drink detail route now includes category segment
(/:festivalId/drink/:category/:id) for SEO and App Links alignment.
buildDrinkDetailPath gains a required category param; all call sites
updated (drinks_screen, drink_detail_screen, main, drink_list_section).

Share URLs now include the category segment so shared links resolve
correctly to the new route format.

New router_test covers that the URL contains all four segments after
navigation. E2e routing spec updated to the four-segment URL format.

https://claude.ai/code/session_01FqdVsDvtHXyWSszZA8tvno
Add widget tests exercising the navigateToRoute-based navigation
introduced in this PR: brewery, drinks, favourites and drink-detail
screens now have tests that trigger navigation to a drink detail and
verify the destination renders. This raises patch coverage above the
codecov/patch 70% threshold.

https://claude.ai/code/session_01FqdVsDvtHXyWSszZA8tvno
@richardthe3rd
richardthe3rd force-pushed the claude/fix-drink-deep-links-uBA9g branch from 16102e2 to 47abd6e Compare May 17, 2026 19:40
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your preview deployment is ready!

Preview URL: https://claude-fix-drink-deep-links.staging-cambeerfestival.pages.dev

This preview will be automatically updated when you push new commits to this PR.

@richardthe3rd
richardthe3rd merged commit 46197a4 into main May 17, 2026
10 checks passed
@github-actions github-actions Bot mentioned this pull request May 17, 2026
@richardthe3rd
richardthe3rd deleted the claude/fix-drink-deep-links-uBA9g branch May 17, 2026 20:07
@github-actions github-actions Bot mentioned this pull request May 17, 2026
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.

4 participants