Skip to content

fix(dashboard): route gear chips to /equipment instead of missing /gear - #740

Merged
ericgriffin merged 1 commit into
submersion-app:mainfrom
etlami:fix/dashboard-gear-route
Jul 28, 2026
Merged

fix(dashboard): route gear chips to /equipment instead of missing /gear#740
ericgriffin merged 1 commit into
submersion-app:mainfrom
etlami:fix/dashboard-gear-route

Conversation

@etlami

@etlami etlami commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Problem

On the home dashboard, tapping + Add gear (and the gear service chips / the overdue-service urgent banner) crashes to the Page Not Found screen with:

GoException: no routes for location: /gear

There is no /gear route in app_router.dart — the gear/equipment section is registered at /equipment. The dashboard widgets just navigate to the wrong path.

Fix

lib/features/dashboard/presentation/widgets/:

  • gauge_strip.dart
    • "Add gear" chip -> context.push('/equipment/new') (opens the add-gear form directly, consistent with how gear is added elsewhere, e.g. equipment_list_content.dart).
    • Gear service chips -> context.go('/equipment') (the gear list).
  • urgent_banner.dart
    • Overdue-service destination -> /equipment.

Why the tests didn't catch it

gauge_strip_test.dart and urgent_banner_test.dart built their own stub GoRouter that defined a /gear route, so they asserted navigation against a path the real app router never had. Updated the stub routes and assertions to the real /equipment / /equipment/new routes so they now guard against this regression.

Testing

Run locally against Flutter 3.44.8 / Dart 3.12.2:

  • flutter test test/features/dashboard/ -> all pass (43 tests)
  • flutter analyze on the changed files -> no issues
  • dart format -> clean

The dashboard gauge strip and urgent banner navigated to `/gear`, which
is not a registered route (the gear/equipment section lives at
`/equipment`). Tapping "Add gear", a gear service chip, or the urgent
banner therefore threw `GoException: no routes for location: /gear` and
showed the "Page Not Found" screen.

- Add-gear chip now pushes `/equipment/new` (opens the add form directly,
  matching how gear is added elsewhere).
- Gear service chips and the overdue-service urgent banner now go to the
  `/equipment` list.

The widget tests defined their own stub `/gear` route, so they passed
against a path the real app router never had. Updated the stubs and
assertions to the real `/equipment` routes so they now guard against a
regression.

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

This PR fixes a dashboard navigation crash caused by dashboard widgets routing to a non-existent /gear location, aligning them with the app’s actual equipment section routes under /equipment.

Changes:

  • Update dashboard widgets to navigate to /equipment and /equipment/new instead of /gear.
  • Adjust dashboard widget tests’ stub GoRouter routes and assertions to match the real router paths.
  • Ensure “Add gear” from the dashboard opens the add-equipment form directly.

Reviewed changes

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

Show a summary per file
File Description
lib/features/dashboard/presentation/widgets/gauge_strip.dart Routes “Add gear” to /equipment/new and gear-service chips to /equipment.
lib/features/dashboard/presentation/widgets/urgent_banner.dart Routes overdue-service urgent banner to /equipment.
test/features/dashboard/presentation/widgets/gauge_strip_test.dart Updates stub routes and assertions to /equipment and /equipment/new.
test/features/dashboard/presentation/widgets/urgent_banner_test.dart Updates stub route and assertions to /equipment.
test/features/dashboard/presentation/pages/dashboard_page_test.dart Updates stub router to include /equipment with nested new route.

@codecov

codecov Bot commented Jul 27, 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

📦 Build artifacts for this PR · commit 01512ce

Platform Download
Android (APK) android-apk
macOS macos-build
Windows windows-build
Linux linux-build

Artifacts expire in 7 days. Downloading requires being signed in to GitHub. The macOS build is ad-hoc signed — right-click → Open on first launch.

Updated automatically on each push.

@ericgriffin
ericgriffin merged commit 49c859f into submersion-app:main Jul 28, 2026
25 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Submersion Release Tracker Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants