Skip to content

Festival deep linking and logging Phase 1 - #191

Closed
richardthe3rd wants to merge 3 commits into
mainfrom
claude/festival-deeplink-logging-phase1-j7no5
Closed

Festival deep linking and logging Phase 1#191
richardthe3rd wants to merge 3 commits into
mainfrom
claude/festival-deeplink-logging-phase1-j7no5

Conversation

@richardthe3rd

Copy link
Copy Markdown
Owner

This pull request introduces festival-scoped routing throughout the app, ensuring that all navigation and URLs are contextualized to the currently selected festival. This enables deep linking, better browser support, and prepares the app for multi-festival support. The changes include major updates to the routing structure, refactoring of screen constructors to require a festivalId, and consistent use of festival-aware navigation helpers.

Routing and Navigation Overhaul:

  • Refactored the router in lib/router.dart to use festival-scoped URLs (e.g., /:festivalId/…) for all main and detail screens, with validation and redirection logic to ensure only valid festivals are accessible. The root path / now redirects to the current festival, and global routes like /about remain outside the festival scope. [1] [2]
  • Updated navigation logic in lib/main.dart and across screens to generate and use festival-aware paths, ensuring all navigation actions preserve the current festival context. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Screen and Widget Refactoring:

  • Modified all main and detail screens (DrinksScreen, FavoritesScreen, DrinkDetailScreen, BreweryScreen, StyleScreen, FestivalInfoScreen) to require a festivalId parameter, ensuring they always operate within the correct festival context. [1] [2] [3] [4] [5] [6]
  • Updated reusable widgets such as DrinkListSection and EntityDetailScreen to accept and use festivalId, propagating context for navigation and data fetching. [1] [2] [3] [4] [5]

Provider Enhancements:

  • Added methods in BeerProvider to validate festival IDs and fetch festivals by ID, supporting the new routing logic and ensuring only valid festivals are accessible via URL.

These changes collectively ensure that the app is robust to deep linking, festival switching, and navigation, with all screens and navigation actions aware of the current festival context.

Core Implementation:
- Update router.dart with festival-scoped URL structure (/:festivalId/...)
- Add festival validation and redirect logic in router
- Integrate BreadcrumbBar widget on all detail screens
- Update all screens to accept festivalId parameter
- Replace hard-coded navigation URLs with navigation helper calls

Provider Changes (lib/providers/beer_provider.dart):
- Add isValidFestivalId() method to validate against festival registry
- Add getFestivalById() method for festival lookup

Router Changes (lib/router.dart):
- Implement festival-scoped routes: /:festivalId/drink/:id, etc.
- Add root redirect: / → /{currentFestivalId}
- Add festival ID validation with automatic redirect for invalid IDs
- Sync provider state when URL changes to different festival
- Keep /about as global route (no festival scope)

Screen Updates:
- DrinksScreen: Add festivalId param, update all navigation calls
- FavoritesScreen: Add festivalId param, use navigation helpers
- DrinkDetailScreen: Add festivalId + BreadcrumbBar integration
- BreweryScreen: Add festivalId, pass to EntityDetailScreen
- StyleScreen: Add festivalId, pass to EntityDetailScreen
- FestivalInfoScreen: Add festivalId param
- EntityDetailScreen: Add festivalId + backLabel + BreadcrumbBar
- DrinkListSection: Add festivalId param to buildSlivers methods

Navigation Updates (main.dart):
- BeerFestivalHome: Extract festivalId from URL for tab navigation
- Update bottom nav to use festival-scoped paths

Status:
- Code analysis: PASSED (no code errors)
- Tests: REQUIRE UPDATES (constructor signatures changed)
- Manual testing: PENDING

Next Steps:
- Update all test files to pass festivalId arguments
- Fix mock-related errors in utf8_encoding_test.dart
- Perform manual deep link testing
- Update Phase 1 documentation
Test Updates:
- Add festivalId parameter to all screen constructors in tests
- Use 'cbf2025' as test festival ID consistently
- Generate missing mocks for utf8_encoding_test.dart

Files Updated:
- test/brewery_screen_test.dart: Add festivalId to BreweryScreen
- test/drink_detail_screen_screenshot_test.dart: Add festivalId to DrinkDetailScreen
- test/drink_detail_screen_test.dart: Add festivalId to DrinkDetailScreen
- test/drinks_screen_style_filter_test.dart: Add festivalId to DrinksScreen (2 places)
- test/screens_test.dart: Add festivalId to FestivalInfoScreen
- test/style_screen_screenshot_test.dart: Add festivalId to StyleScreen (2 places)
- test/style_screen_test.dart: Add festivalId to StyleScreen

Mock Generation:
- Run build_runner to generate utf8_encoding_test.mocks.dart

Test Results:
- flutter analyze: ✅ PASSES (0 issues)
- flutter test: ✅ 448 tests passed
- Screenshot tests: 6 golden file mismatches (expected - BreadcrumbBar added)

Note: Golden file failures are expected and require visual regeneration
in proper display environment. All functional tests pass successfully.
Test failure comparison images are generated artifacts and should not be
committed to the repository. These are created when golden file tests fail
and contain pixel-by-pixel comparison images for debugging.
@richardthe3rd
richardthe3rd deleted the claude/festival-deeplink-logging-phase1-j7no5 branch December 27, 2025 10: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.

2 participants