Skip to content

Conversation

@tariknz
Copy link
Owner

@tariknz tariknz commented Jul 15, 2025

  • Track map setting to turn turn names on/off
  • Refactor drawing utils to seperate file
  • Draw the start finish line ourselves so its more consistent
  • Add outline for track path for better contrast

Copilot AI review requested due to automatic review settings July 15, 2025 07:38
Copy link
Contributor

Copilot AI left a comment

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 adds a user-configurable setting to toggle turn names on the track map, refactors all drawing logic into a standalone trackDrawingUtils.ts file, and replaces the built-in start/finish line and track outline with custom, consistent rendering.

  • Introduce enableTurnNames widget setting and UI toggle
  • Extract canvas drawing routines into trackDrawingUtils.ts
  • Update TrackCanvas to use new utilities, apply settings, and include debug mode

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/frontend/components/TrackMap/trackDrawingUtils.ts New drawing helpers for track outline, start/finish line, turns, and drivers
src/frontend/components/TrackMap/hooks/useTrackMapSettings.tsx Hook to retrieve the turn-name toggle from dashboard widget config
src/frontend/components/TrackMap/hooks/useStartFinishLine.ts Hook computing start/finish line geometry from track points
src/frontend/components/TrackMap/TrackMap.tsx Wired up enableTurnNames and debug flags into the track renderer
src/frontend/components/TrackMap/TrackCanvas.tsx Refactored rendering to use drawing utils, added settings & debug dependencies
src/frontend/components/TrackMap/TrackCanvas.stories.tsx Stories updated to expose enableTurnNames and debug controls
src/frontend/components/Settings/types.ts Extended TrackMapWidgetSettings type with enableTurnNames config
src/frontend/components/Settings/sections/TrackMapSettings.tsx UI for the new toggle under Track Map settings
src/frontend/components/Settings/SettingsLayout.tsx Removed “Experimental” badge from Track Map menu item
src/app/storage/defaultDashboard.ts Added default enableTurnNames: false to the saved dashboard
Comments suppressed due to low confidence (1)

src/frontend/components/TrackMap/hooks/useTrackMapSettings.tsx:24

  • The hook is named useTrackMapSettings but only returns the config object and ignores the widget’s enabled flag. Consider returning an object that includes both enabled and config so consumers can respect the widget’s on/off state.
    return settings as TrackMapSettings['config'];

@tariknz tariknz merged commit f4a695b into main Jul 15, 2025
1 check passed
@tariknz tariknz deleted the feat/track-map-settings branch July 15, 2025 18:25
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