Skip to content

refactor: remove dead widgets and navigation helpers - #502

Merged
richardthe3rd merged 2 commits into
mainfrom
fix/500-remove-dead-widgets
Jul 26, 2026
Merged

refactor: remove dead widgets and navigation helpers#502
richardthe3rd merged 2 commits into
mainfrom
fix/500-remove-dead-widgets

Conversation

@richardthe3rd

Copy link
Copy Markdown
Owner

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

Symbol File Note
BottomActionBar, ActionButton lib/widgets/bottom_action_bar.dart 0 call sites, 0 test references anywhere; superseded by the FAB + YourTakeCard arrangement on the detail screen
AvailabilityBadge lib/widgets/availability_badge.dart superseded by the availability chip in drink_card.dart, which handles all six AvailabilityStatus values rather than a sold-out/available binary
BreadcrumbBar lib/widgets/breadcrumb_bar.dart documented as current but never wired up
ABVStrengthHelper lib/utils/abv_strength_helper.dart
buildDrinksPath, buildCategoryPath, extractFestivalId, isFestivalPath lib/utils/navigation_helpers.dart

Plus 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 in utils_test.dart and navigation_helpers_test.dart.

buildDrinksPath and buildCategoryPath are worth calling out: they built /{festivalId}/drinks and /{festivalId}/category/{name}, neither of which router.dart ever registered. They were stale, not merely unused.

Kept

buildFestivalPath stays — no external call sites, but it is the base helper the surviving builders delegate to. buildFestivalHome, buildFavoritesPath, buildFestivalInfoPath, buildDrinkDetailPath, buildBreweryPath, buildStylePath and navigateToRoute are all in production use.

Docs

Updated docs/code/ui-components.md, docs/code/navigation.md, docs/README.md, and the ui-and-accessibility skill'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 check green, and this grep returns zero hits:

rg -n '\b(BottomActionBar|ActionButton|AvailabilityBadge|BreadcrumbBar|ABVStrengthHelper|buildDrinksPath|buildCategoryPath|extractFestivalId|isFestivalPath)\b' lib test docs/code docs/README.md .claude

Also verified green on the union with #499, which touches the same widgets.dart barrel. Expect a Codecov drop — deleting tested-but-dead code removes covered lines.


Generated by Claude Code

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
Copilot AI review requested due to automatic review settings July 26, 2026 13:35

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

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) and ABVStrengthHelper.
  • Deleted unused navigation helpers (buildDrinksPath, buildCategoryPath, extractFestivalId, isFestivalPath) and pruned related tests.
  • Updated barrels and docs (including the ui-and-accessibility skill) 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 buildDrinkDetailPath with only a drink ID, but the helper requires both category and drinkId (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)

Comment thread docs/code/navigation.md
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your 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
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

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

@richardthe3rd
richardthe3rd merged commit 0ad31ee into main Jul 26, 2026
14 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 26, 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.

Dead widgets and helpers kept alive only by their own tests

3 participants