Repository navigation
fix(plugin-detail): an authored record:path with a statusField and no stages derives its stages from the picklist (objectui#11106) - #11147
Conversation
…em from the status picklist (objectui#11106) When `stages` is absent, `RecordPathRenderer` now derives the stages from `statusField`'s picklist on the record context's `objectSchema`, through the same `deriveStages` rule the synthesized default page uses. Authored stages still win; a field with no picklist options keeps the placeholder, which now names the field. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec
… picklist (objectui#11106) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec
…list (objectui#11106) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Inputs read: card objectui#11106 (body, triage ① Derived judgmentsGates on the head, as the check-runs conclude them (42 latest runs):
② Semver level
③ Boundary flags
Deviations (4):
Out-of-scope notes (3):
Claim exclusions honoured: Implemented-by: VERDICT: PASS Generated by Claude Code |
Fixes #11106
Clause-②: no
What changed
An authored
record:pathnode that setsstatusFieldand leavesstagesabsent now renders the status field's picklist as its stages. Before this change it rendered the "record:path — no stages configured" placeholder. The spec describe forstagesreads "Explicit stage definitions (if not using field metadata)", and this package's registration repeats that promise.packages/plugin-detail/src/renderers/record-path.tsx: whenschema.stagesisundefined, the stages come fromderiveStages(ctx.objectSchema, statusField). That is the same functionbuildDefaultHighlightsuses for the synthesized default page. It is imported from../synth/buildDefaultPageSchema, and no copy of the rule is made. Derived stages then take the same road as authored ones:localizeStageLabels, the picklist translation (translateOptions), thenclassify().stageswin, including an explicit empty list.record:path — no stages configured, and field "stage_note" has no picklist options to derive them from. With no definition bound, the placeholder keeps its plain wording.'@object-ui/plugin-detail': patch.Zone 2 measurements (objectui
origin/main84b275c01)deriveStagesdoes not need to move. It is exported fromsynth/buildDefaultPageSchema.tsin this same package, andrecord-details.tsxalready importsderiveFieldGroupDetailSectionsfrom that module. The renderer importsderiveStagesthe same way. The synth file is not edited.objectSchema:record:detailsreadsctx.objectSchema.fields, andrecord:highlightspassesctx?.objectSchemadown. Both production hosts bind it.RecordDetailViewpassesobjectSchema={objectDef}, and the StudioPagePreviewpasses therecordSchemait fetched. The renderer reads that same member, and no fetch is added.record:reference_railcallsdataSource.getObjectSchema, but it does so for other objects' schemas, so it is not the precedent here. A host that binds adataSourceand noobjectSchemastill gets the placeholder.@objectstack/spec17.4.0,SelectOptionSchema.safeParseon{ value: 'open', label: { en: 'Open', 'zh-CN': '打开' } }fails withinvalid_typeatlabel. A picklist option's label is therefore a plain string. Derived stages still pass throughlocalizeStageLabels(its string arm changes nothing) and then throughtranslateOptions, which localizes them from the app bundle'sfieldOptions. The zh pin covers that path.Tests
New file:
packages/plugin-detail/src/renderers/__tests__/record-path.derivedStages-11106.test.tsx, 10 rows. Every row mounts the JSON node{ type: 'record:path', properties }through the realSchemaRendererand this package's registration, insideI18nProviderandRecordContextProvider.data-stage-state="current",aria-current="step", accessible nameNegotiation, current stage.fieldOptionstranslate the derived stages, and the current stage announces方案,当前阶段.closed_wonis the won terminus, andclosed_lostleaves the forward path.record:pathnode, frombuildDefaultHighlights, renders the same stages as the authored node.objectSchemabound keeps the placeholder.Ablation. Run after the fix was committed, with
ablation-replace.mjsfrom the objectstack checkout. It replaced the derivation expression withauthoredStages: anchor x1 → x0, blob01af261a277a→7c5f05728d7c. The new file then readTests 5 failed | 5 passed (10).01af261a277a), andgit diff HEADis empty.Gates, all run at
446aaafd7(this branch's head)pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-detail^...' build: exit 0. It built the dependency closure before any type reading.pnpm exec vitest run packages/plugin-detail/:Test Files 224 passed | 1 skipped (225)andTests 2202 passed | 8 skipped (2210). The 225 matchesgit ls-files packages/plugin-detail's test-file count.pnpm --filter @object-ui/plugin-detail type-check(tsc --noEmit && tsc -p tsconfig.test.json): exit 0.tsc -p tsconfig.test.json --listFilesOnlylists both changed.tsxfiles.pnpm exec eslint --no-inline-configon the 2 changed files: 0 errors.record-path.tsxhas 9 warnings, and the base file has the same count and the same rules. Eight areno-explicit-any, and one isreact-hooks/preserve-manual-memoization, on thestagesmemo this diff does not touch. The run is narrowed to these files, and three pieces of evidence back the narrowing:files: ['**/*.{ts,tsx}'];--format json;--print-configshowsparserOptions{}), so this diff cannot move the verdict on any untouched file.pnpm lintbelongs to CI.node scripts/check-changeset-presence.mjs: 0.check-control-bytes: 0.check-new-cross-file-line-citations: 0, with 0 new citations.check-test-path-roots: 0.check-vi-mock-specifiers: 0.check-changeset-no-major: 0.pnpm testand other packages' suites belong to CI. No public surface moved: no spec contract, no publishedexportsand no wire shape changed. The console suites that mountrecord:pathpass explicitstages.Acceptance notes
@object-ui/types'RecordPathComponentPropsdeclaresstagesas required andlabel: string, which is narrower than the spec row (optional,I18nLabel). The renderer readsschema.stagesthroughunknownso the absent branch is not typed as unreachable. That interface is already carried by the claim-debt ledger (CLAIM_DEBTinscripts/check-spec-symbol-derivation.mjs, objectui#4592). No card is filed.deriveStagesderives from any field whoseoptionsarray is non-empty, not only fromselect. That is the shared rule, and it is unchanged here, so the default page and an authored page agree.objectSchemaonly. A host that binds adataSourcebut noobjectSchemagets the placeholder. Both production hosts bind it.This change was made in session
https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec(domain:uiseat 2, branchclaude/issue-11106-record-path-derive-stages).Generated by Claude Code