refactor: remove dead widgets and navigation helpers - #502
Conversation
Delete BottomActionBar/ActionButton, AvailabilityBadge, BreadcrumbBar, ABVStrengthHelper and four unused navigation helpers, along with the tests that were their only callers. buildDrinksPath and buildCategoryPath built routes the router never registered. Fixes #500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017B31wKKL578bV18hcpXyE2
There was a problem hiding this comment.
Pull request overview
Removes several unused UI widgets and navigation helpers (and their now-orphaned tests) that had no production call sites, and updates barrels + documentation to reflect the reduced public surface.
Changes:
- Deleted unused widgets (
BottomActionBar,AvailabilityBadge,BreadcrumbBar) andABVStrengthHelper. - Deleted unused navigation helpers (
buildDrinksPath,buildCategoryPath,extractFestivalId,isFestivalPath) and pruned related tests. - Updated barrels and docs (including the
ui-and-accessibilityskill) to remove references to deleted symbols.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/widgets/breadcrumb_bar_test.dart | Removed tests for deleted BreadcrumbBar. |
| test/widgets/availability_badge_test.dart | Removed tests for deleted AvailabilityBadge. |
| test/utils/navigation_helpers_test.dart | Removed tests for deleted navigation helpers. |
| test/utils_test.dart | Removed ABVStrengthHelper test group. |
| test/abv_strength_helper_test.dart | Removed dedicated ABVStrengthHelper tests. |
| lib/widgets/widgets.dart | Removed barrel exports for deleted widgets. |
| lib/widgets/breadcrumb_bar.dart | Deleted unused widget implementation. |
| lib/widgets/bottom_action_bar.dart | Deleted unused widget implementation. |
| lib/widgets/availability_badge.dart | Deleted unused widget implementation. |
| lib/utils/utils.dart | Removed barrel export for deleted ABVStrengthHelper. |
| lib/utils/navigation_helpers.dart | Removed unused path builders/parsers while keeping in-use helpers. |
| lib/utils/abv_strength_helper.dart | Deleted unused helper implementation. |
| docs/README.md | Removed BreadcrumbBar from the UI components description. |
| docs/code/ui-components.md | Removed the BreadcrumbBar section. |
| docs/code/navigation.md | Updated navigation documentation to remove stale routes/helpers (needs minor correction per comments). |
| .claude/skills/ui-and-accessibility/SKILL.md | Updated shared-widget reuse table and navigation-helper list to remove deleted symbols. |
Comments suppressed due to low confidence (1)
docs/code/navigation.md:47
- This snippet calls
buildDrinkDetailPathwith only a drink ID, but the helper requires bothcategoryanddrinkId(and the router path includes both). Updating the example avoids misleading copy/paste.
// Build detail URLs
final drinkUrl = buildDrinkDetailPath('cbf2025', drink.id);
final breweryUrl = buildBreweryPath('cbf2025', brewery.id);
final styleUrl = buildStylePath('cbf2025', 'IPA'); // Returns: '/cbf2025/style/ipa' (lowercase)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://fix-500-remove-dead-widgets.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
The router registers /:festivalId/drink/:category/:id and buildDrinkDetailPath takes three arguments, but the examples showed a two-argument call and /cbf2025/drink/123 as a deep link. Pre-existing drift, corrected while pruning the deleted helpers from this file. Addresses review feedback on #502. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017B31wKKL578bV18hcpXyE2
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://fix-500-remove-dead-widgets.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
Fixes #500
Five symbols in
lib/had zero production call sites and were kept alive only by their own tests — inflating coverage and implying the widgets were exercised. Decision was to delete rather than retain with a note.Deleted
BottomActionBar,ActionButtonlib/widgets/bottom_action_bar.dartYourTakeCardarrangement on the detail screenAvailabilityBadgelib/widgets/availability_badge.dartdrink_card.dart, which handles all sixAvailabilityStatusvalues rather than a sold-out/available binaryBreadcrumbBarlib/widgets/breadcrumb_bar.dartABVStrengthHelperlib/utils/abv_strength_helper.dartbuildDrinksPath,buildCategoryPath,extractFestivalId,isFestivalPathlib/utils/navigation_helpers.dartPlus the four barrel exports and the tests that were their only callers:
availability_badge_test.dart,breadcrumb_bar_test.dart,abv_strength_helper_test.dart, and the dead groups inutils_test.dartandnavigation_helpers_test.dart.buildDrinksPathandbuildCategoryPathare worth calling out: they built/{festivalId}/drinksand/{festivalId}/category/{name}, neither of whichrouter.dartever registered. They were stale, not merely unused.Kept
buildFestivalPathstays — no external call sites, but it is the base helper the surviving builders delegate to.buildFestivalHome,buildFavoritesPath,buildFestivalInfoPath,buildDrinkDetailPath,buildBreweryPath,buildStylePathandnavigateToRouteare all in production use.Docs
Updated
docs/code/ui-components.md,docs/code/navigation.md,docs/README.md, and theui-and-accessibilityskill's shared-widget reuse table.docs/planning/archive/**is deliberately untouched — those files record what was planned and built at the time, and rewriting them would falsify the archive.Verification
Net −1345 lines across 16 files.
./bin/mise run checkgreen, and this grep returns zero hits:Also verified green on the union with #499, which touches the same
widgets.dartbarrel. Expect a Codecov drop — deleting tested-but-dead code removes covered lines.Generated by Claude Code