Add multi-aircraft profile with wizard quick-pick#702
Merged
Conversation
Migrate profile aircraft storage from a single flat set of fields to an array. Existing profiles are auto-migrated on login (flat fields moved into array, then cleaned up). Migration is error-resilient: profile loads even if the Firebase persist fails, and retries on next login. Profile page: aircraft section replaced with a list that supports add, edit (inline expand), and remove. Pilot form save button moved inside its section. Add form reuses the same field components as the movement wizard. Movement wizard: when the profile has exactly one aircraft, it is prefilled automatically. With two or more, a favourites bar with quick-pick chips appears above the form fields (gold star icon, mobile-friendly tap targets). Backwards-compatible fallback reads flat fields for profiles not yet migrated. Firebase rules updated to allow the new aircrafts array. Duplicate registrations are prevented on add and edit. List is kept sorted alphabetically by registration. Handles Firebase edge case where arrays are stored as objects with numeric keys (defensive normalizer).
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.
Summary
aircrafts/$indexadded to profiles with field validationADD_PROFILE_AIRCRAFTetc.) to avoid collision withsettings/aircraftsmoduleTest plan
npm test— 1775 tests pass (16 new)npm run typecheck— cleanfirebase deploy --only database) before testing