Skip to content

fix(dashboard): eliminate duplicated constants across map, nav, and settings components#12

Merged
bsatrom merged 2 commits intomainfrom
fix/dashboard-shared-constants
Apr 17, 2026
Merged

fix(dashboard): eliminate duplicated constants across map, nav, and settings components#12
bsatrom merged 2 commits intomainfrom
fix/dashboard-shared-constants

Conversation

@bsatrom
Copy link
Copy Markdown
Member

@bsatrom bsatrom commented Apr 15, 2026

Summary

  • Extract getLocationSourceInfo from FleetMap + DeviceDetail into src/utils/locationSource.ts
  • Extract MAP_STYLES / DEFAULT_MAP_CENTER from three map components into src/config/mapConfig.ts
  • Extract navItems from Sidebar + MobileNav into src/config/navigation.ts (fixes nav inconsistency between desktop and mobile)
  • Extract DEFAULT_PREFERENCES from PreferencesContext + useUserProfile into src/config/preferences.ts
  • Add fahrenheitToCelsius to formatters.ts, remove local copy from FleetDefaults
  • Simplify getAlerts to use apiGet's built-in params support

Test plan

  • Fleet map renders with correct location source badges
  • Mobile nav shows same items as desktop sidebar
  • Display preferences load and save correctly
  • FleetDefaults temperature conversion works in both directions
  • Alert list API calls include filters correctly

🤖 Generated with Claude Code

bsatrom and others added 2 commits April 14, 2026 17:23
…config modules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…signature

Merge origin/main to pick up the test suite added in #18, resolve import
conflict in DeviceDetail.tsx (kept Satellite icon from this PR), and update
5 assertions in alerts.test.ts to match getAlerts's new apiGet(url, params)
call pattern introduced by this PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@bsatrom bsatrom merged commit 636dd63 into main Apr 17, 2026
1 check passed
@bsatrom bsatrom deleted the fix/dashboard-shared-constants branch April 17, 2026 02:02
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.

1 participant