Skip to content

feat: add flight track preference option#655

Open
achatman wants to merge 2 commits into
johanohly:mainfrom
achatman:feat/flight-track-preference
Open

feat: add flight track preference option#655
achatman wants to merge 2 commits into
johanohly:mainfrom
achatman:feat/flight-track-preference

Conversation

@achatman

@achatman achatman commented Jul 9, 2026

Copy link
Copy Markdown

Closes #645.
Adds a map preferences option to display all flights in point-to-point mode rather than flight tracks. Default is to display flight tracks. If there are no flight tracks (either none in the database or flight tracks were not included in the share) then the option is hidden.

image

I'm really not familiar with svelte, so I definitely appreciate any feedback!

Testing:

  • While there are no flights with a flight track, confirm the option doesn't appear
  • Add a flight with a track, confirm the option now appears
  • Confirm toggling the option appropriately draws the flight tracks vs point to point
  • Confirm that the option appears appropriately in shares, based on whether tracks were included

Note

Add flight track route display preference to map appearance controls

  • Adds a RouteDisplayMode type ('tracks' | 'points') to mapPreferences, defaulting to 'tracks', with persistence to and restoration from localStorage.
  • Adds a Tracks section to MapAppearanceControl.svelte letting users toggle between 'Flight tracks' and 'Point to point' route rendering; the section is only shown when flight tracks are present.
  • When routeDisplay is not 'tracks', AirportsArcsLayer.svelte receives an empty track list, disabling track path rendering.
📊 Macroscope summarized 455383a. 5 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

@github-actions github-actions Bot added the Web label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Label error. Requires exactly 1 of: changelog:.*. Found: Web

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Comment on lines +121 to +124
const activeFlightTracks = $derived.by(() => {
if (mapPreferences.routeDisplay !== 'tracks') return [];
return flightTracks;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium map/AirportsArcsLayer.svelte:121

When mapPreferences.routeDisplay is toggled away from 'tracks' while the pointer is hovering a track, activeFlightTracks empties and the track layer is removed without emitting a leave event, leaving hoveredArc stale. The route stays highlighted/dimmed and the hover popup can remain stuck open until the pointer moves over another feature. Consider clearing hoveredArc (and resetting layerEvent) when routeDisplay changes away from 'tracks'.

Suggested change
const activeFlightTracks = $derived.by(() => {
if (mapPreferences.routeDisplay !== 'tracks') return [];
return flightTracks;
});
const activeFlightTracks = $derived.by(() => {
if (mapPreferences.routeDisplay !== 'tracks') {
hoveredArc = undefined;
return [];
}
return flightTracks;
});
🤖 Copy this AI Prompt to have your agent fix this:
In file @src/lib/components/map/AirportsArcsLayer.svelte around lines 121-124:

When `mapPreferences.routeDisplay` is toggled away from `'tracks'` while the pointer is hovering a track, `activeFlightTracks` empties and the track layer is removed without emitting a leave event, leaving `hoveredArc` stale. The route stays highlighted/dimmed and the hover popup can remain stuck open until the pointer moves over another feature. Consider clearing `hoveredArc` (and resetting `layerEvent`) when `routeDisplay` changes away from `'tracks'`.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I agree with this suggestion, if I'm understanding it correctly. What I think it's saying:

  1. Open the map preferences panel
  2. Hover over an arc/track
  3. Move your mouse onto the map preferences panel such that the arc stays selected
  4. Change the new setting
  5. See that the arc (or track) has changed to a track (or arc) and is still highlighted

3 seems to me like an odd thing to do to begin with, and I'm not convinced 5 is necessarily wrong. I'm happy to defer if I'm wrong here, but I'd prefer someone weigh in before spending more time on this.

The suggested fix seems to completely break the setting. I'm not entirely sure why (again, not familiar with svelte), but I'm guessing because hoveredArc isn't defined until ~75 lines later. Though defining it earlier doesn't seem to work either...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant