Repository navigation
fix(spec): page and related-list columns name a mixed array in their refusal - #39232
Conversation
…refusal The list page's interfaceConfig.columns and the record:related_list columns prop share the list view's union error, moved verbatim into a module-local file that ui/index.ts does not re-export. Pins per union, plus the metadata-protocol walker keeping the non-default union head. Claude-Session: https://claude.ai/code/session_01Utp6CaTJhEQ1M6macqmBoN Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6d9448bed4d6d298ad9cf46fd9e475fb901f7f5b && git checkout 6d9448bed4d6d298ad9cf46fd9e475fb901f7f5b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 724b3695e9208d0430075a82b195c49e6f6f0b7b c5936fb06f6ac5dd48ee0140a980cfa75314d902 && git checkout -B drift-repro 724b3695e9208d0430075a82b195c49e6f6f0b7b && git merge --no-ff c5936fb06f6ac5dd48ee0140a980cfa75314d902
node scripts/docs-audit/affected-docs.mjs --json 724b3695e9208d0430075a82b195c49e6f6f0b7b
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYHCfrNqXVPhRFuHmE Contract-review-claim: session_01Utp6CYHCfrNqXVPhRFuHmE · head c5936fb · 2026-12-03T02:12Z |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYHCfrNqXVPhRFuHmE Contract reviewServed-tier: Inputs read: card #39036 (body, 4 comments: triage audit, claim 7363732790, amendment 7363760332, os-dev report), PR #39232 (body, 7 files, net diff against ① Derived judgments
② Semver level
Clause-②: no — holds. Nothing is narrowed (every previously accepted ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Wire path (read, not reviewed):
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYHCfrNqXVPhRFuHmE 席位核对ACCEPT — L1 of record for PR #39232 (card #39036) at head Mechanical face:
|
Requested by Bill · project thread
repo:objectstack@os-bill · os-bill · session_01Utp6CaTJhEQ1M6macqmBoN
Fixes #39036
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The list view's
columnsrefusal for a mixed array (LIST_VIEW_COLUMNS_MIXED+listViewColumnsUnionError, landed for the list view) now also answers the two sibling declarations of the same exclusivez.union([z.array(z.string()), z.array(ListColumnSchema)]):packages/spec/src/ui/page.zod.ts:InterfacePageConfigSchema.columns(a list page's owninterfaceConfig.columns) gains{ error: listViewColumnsUnionError }.packages/spec/src/ui/component.zod.ts:RecordRelatedListProps.columns(therecord:related_listprop) gains the same option; its docblock says the refusal names the mix.packages/spec/src/ui/list-columns-mix.ts(new): the constant and the callback moved here verbatim fromview.zod.ts, which now imports them. The module is reached by relative import only and is not re-exported fromui/index.ts, followingfilter-rule-array.ts(ruleArrayFilterError). Exporting the callback fromview.zod.tsinstead would have added a public symbol to@objectstack/spec/ui, becauseui/index.tsdoesexport * from './view.zod'. The api-surface baseline does not move (see the gates below).The accept set of all three unions is unchanged: the callback answers only when the array holds both a string and an object entry, and returns
undefinedotherwise, so every other failure keeps zod'sInvalid input.Consumers read first (the card's "check first"), on
ui/at the base commit:InterfaceListPage.tsxhandsinterfaceConfig.columnsto the list view as itscolumns, so it reaches the same grid path that reads the whole array in the spelling of its first entry (normalizeColumnsinui/packages/plugin-grid/src/objectGridColumns.ts). Accepting a mix there would drop or misread entries, so the union stays exclusive.record-related-list.tsx(colNameper entry) andRelatedList.tsx(expandFields,typeofper entry) read each entry on its own, not by the first one. The union stays exclusive anyway, because the key declares the same union aslistViews[].columnsand a saved view's columns are composed onto it verbatim.Tests
packages/spec/src/ui/view-columns-mix.test.ts, the existing harness, two new top-level describes:interfaceConfig.columns,record:related_listcolumns): all names and all objects parse; each of the three mixes is refused with the sentence on theinvalid_unionhead atcolumns; a non-mix failure (['name', 3]) keepsInvalid input;PageSchemarefuses a mixed list page atinterfaceConfig.columnswith the sentence, and accepts both one-spelling controls;ComponentPropsMap['record:related_list']is the pinnedRecordRelatedListProps(the schema the component-props lint judges a page element by).packages/metadata-protocol/src/protocol.save-union-issues.test.ts, in the existing describe for the keep-the-head rule (the L2 review's nit N2 on the list view PR): a view save withcolumns: ['title', { field: 'status' }]answers 422INVALID_METADATA, stores nothing, andcollectMetadataIssueskeeps thecolumnsunion head with the mix sentence, first among thecolumnsentries. CONTROL: the same view in one spelling saves. 51 passed.Ablation, per union (sed on the committed file, restored with
git checkout HEAD --, porcelain clean after):{ error: listViewColumnsUnionError }frompage.zod.tsPageSchemadoor)component.zod.tsview.zod.tsview.zod.ts, spec rebuilt, metadata-protocol fileEach ablation reds only its own union's pins. After restoring and rebuilding spec: 26/26 and 51/51.
Acceptance notes
packages/lint/src/validate-component-props.ts) reads a refusedrecord:related_listbag throughdescribeIssue, which prints the union head's own message first, so it now carries the sentence. Read in the code, not pinned here (outside this card's surface).Verification
Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/ui/view-columns-mix.test.tsprints 26 passed.Files to read first:
packages/spec/src/ui/list-columns-mix.ts, then the one-line uses inpage.zod.tsandcomponent.zod.ts, then the new describes inview-columns-mix.test.ts.Local gates
Derived gates at
d3add681(baseorigin/main440331f). Thenorigin/mainwas merged once (c5936fb0, bringing 724b369 among three commits, which touchespackages/spec/src/ui/component.zod.tsfar from this hunk; clean merge). Atc5936fb0: spec and metadata-protocol's dependency closure rebuilt,check:generated14 of 14 up to date,view-columns-mix.test.ts26 passed,action-notices.test.tspassed,protocol.save-union-issues.test.ts51 passed.dispatch-gates.mjs --ran: 95 derived families accounted for, 92 run, 92 exit 0, 3 NOT-MEASURED (exit 3, prerequisite not met):check-plugin-teardown-shape --self-test(shallow-clone fixture),check:dual-build-cjs-loadsandcheck:lean-entry-closure(built dist of packages this diff does not touch; CI builds them). Diff 212 lines (+172 / -40), under the 3,000 human-review line.pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date against a dist built from this head,check:api-surfaceincluded, so the public surface does not move (the new module is not exported).pnpm --filter @objectstack/spec typecheck(tsc + scripts + test layer) exit 0;pnpm --filter @objectstack/metadata-protocol typecheckexit 0.vitest run src/ui src/api/zod-issues-to-fields.test.ts src/shared: 241 files, 7939 tests passed.overlap-check.mjsbefore the first push: clean againstorigin/mainand the two open PRs sharing a file (fix(spec): describe prose names App Studio, not the retired "Studio" #39218 onview.zod.ts, feat(spec):noticeson an action, warnings its dialog draws before submit (#39182) #39201 oncomponent.zod.ts).🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CaTJhEQ1M6macqmBoN