Trey T cb981c5380 Route map: filter from allFlights + filters internally
When the user opened the map and picked a year (e.g. 2026) in the
in-map filter sheet, the map kept drawing every flight instead of
just 2026. Root cause: the map was taking a pre-filtered `flights`
prop from HistoryView via the .sheet content closure. SwiftUI does
propagate the `filters` Binding into the sheet correctly, but it
doesn't reliably re-render the .sheet content closure with the new
pre-filtered prop value when the parent rerenders mid-presentation —
so .onChange(of: filters) fires, reset() runs, but `self.flights`
is the old (unfiltered) prop value, and the rebuilt schedule still
includes every flight.

Fix: stop relying on the parent doing the filtering. The map now
takes `allFlights` (unfiltered) and computes the displayed set
itself via `allFlights.filter { filters.matches($0) }`. Since
`filters` is a Binding that propagates cleanly, the computed set
is always in sync with whatever the user just selected in the
filter sheet — no parent-render-order race.

Also: when opening the map from HistoryView's toolbar or quick-link
card, fold the year-strip `selectedYear` into `filters.years` so
the map opens scoped to whatever the user was browsing on the home
list.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 13:05:21 -05:00
2026-04-08 15:01:07 -05:00
2026-04-08 15:01:07 -05:00
S
Description
No description provided
9.7 MiB
Languages
Swift 57.9%
HTML 33.9%
JavaScript 4.5%
Python 3.5%
Shell 0.2%