iOS: add a new person straight from the crew/passenger picker - #34
Conversation
Someone not in the app yet meant leaving the flight, creating them under People, and coming back to pick them. The picker now has a (+) with the same Add Person, Scan Document and Import from Contact as the People tab; the person it ends with, new or matched to someone already there, goes straight into the selection as a passenger (crew if they are usual crew). Add Person and a contact open the editor inside the picker, since both still need a document; a scan has filled that in, so it doesn't. A search that finds nobody offers to add them under the name typed. The three flows move out of PeopleListView into AddPersonMenu, so the People tab and the picker share one copy, including the macOS file-scan path. They now hand over a person, or present the next sheet, only once the sheet before has dismissed: every one of those sheets calls back first, and a push or presentation made while a sheet is still leaving is dropped. Backing out of Add Person without typing anything left an empty person in People, and in the picker would have put them on the flight. Person.isBlank now lets both take such a person away again; the picker only ever removes one it created itself. Closes #32 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code ReviewReviewed the diff, Traced the blank-person lifecycle in detail ( The one edge case noted (a contact "Create as New Person" that comes from a contact with no name/phone/email/address/DOB isn't tracked for blank-discard the way No high-confidence bugs, design deviations, or correctness issues found. Approving. |
Closes #32
What changes for the pilot
How
Views/AddPersonMenu.swift:AddPersonMenuItems+.addPersonFlows(request:onPerson:)now hold the flows that were insidePeopleListView, including the macOS image/PDF scan.PeopleListViewkeeps CSV import/export.ContactResolveViewandMRZResultActionViewall call back before dismissing. The flows present the next step, or report the person, fromonDismiss, because a presentation or push made while a sheet is still leaving is silently dropped. This matters most inside the picker's own sheet.Person.isBlank(no name, DoB, contact details, place of birth or documents). The picker only removes a person it created, never one reached by a match or merge. Its swipe-away check sits on theNavigationStack, not the root list, because the root also disappears when the editor is pushed. The first UI run caught exactly that, when it was on the root.needs_review).designs/ios-app.mdhas a new Adding People section.Testing
AddPersonTests(8 tests:isBlank, discard rule, name split); the wholeflyfun-formsTeststarget passes on iOS.testAddPassengerFromPeoplePicker: (+) → Add Person → type a name → back → selected as Passenger → Done → listed on the flight.testPeoplePickerDiscardsBlankAndAddsSearchedName: blank person backed out → gone; searched name → added, prefilled, saved in People, no empty row left.🤖 Generated with Claude Code