Repository navigation
fix(plugin-detail): the record strip is the declared highlights only; the path's stage and the owner show once - #28907
Conversation
… the path's stage and the owner show once An object that declares no highlightFields gets no strip on the default page, the phone header or the hover card, so every field stays in the body. The stage field leaves the body when the page draws record:path for it, the meta line leaves the owner out when the strip carries it, and owner_id reads 负责人 in zh-CN, the word the ui pack already uses. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU8qzB9Vbw2NdbFxiG
…the owner once Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU8qzB9Vbw2NdbFxiG
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU8qzB9Vbw2NdbFxiG
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU8qzB9Vbw2NdbFxiG
📓 Docs Drift CheckThis PR changes 1 package(s): 33 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 3 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 168 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 af80c4bf9f7022eb5f3b949ba208e2c31a93044d && git checkout af80c4bf9f7022eb5f3b949ba208e2c31a93044d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5e1b9b0a7748b81083c873c8a05c7505bb6000c4 f8e75710a5a8abd827e32a4da390af79f12be121 && git checkout -B drift-repro 5e1b9b0a7748b81083c873c8a05c7505bb6000c4 && git merge --no-ff f8e75710a5a8abd827e32a4da390af79f12be121
node scripts/docs-audit/affected-docs.mjs --json 5e1b9b0a7748b81083c873c8a05c7505bb6000c4
|
|
domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y 席位核对 · ACCEPT · 2026-11-02T04:25ZHead-sha:
Generated by Claude Code |
Requested by Steedos · project thread
Fixes #28868
Clause-②: no
Metadata-protocol: none
维护者速读
highlightFields(去掉标题字段,最多 6 个)。没声明就不画:默认记录页、手机记录头、记录悬停卡三处都一样,字段全部留在正文。路径条(record:path)画了阶段字段时,正文不再重复画这个字段。要点条里有owner_id时,正文下方的元信息行不再重复写负责人。系统字段owner_id的中文平台标签从「所有者」改为「负责人」,和 ui 的detail.owner统一。highlightFields的对象(含examples/app-crm)会失去要点条,直到 examples/app-crm: metadata hygiene on the accepted preview surface — zh-CN translations, pluralLabels without 「列表」, declared highlightFields, contact nameField full_name, assigned_to as a user lookup, seed and dashboard copy #28870 给 app-crm 补声明;HotCRM 已声明。没有新的元数据键,没有新门禁。回滚即还原本 PR。ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts(deriveHighlightFields、headerDrawnFields、drawnPathField)、ui/packages/plugin-detail/src/RecordMetaFooter.tsx(负责人只出现一次)、synth/__tests__/highlights-declaredOnly-28868.test.ts。pnpm --dir ui exec vitest run packages/plugin-detail/src/synth/__tests__/highlights-declaredOnly-28868.test.ts packages/plugin-detail/src/__tests__/RecordMetaFooter.ownerOnce-28868.test.tsx,预期 2 个文件、19 个测试全绿。What changes
No guessed strip.
deriveHighlightFields(@object-ui/plugin-detail) returns the object's declaredhighlightFieldsminus the title field (the oneresolveTitleFieldnames), at mostmax, or[]. The preferred-name walk (owner/owner_idfirst, then amount, rating, industry, …), the type filter, the system-field skip list, the gated-group skip and the retired-type gate on that walk are deleted, not kept behind a flag. The export and its signature stay.statusFieldis accepted and no longer read; the docblock says so.The three readers follow it.
buildDefaultHighlights, and the body'shideFields) asks it as before. An undeclared object now gets norecord:highlightsnode and an empty hide list.recordPhoneHeader.ts) usesdeclared ?? []: no strip and no subtitle when nothing is declared, as on any width.RecordPreviewCard.tsx) asksderiveHighlightFields(def, null), so an undeclared object shows the title alone. With no key field it now sends no$expand.buildExpandFieldsreads an empty column list as "every reference field", which the card would never draw. The new card test caught this.The stage once.
buildDefaultPageSchemareads the strip it actually placed: the default one, or an authoredhighlightsslot. When that strip holds arecord:path, itsstatusFieldjoins the Details body'shideFields.buildDefaultTabson its own hides what the default strip for the same options draws. Two private helpers do this,drawnPathFieldandheaderDrawnFields. No public type moves: the exportedbuildDefaultTabskeeps its options type, and the page builder calls a privatesynthTabswith the computed list.The body's hide list is cut at six too (a bounded in-place fix, same defect class). The strip has always drawn at most six, but
buildDefaultTabshid the whole listRecordDetailViewpasses in. So a declared seventh or eighth entry was drawn by neither the strip nor the body.headerDrawnFieldscuts atRECORD_HIGHLIGHTS_MAX. The fix is pinned, and its ablation goes red.The owner once.
RecordMetaFooterleaves the owner out of the meta line whenderiveHighlightFields(objectSchema, null)holdsowner_id. Otherwise it keeps it.One word for the owner. The ui key
detail.ownerand the spec's system-field label ofowner_id(SYSTEM_FIELD_LABELSinpackages/spec/src/system/i18n-resolver.ts) now say the same word in every language both declare:detail.owner(ui pack)owner_id(spec)The seat chose 「负责人」 for zh: the person who follows the record up. Every other language keeps the word its ui pack already uses. None of them is wrong for a record's owner. "Inhaber" is the common German CRM term (Datensatzinhaber). No ui pack value changes. A label an author wrote is still never overridden.
Tests
synth/__tests__/highlights-declaredOnly-28868.test.ts, 11 cases, rules 1–3.stagefrom the body. Controls:stageField: false, and a status field with no stages. An authored highlights slot with a path hides the stage, and one without a path does not.buildDefaultTabson its own follows the same rule.__tests__/RecordMetaFooter.ownerOnce-28868.test.tsx, 8 cases, rules 3 (owner) and 4 (one word). A declared strip namingowner_iddrops the owner from the meta line. With noowner_idin the strip, or no strip at all, the owner stays. For en / zh-CN / ja-JP / es-ES,translateObject'sowner_idlabel equals the matching ui pack'sdetail.owner. 负责人 and Owner are pinned by name.RecordPreviewCard.test.tsxgains "an object that declares no highlightFields shows the title alone". It asserts no guessed field and a barefindOnewith no$expand. InrecordPagePush-27058.test.tsx, the "no declared highlights" case now asserts{ subtitle: '', highlightFields: [] }instead of "derived, at most four".__tests__/buildDefaultPageSchema.retiredFieldType.test.tsis deleted. It pinned the retired-type gate on the two selection passes, and both passes are gone. A retired type is still refused loudly by the form, inline edit and the body (InlineFieldInput.retiredFieldType.test.tsxand the field widgets).deriveHighlightFields.groupGate-12720.test.tsis rewritten. An undeclared object has no strip at all, a declared gated entry is left as written, and the page body hides nothing and draws the gated group.buildDefaultPageSchema.test.ts: the four heuristic cases become one "nothing is guessed" case, and the title-skip case now uses a declared list. The retiredcompactLayoutcase now expects[]. Three page and sub-builder cases use adeclaredLeadDef, and the unusedgetRecordDisplayNameimport is dropped.buildDefaultPageSchema.strictPayload.test.tsandrecord-highlights.groupGate-12720.test.tsx, the fixtures declare the strip they render.resolveTitleField.sharedLadder-7287.test.ts, three strip cases declare their fields, so the title skip still decides.i18n-resolver.test.ts(the custom-label case now uses 客户经理, so it still proves an author's label wins), restmeta-object-injected-column-i18n.test.ts, and the app-shellDraftChangesPanel.generatedGroup-25890.test.tsxfixture that mirrors the read.Acceptance notes
examples/app-crmdeclares nohighlightFields. examples/app-crm: metadata hygiene on the accepted preview surface — zh-CN translations, pluralLabels without 「列表」, declared highlightFields, contact nameField full_name, assigned_to as a user lookup, seed and dashboard copy #28870 declares them (same seat, in parallel); app-crm is not edited here.owner_idfifth or sixth, behind four non-text highlights, names the owner in neither place on a phone. Closing that needsRecordDetailViewto hand the footer the strip it drew. That file is outside this card's surface, anddomain:ui#1holds it for console phone record page: two bars stacked (app bar + record top bar) and the app bar repeats the record name — where do the app menu, search, notifications and account go? #28483. carrier: seat.highlightsslot still leaves the body hiding the declared list, as before. Only the stage half now follows the slot.packages/*/CHANGELOG.md) still describes the old heuristic in released entries. It is not edited.Verification
All readings are on this branch. The final head is
f8e75710, a merge ofmain(11 commits, none touching this diff's files except an unrelatedcancelTexthunk ini18n-resolver.ts), unless a block names another head.plugin-detail · 362 of 362 files
Run at
d57d0f80+ fixture commits (208ff9bd,68776a00) underos-verify-lock,--maxWorkers=2, in four batches:src/synth+src/renderers: 126 files. First run 3 files / 7 tests red, all fixtures that relied on the guess to draw a strip:strictPayloadcoverage, threebuildDefaultPageSchema.test.tspage cases, and the threerecord-highlights.groupGate-12720legs. After the fixtures declare their strip: 17/17 re-run, 204 tests.src/__tests__first half: 113 passed, 835 tests.src/__tests__second half: 112 passed, 1 skipped, 982 tests.app-shell and console · every test naming the record page, the strip, the hover card, the phone header or the footer · 265 files
git grep -loverpackages/app-shell/src/**/*.test.ts*andapps/console/src/**/*.test.ts*for the touched modules,record:highlights,highlightFields,RecordMetaFooterand 所有者 gave 265 files. Two batches at--maxWorkers=3: 138/138 files (1380 tests), then 127 files with 1 red. The red was the new hover-card pin: an undeclared object sent$expand: ['account']. Fixed ind4833e5a, andrecord-preview/re-ran 3/3 files, 43 tests. This is a declared narrowing; CI's Test UI runs the rest of app-shell.At the merged head: plugin-detail
synth/, the new footer test,recordPageV3Face-27055,record-highlights.groupGate-12720and the 20 app-shell files namingphoneRecordHeader/RecordPreviewCard/RecordMetaFooter/highlightFields/ the phone record page: 39/39 files, 421 tests.spec and rest label pins
pnpm --filter @objectstack/spec exec vitest run src/system/i18n-resolver.test.ts src/system/i18n-resolver.object-validations.test.ts: 2/2 files, 386 tests.pnpm --filter @objectstack/rest exec vitest run src/meta-object-injected-column-i18n.test.ts: 1/1, 4 tests.pnpm --filter @objectstack/spec check:generatedat the merged head: exit 0, every generated artifact up to date (a label value moves none).Ablations · 7 legs, all red as predicted
Each leg went through
scripts/ablation-replace.mjsagainst the committed fix. Each restore read blob == HEAD withgit diff HEADempty.highlights-declaredOnly-28868red.buildDefaultTabs).owner_id).i18n-resolver.test.ts.The ui cross-package pin (
detail.ownerequals the spec label) reads@objectstack/spec's dist, so leg 7 was run on the spec's own suite, which reads source.Type check
pnpm --filter @object-ui/plugin-detail run type-check && pnpm --filter @object-ui/app-shell run type-check(eachtsc --noEmitplustsc -p tsconfig.test.json): exit 0, both before and after the merge. Each run followedturbo run build --filter='@object-ui/app-shell^...'(64 tasks).Derived gates · 83 commands
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 83 commands atd4833e5a:check-plugin-teardown-shape.mjs --self-testexited 3 because a shallow clone could not read its pinned fixture. Aftergit fetch --depth=1 origin 621a4876…it exited 0 (48 cases).pnpm check:dual-build-cjs-loadsexited 3, "Runpnpm buildfirst … nothing was measured", because 30 packages outside this diff's closure have nodist. NOT MEASURED locally; CI's Lint & Repo Gates runs it.pnpm --dir ui exec vitest run scripts/ran after a spec rebuild: 169 files passed, 2 skipped; 4900 tests.Re-run at the merged head, each exit 0:
check-sdui-manifest.mjs,check:nul-bytes,check:cross-package-test-inputs,check:test-source-alias,check-empty-changeset.mjs --base origin/main,check:issue-citationsandcheck:doc-authoring.pnpm --dir ui run check:new-line-citationsfound 0 new citations.PR-body gates
Run with this body as
GITHUB_EVENT_PATH(orPR_BODY), before the create, each exit 0:check-changeset-no-major.mjs --base origin/main, which readsMetadata-protocol: noneand apatchchangeset;check-adr-0087-registration.mjs --base origin/main, which found 1 non-breaking changeset;check-closing-keyword-parity.mjs;check-partof-closing-keyword.mjs.Diff: 19 files, about 1,000 changed lines, under the 3,000-line line.
Generated by Claude Code