Skip to content

Add aerodrome quick-picks to movement wizard - #827

Merged
rzueger merged 3 commits into
developfrom
feature/aerodrome-quick-picks
Jul 20, 2026
Merged

Add aerodrome quick-picks to movement wizard#827
rzueger merged 3 commits into
developfrom
feature/aerodrome-quick-picks

Conversation

@rzueger

@rzueger rzueger commented Jul 20, 2026

Copy link
Copy Markdown
Member

What & why

Logging a movement means re-typing the same aerodrome ICAO codes into the
destination/origin field every time. Aircraft already have profile-based
quick-picks; aerodromes had nothing. This adds a quick-pick chip bar under
the destination/origin field in both the departure and arrival wizards.

Two complementary parts

1. Home aerodrome first — for everyone (incl. guests / kiosk)
The most common location at a small field is the field itself (circuits /
local flights). __CONF__.aerodrome.ICAO is pinned as the first chip and
sorted first in the aerodrome dropdown. It's labelled "local flight" (the
app's own routes.localFlight term), not "home" — a house icon would clash
with the existing "home base = aircraft based here" concept and mislead
visiting pilots whose base is elsewhere.

2. Personal most-frequent destinations — for logged-in pilots
Derived from the pilot's own movements, keyed on createdBy (their email):

  • Regular users: computed client-side from the already-loaded
    state.movements (which is bounded to their own createdBy) — no extra
    Firebase read
    .
  • Admins / allMovements operators: their loaded list is club-wide, so
    filtering it by their email can return nothing even though their movements
    exist further down (the "row 51" problem). They instead do one bounded,
    session-cached fetch via the existing createdBy_orderKey index.

Freshness

An aerodrome just flown to is recorded on SAVE_MOVEMENT_SUCCESS and shown
immediately (first) in the next form — no dependency on the movement-list
realtime listener, which previously meant a new destination only appeared
after a full page reload.

Layout

Chips render in a new LabeledComponent footer slot, so they sit inside the
destination field and share its width without inheriting the input styling.
Shared chip styling was extracted from AircraftPage into QuickPickBar.

Cost

Zero additional hosting cost for the common case (regular users reuse
already-downloaded data); only the few admin sessions issue one small bounded,
cached read. No new Firebase index, Cloud Function, or stored data.

Scope / limitations

  • Personal list applies on email-login projects (movements carry createdBy);
    elsewhere only the home chip shows. Gated by profileEnabled.
  • Attribution keys on the email a movement was filed under.

Tests

Specs added for the dropdown comparator, aggregation helper, reducer (incl.
session recording), admin fetch saga, selector (regular/admin/session/home/
guest), the component (render/click/guest/readOnly + fetch behaviour), and the
LabeledComponent footer slot.

Note: Jest was not run in the authoring sandbox (platform-mismatched
node_modules vs Jest 30's native resolver); npm run typecheck passes and
CI runs the suites.

rzueger added 3 commits July 20, 2026 17:38
Add a quick-pick chip bar under the destination/origin field in the
departure and arrival wizards:

- Home aerodrome pinned first for everyone (incl. guests), and
  ordered first in the aerodrome dropdown. Labelled "local flight",
  not "home base", to avoid confusing visiting pilots.
- Personal most-frequent destinations for logged-in pilots, derived
  from their own movements. Regular users read already-loaded
  movements (no extra request); admins, whose list is club-wide,
  fetch their own via the existing createdBy_orderKey index.
- A just-used aerodrome is recorded on save and shown immediately in
  the next form, without waiting for the movement list to reload.

Chips render in a new LabeledComponent footer slot so they share the
field width. Shared chip styling extracted to QuickPickBar.
LS aerodromes rank before non-LS after the home aerodrome, so LSGG
precedes LFSB.
testing-library getByTestId targets data-testid; the chips use the
repo's data-cy convention.
@rzueger
rzueger merged commit e1be916 into develop Jul 20, 2026
2 checks passed
@rzueger
rzueger deleted the feature/aerodrome-quick-picks branch July 20, 2026 18:49
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