feat: add flight track preference option#655
Conversation
|
Label error. Requires exactly 1 of: changelog:.*. Found: Web |
|
| const activeFlightTracks = $derived.by(() => { | ||
| if (mapPreferences.routeDisplay !== 'tracks') return []; | ||
| return flightTracks; | ||
| }); |
There was a problem hiding this comment.
🟡 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'.
| 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'`.
There was a problem hiding this comment.
I don't think I agree with this suggestion, if I'm understanding it correctly. What I think it's saying:
- Open the map preferences panel
- Hover over an arc/track
- Move your mouse onto the map preferences panel such that the arc stays selected
- Change the new setting
- 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...
There was a problem hiding this comment.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.



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.
I'm really not familiar with svelte, so I definitely appreciate any feedback!
Testing:
Note
Add flight track route display preference to map appearance controls
RouteDisplayModetype ('tracks'|'points') tomapPreferences, defaulting to'tracks', with persistence to and restoration from localStorage.MapAppearanceControl.svelteletting users toggle between 'Flight tracks' and 'Point to point' route rendering; the section is only shown when flight tracks are present.routeDisplayis not'tracks',AirportsArcsLayer.sveltereceives 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.