feat(location)!: one place picker and one place label everywhere - #281
Merged
Merged
Conversation
A dive site's location is the object a trip part's already was: a name, a fuller name, a centre and a box. Both forms fill it from one mapping, and every surface that read the member as text reads its name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The nested schema error has no renderable message, so the Location field enforces its own width. The trip schema's fixtures spelled the old member name, which Zod stripped, so two of them asserted nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…oining The cap belongs to one component, which every surface that joins a trip's places renders - so the constant stays private and the page's own call is a presence check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
A dive site's location is now the same object a trip part's already was — a name, a fuller name, a centre and a box — so the app has one place shape rather than a structured object on one host and a free-text string on the other. Both pickers fill it from one mapping in
lib/locations.ts: the API's composed short form becomesnameand the provider's full label becomesfull_name, which is stored for the export and rendered nowhere. The dive-site form's Location field carries the whole object and shows its name, so editing a site does not strip the locality a pick brought with it, and clearing it sends an explicitnull. A reverse-geocoded place fills the name alone — the coordinates a dropped pin returns are the site's own, not the locality's centre. Every surface that read the member as text readslocation.name; with the country inside that name, a trip's compact label shows one place and a count, and every joined list of places separates with;rather than,.Verified with
npm run ci(lint, type-check, 7154 unit tests, build),npm run test:coverageandnpm run test:e2e, all green; the new form-write and reverse-geocode tests were each checked against a deliberately broken implementation first.🤖 Generated with Claude Code