Skip to content

Use routing helpers in festival selector and preserve current tab - #211

Merged
richardthe3rd merged 7 commits into
claude/prioritize-impact-improvements-gqqLRfrom
copilot/sub-pr-209
Feb 8, 2026
Merged

Use routing helpers in festival selector and preserve current tab#211
richardthe3rd merged 7 commits into
claude/prioritize-impact-improvements-gqqLRfrom
copilot/sub-pr-209

Conversation

Copilot AI commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

The festival selector was using hard-coded navigation ('/${festival.id}') instead of the routing helper functions, and always navigated to the home tab regardless of where the user was.

Changes

  • Replace hard-coded URL with buildFestivalHome() and buildFavoritesPath() helpers
  • Preserve current tab when switching festivals - users on favorites stay on favorites
  • Capture route state early before any mutations to avoid context invalidation
  • Add debug logging for error cases (e.g., test environments)

Implementation

// Determine target based on current route
String targetPath = buildFestivalHome(festival.id);
try {
  final currentPath = GoRouterState.of(context).uri.path;
  if (currentPath.endsWith('/favorites')) {
    targetPath = buildFavoritesPath(festival.id);
  }
} catch (e) {
  debugPrint('Festival selector: Unable to get current route, using default: $e');
}
router?.go(targetPath);

This maintains user context when browsing different festivals and consolidates routing logic in the helper functions.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
@richardthe3rd
richardthe3rd marked this pull request as ready for review February 8, 2026 16:10
Copilot AI and others added 5 commits February 8, 2026 16:11
… check

Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix critical bug in API fetching and URL sync Use routing helpers in festival selector and preserve current tab Feb 8, 2026
Copilot AI requested a review from richardthe3rd February 8, 2026 16:16
@richardthe3rd
richardthe3rd merged commit 1461020 into claude/prioritize-impact-improvements-gqqLR Feb 8, 2026
@richardthe3rd
richardthe3rd deleted the copilot/sub-pr-209 branch February 8, 2026 16:17
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.

2 participants