docs(fields): teach the spec's { lat, lng } as the stored location value - #6671
Conversation
…value
`content/docs/fields/location.mdx` taught the deprecated `{ latitude,
longitude }` spelling as the canonical stored shape in its prose, `plaintext`
and `jsonc` blocks -- none of which any gate compiles, which is why the
spelling survived there after the compiled `tsx` snippet was corrected.
`valueSchemaFor({ type: 'location' })` REJECTS that spelling (`invalid_type`
at `[lat]` and `[lng]`) and accepts `{ lat, lng, altitude?, accuracy? }`, so
the page was instructing the next author -- human or AI -- to write a value
the platform's own contract refuses.
Geographic wording is deliberately kept: the input format, the placeholder and
the `center` tuple all still read "latitude, longitude" because only the
STORED key names are the spec's.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRJge11jso9TpXRWFt1Z49
✅ ACCEPT — flipped ready, auto-merge onReviewer: Gate reading, stated precisely — this PR's check population is 25, not the usual 29All 25 check runs read and the returned count compared against
The coherent explanation is that this is a docs-only diff (one file, What the dev did that this seat asked for, and did not do what it warned againstThe scope-correction comment on #6660 existed to remove a trap this seat planted: the card's body still described a broken tsx snippet at The remaining defect was real and is what got fixed: the page taught ⭐ A second defect found and fixed that the card did not nameThe page claimed "no exported type declares that value shape." That claim is now false — it is The contract was measured, not quotedRather than taking the shape from the card, a probe ran inside the package graph against the pinned
The last three do double duty: they re-confirm the page's own Validation range claims are true, which a docs fix could easily have left unchecked. Two process readings I am ratifying
The changeset question was ruled by the gate ( Generated by Claude Code |
Fixes #6660
content/docs/fields/location.mdxtaught the deprecated{ latitude, longitude }spelling as the canonical stored shape of a
type: 'location'value. The contract,measured on this branch against the pinned
@objectstack/spec:A published page instructing the next author — human or AI — to write the exact
spelling the platform's own contract refuses is the most plausible source of
deprecated-spelling data in the wild. That is what this PR closes.
The last two probe rows also re-confirm the page's
## Validationsection istelling the truth: the range claims are really enforced (
too_big), so only thekey spelling in that block needed to move.
Per-site census
Every occurrence on the page, with the block it sits in and whether a gate reads
that block. Line numbers are on this PR's base (
8631c32a), re-located on that refrather than taken from the card, whose numbers predate PR #6667.
:53-54plaintextlatitude:/longitude:lat:/lng::116jsonccommentread as { latitude, longitude }read as { lat, lng }:134,:137,:140plaintext{ latitude: …, longitude: … }x3{ lat: …, lng: … }x3:40latitudeand alongitude"lat/lng:41-42LocationValuefrom@objectstack/spec/data:63-64lat)" — ties the geographic name to the stored key:101tsxcheck:doc-snippets{ lat: number; lng: number }:3,:6:33tsplaceholder: 'latitude, longitude':58latitude, longitude":119jsonccommentcenteras[latitude, longitude]After the change,
grep -n "latitude:" content/docs/fields/location.mdxreturns0 hits (before: 4). The surviving
latitude/longitudewords are the sixdeliberate ones above, plus one new mention inside the note that forbids the
spelling — named in order to be ruled out, not taught.
:101was already correct — and I did not touch itPR #6667 moved that one line because it is the only site on the page any gate
compiles:
check:doc-snippetscollectsts/tsx/typescriptfences(
TS_FENCE_LANGUAGES,scripts/check-doc-snippet-types.mjs:317) and the widget'snew prop type made the old
useStatetype argument stop being assignable. It reads{ lat: number; lng: number }on this PR's base and it does not appear in thisPR's diff.
That gate boundary is also the whole explanation for why this card exists: the
compiled block was forced correct by CI, and the
plaintext,jsoncand prosearound it — which no gate compiles — kept teaching the opposite.
Fence:
geolocationand the geographic wording are deliberately untouchedGeolocationField/type: 'geolocation'is out of scope:geolocationis not amember of the spec's closed
FieldTypeunion and its value schema accepts bothspellings, so it legitimately keeps
{ latitude, longitude }. This page does notdocument it, so nothing was changed on that account.
Separately, the page keeps saying "latitude, longitude" wherever it means the
geographic quantities rather than the stored keys — the placeholder, the input
format, and the
centertuple. That is not an oversight; it is what the mergedimplementation says, in
packages/fields/src/widgets/LocationField.tsx:The widget parses a comma-separated latitude-then-longitude string and stores
onChange({ lat, lng }). Rewriting the placeholder or the input format tolat, lngwould make the page wrong in the other direction, so the note at:58now states that split explicitly instead.
:119'scenteris likewise a positional[lat, lng]tuple, not an object —ObjectMap.listViewMapConfigReach.test.tsx:170pins it as "centeris[lat, lng](ObjectMapConfigSchema's own description)", i.e. latitude first. The doc comment
already describes that ordering correctly.
:116did change, because it describes what the map reads out of this page'sfield:
ObjectMap.tsx:437-438readslocation.lat/location.lngfirst(
const lat = location.lat || location.latitude;), so{ lat, lng }is thecanonical answer there.
Other pages teaching the same spelling: none found
Checked
content/docs/**for the deprecated spelling as an object key(
grep -rn "latitude:" content/docs/), withgrep -rn "lat:" content/docs/as thepositive control in the same query shape — the control returns hits on
location.mdx:101and nineplugin-map.mdxsites, so the query shape does findwhat it is looking for.
The only hit outside this card's file is
content/docs/plugins/plugin-map.mdx:414,and it is correct as written: it sits under
### Separate Fieldsand shows arecord with separate
latitude/longitudecolumns, which is the map plugin'slatitudeField/longitudeFieldmode — those are real config keys whose defaultsare literally
'latitude'/'longitude'(ObjectMap.tsx:403-404). That same page's### Object Formatsection already teacheslocation: { lat, lng }.content/docs/plugins/index.md:200is the prose bullet "Latitude/longitude support".So: nothing folded in, and nothing owed to another card on this repo's docs.
(The framework-side docs defect is recorded separately as objectstack#12935 — other
repo, other seat.)
Gates
Run on the final commit
e7cf3680; exit codes captured before any pipe, verdictlines quoted from each gate's own output.
check:doc-snippetsSemantic phase: 267 of 267 block(s) judged, 0 failed./Every covered documentation snippet compiles against the built types.check:doc-fences✅ check:doc-fences — every TypeScript block in 223 document(s) is fenced ts/tsx/typescript … No unknown fence spelling hides one.check:doc-types✅ Every documented component type is registered.check:control-bytes✅ check-control-bytes: OK (scanned 5511 tracked text file(s); skipped 85 binary).check:docs-route-closure✅ gauge: 1349 modules crawled from 148 route roots (144 MDX), every specifier resolved …scripts/check-doc-links.mjsLinks are valid across 17 scan roots.scripts/check-changeset-presence.mjs✅ No source of a released package changed in this range, so no changeset is owed.check:doc-snippetsfirst returned exit 2,PRECONDITION NOT MET (exit 2) — The snippet program was NOT run. That is the gate's own "I could not run", not afinding, so it is not reported as a red measurement: the packages it resolves
against were unbuilt in a fresh worktree. I ran the build the gate itself prescribes
(
turbo run build $(node scripts/check-doc-snippet-types.mjs --build-filter) --concurrency=2, 32/32 successful) and re-ran it for the exit 0 above.check:doc-fencesandcheck:doc-snippetsare the ratchet-family gates here, soboth were re-run on the final commit rather than only pre-commit; the working tree
was clean at that point.
Changeset
None owed — ruled by the gate, not guessed:
Sequencing
The card asks that this not land before #6272's widget flip. PR #6667 is already
merged (this branch is cut from it,
8631c32a), so the page now describes theshape the shipped widget actually produces.
Docs-only: no
packages/**source, nocontent/docs/releases/**.Generated by Claude Code
Generated by Claude Code