Conversation
## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.