Repository navigation
fix(studio): the key-fields editor no longer previews a record-page strip - #36020
Conversation
The default record page no longer draws a key-fields strip, so Studio's highlightFields editor stops previewing one: the ordered rows are the one rendering of the list. The file header and HIGHLIGHT_FIELDS_MAX comment say what highlightFields drives now, and the engine.studio.settings.highlightPreview key leaves the studio en/zh catalogues. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…hout a stage bar or key-field strip Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
The e2e rider moved to a separate card; this file returns to origin/main. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
|
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv Final green head · 2026-11-21T07:43Z · area b1-DB
|
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读
席位核对 — ACCEPT (L1-c) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T07:46Z · Area b1-DB's PR for #35978: the Studio key-fields editor drops its highlight-strip preview, which the default record page no longer draws (#35938, #35977), and its comments now name the key's current uses. |
… tabs by object name and per-entry title and columns (objectstack-ai#35923) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu8asiBATVNp4pogcic92dHU)_ repo:objectstack#1 · os-sales · session_01L6bhgTgsPwrw3VbvRRcqth Fixes objectstack-ai#35897 Fixes objectstack-ai#35899 Clause-②: yes (widening) Metadata-protocol: semantic Skills-docs: follow-up objectstack-ai#35902 (skills/objectstack-data/rules/relationships.md, skills/objectstack-ui/rules/record-page.md) ## 维护者速读 - 对象声明了 `relatedLists`,详情页的标签页就只显示列出的相关列表,按列出的顺序;没列的不再显示。没声明(或为空)时完全不变。 - 三个内置标签用对象名放置:`sys_attachment`(附件)、`sys_approval_request`(审批)、`sys_activity`(活动流);附件不列就不显示,审批和活动流不列时仍排在末尾。 - 每一项可写 `{ list, label, columns }` 给该列表自己的标题和列;列名不是子对象字段会被 `os validate`、`os build` 和元数据写入口拒绝。 - 字段分组放进概览的主从明细表(objectstack-ai#35889):没声明 `relatedLists` 时既在概览里、也保留页签;声明了但没列它,就只在概览里,不出页签(席位裁定 7048340194)。 - Studio 对象设置里可以排页签、加内置标签、给每一项改标题和列;保存时保留对象写法和内置名。对象没开文件时,附件不出现在可选项里,已列的附件会提示不会显示。 - 元数据管理里的通用对象表单也能正确显示和编辑这张页签表了(之前遇到带标题和列的一项会出错);条目的列可以写 `account.industry` 这种跨关系的写法,和外键上的写法一致。 - 其他包加进来的子表也一样:父对象声明了 `relatedLists` 却没列它,就不显示页签;让扩展包自己放置列表的做法在 objectstack-ai#35901。 - 风险:已经声明了部分 `relatedLists` 的应用,没列的标签会消失(仓库内无此类对象;已部署的元数据未测量)。 ## What changes An object's declared `relatedLists` becomes its record page's tab list (epic objectstack-ai#35896): ```ts relatedLists: [ { list: 'quote_line', label: 'Line items', columns: ['product', 'quantity', 'unit_price', 'amount'] }, 'task', 'sys_attachment', 'sys_approval_request', 'sys_activity', ], ``` - **spec** (`packages/spec/src/data/object.zod.ts`, new `related-list-entry.ts`): an entry is the bare name or `{ list, label?, columns? }` (strict, with aliases and guidance). The three built-in tabs are named by object: `sys_attachment`, `sys_approval_request`, `sys_activity`. A built-in is written only as its bare name; the object form naming one is refused at parse (a regex, so the published JSON schema keeps the refinement). `defineStack`'s name check skips built-ins. The shared helpers `RECORD_PAGE_BUILTIN_TABS`, `isRecordPageBuiltinTab`, `relatedListEntryName` and `RELATED_LIST_BUILTIN_PART_OF` are the one reading of an entry's name for every reader. - **lint** (`validate-related-list-refs`): new `related-list-column-unknown` (error: a column that is no field of the child, registry-injected columns included), `related-list-attachments-off` (warning: `sys_attachment` on an object without `enable.files`) and `related-list-stream-part` (warning: `sys_comment` / `sys_audit_log` are parts of the stream; prescribes `sys_activity`). The same rule runs at `os validate`, `os build` and the metadata write door. - **record page** (objectui): - `deriveRelatedLists`: on a declared non-empty `relatedLists`, an unlisted side list shows no tab. Body tables a field group places are kept, and `relatedList: false` on the FK still hides a list. An entry's `label` / `columns` win over the FK's `relatedListTitle` / `relatedListColumns`. - `buildDefaultPageSchema` (`arrangeDeclaredTabs`): tabs follow the declared order. An unlisted attachments tab is dropped. Unlisted approvals follow the listed tabs. An unlisted stream closes the strip. The overview stays first. - `recordPageColumns`: the related column keeps that one order. - With objectstack-ai#35921 merged: a `master_detail` table that a field group places in the overview keeps its tab only while `relatedLists` is undeclared or lists it. A declared `relatedLists` that leaves it out shows it in the overview with no tab (seat ruling 7048340194 on objectstack-ai#35897). objectstack-ai#35921's ADR-0035 note and `semantic/18` acceptance text are qualified to say so. objectstack-ai#35921's changeset stays as main has it; this PR's own changeset narrows it in one sentence (0215faf). - **Studio** (`RelatedListsEditor`, `relatedListVocabulary.acceptTabListEntries`): the object settings panel edits `relatedLists` as the tab list. Object entries and built-in names survive every move, removal and add. The add picker offers the built-ins by name (attachments only when `enable.files` is on), then the unlisted relationships. A relationship row edits its own title and columns; clearing both writes the bare name again. A listed attachments tab on an object without files shows a notice. The preview draws the tabs in order, built-ins included. New strings in `@object-ui/i18n` (en, zh). - **FLS mask** (`object-schema-fls-references.ts`): `relatedLists` entries stay unmasked like `lookupColumns`: the columns are the child's fields, the label is author text, and the built-ins are object names. A pin test covers an entry whose column shares a denied field's name. - **migration**: ADR-0087 semantic entry `related-lists-declared-is-tab-list`. No D2 conversion, because which unlisted lists an author still wants is recorded nowhere. - **ADR notes**: - ADR-0085 gets a dated note: §2's hide/re-arrange guard yields for `relatedLists` only, per the maintainer's ruling. - ADR-0035 gets a dated amendment. - Both were drafted at the opus tier under the quota exemption. - Generated references, the API surface, liveness children (`list`, `label`, `columns`) and the strictness ledger counts are regenerated. **Tier H**: this PR touches `docs/adr/**`. ## Why The maintainer ruled that the record page's tabs are declared on the parent object in one place: removing an entry removes its tab, `relatedLists` is that list, and the three built-in tabs are named by their objects. Before this change, a declared `relatedLists` only ordered the lists: every unlisted list still followed, and the built-ins always closed the strip in a fixed order. ## Tests - spec: `stack-related-lists-order.test.ts` (object entries, built-ins, the parse refusal, `defineStack`); new `related-list-entry.test.ts`. - lint: `validate-related-list-refs.test.ts` (built-ins, both warnings, unknown and injected columns); `rule-explanations` covers the three new ids. - metadata-core: `object-schema-fls-references.test.ts` (objectstack-ai#35899 entry pin). - Studio: new `ObjectSettingsPanel.relatedListsTabList-35897.test.tsx` (5 tests); `ObjectSettingsPanel.relatedListsOrder-27054.test.tsx` expects the built-in add options. - ui: `buildDefaultPageSchema.test.ts`, new describe `declared relatedLists arranges the tabs (objectstack#35897)`; `deriveRelatedLists.relatedListsOrder-27069.test.ts`. Three tests that pinned the old "unlisted lists follow" meaning now pin the new one: two in the 27069 file, the 27241 case in `RecordDetailView.harness.test.tsx` (with a new all-listed control), and the page-order expectations in `ObjectSettingsPanel.relatedListsOrder-27054.test.tsx`. The 27069 file also pins the ruling: a group-placed `master_detail` table keeps its tab when `relatedLists` is undeclared or lists it, and loses only the tab when unlisted. ## Acceptance notes On the record page of each object that declares `relatedLists`, the tabs after the overview are the listed related lists and built-in tabs, in the listed order. Then come approvals, if unlisted and the record has requests, and the activity stream last. An object that declares no `relatedLists` shows the same tabs as before. In-repo census: no example, platform object, dogfood fixture or HotCRM object declares `relatedLists` today. ## Verification On `462477f8` (the fixes above): `@objectstack/lint` 222 files / 9,369 tests passed; `@objectstack/platform-objects` 125 files / 2,126 tests passed; `@objectstack/spec` `src/data`, `src/migrations`, `src/stack` 230 files / 7,961 tests passed; `check:generated --fix` regenerated `content/docs/references/**` and is clean; `check-i18n-bundles --write` clean; ui vitest on all of `app-shell/src/views/metadata-admin` and `ObjectSettingsPanel*`: 772 files, two failures in the first run, both resolved (the 9931 registry table, now carrying the new key, 40 passed; `AddWidgetPicker.oneRegistry-26745` passes alone, 7 passed, and the diff does not touch it). On the merged head 3434287 (main 6c7c6db merged into 473c7ff; conflicts listed below; 0215faf then touches only `.changeset/`): `@objectstack/spec` test 961 files / 29,439 tests passed and `check:generated` clean after `--fix` (it regenerated `content/docs/references/**` and the liveness counts); `@objectstack/lint` 222 files / 9,363 tests passed; `@objectstack/metadata-core` 1,048 tests passed; ui vitest (from `ui/`) on `app-shell` deriveRelatedLists, `RecordDetailView.harness`, `ObjectSettingsPanel*`, `plugin-detail` synth and all of `@object-ui/i18n`: 133 files / 2,389 tests passed. The whole app-shell + plugin-detail suites ran past the local time limit and are left to CI. Main merge conflicts and how they were resolved: `docs/adr/0035` keeps both notes (this PR's 2026-11-20 amendment, then main's 2026-11-21 second-slice form note); `semantic/18` acceptance text carries both qualifiers (the declared-`relatedLists` tab rule from this PR, the same-place/tabbed-form wording from objectstack-ai#36009); Studio `en`/`zh` keep this PR's tab-list wording and drop `highlightPreview` as objectstack-ai#36020 did; `content/docs/references/{api/metadata,data/object,system/migration}.mdx` and `liveness/state-counts/object.md` were regenerated, not hand-merged. On 473c7ff, before this merge: `@objectstack/spec` test 2355 files passed, `check:test-typecheck` and `check:generated` clean; `@objectstack/lint` 868 files passed; `@objectstack/metadata-core` 222 files passed; `@object-ui/plugin-detail` 105 files passed; `@object-ui/app-shell` 394 files passed; `@object-ui/i18n` 27 files passed. Earlier runs: - `pnpm --filter @objectstack/spec test` on the touched files; `check:generated`; `check:liveness`. - `pnpm --filter @objectstack/lint test` (validate-related-list-refs, runtime-gate, rule-explanations). - ui vitest (from `ui/`) on the touched plugin-detail / app-shell files: 7 files, 227 passed. A wide app-shell + plugin-detail run had no other failures. - Typecheck: spec, lint, plugin-detail and app-shell `type-check`. - `dispatch-gates.mjs --commands` derived list (128 commands) run locally: 126 green (two of them after building their inputs). Two are prerequisite refusals that measure nothing here, left to CI: `check-plugin-teardown-shape --self-test` (needs a full clone), `check:dual-build-cjs-loads` (needs a whole-repo build). An ADR-0122 alias finding was fixed in da074fd. ## Fable L2 fixes (record 7071342837, at `0215fafa`) - **M1** (`f5b256d4`): the object form's `relatedLists` row (`packages/spec/src/data/object.form.ts`) now names a new `related-list-entries` widget (`ui/packages/app-shell/src/views/metadata-admin/widgets.tsx`, labelling `control`). It renders a bare name and an object entry alike (the entry's title and columns beside its name), keeps every entry's stored form on add and remove, refuses a second entry for a name an object entry already places, and removes the key with the last entry. The help text states the tab-list meaning, hand-written in all ten translated locales (`platform-objects` metadata-forms bundles), and the zh label is 记录页页签 in both the bundle and `metadata-form-zh-cn.ts`. Pinned by `RelatedListEntriesWidget-35923.test.tsx` (the published row names the widget; an object entry renders; remove/add keep it); the three widget-registry tests (`widgetLabelling`, `controlWidgetGridNaming-9889`, `controlWidgetFailureArmNaming-9931`) carry the new key. - **S1** (`f5b256d4`): `validate-related-list-refs` walks a dotted entry column through `resolveFieldPath` from the child, as `validate-object-field-refs` walks `relatedListColumns`; an unjudgeable path stays unjudged. Test: `lead_id.name` passes, `lead_id.nope` and `nope_id.name` are `related-list-column-unknown`. The spec `describe` and the rule header say so. - **S2** (`f5b256d4`): the `relatedLists` `describe` and jsdoc, the ADR-0035 and ADR-0085 notes and the `related-lists-declared-is-tab-list` migration entry state that a child list another package adds is hidden too until the parent names it (accepted at build only when that package is in the parent's stack), and that an extension package placing its own list is objectstack-ai#35901. No lint hint added: the case has no stack-side signal to warn on. - `db548f41`: the four widget tests load `@objectstack/formula` and `@objectstack/lint` at module top (`check-test-source-alias`: `widgets.tsx` reaches both through dynamic imports). - Changeset (`462477f8`): adds `@objectstack/platform-objects` (patch, translations) and the three points above. - Nits, under the small-things rule: **N1** left (one shape published as a hand-written type beside the inferred one; deriving one from the other needs the import cycle broken, a follow-up). **N2** left for the approver as the accepted deviation the record names (names only, `lookupColumns` precedent). **N3** left (first entry naming a list wins; a lint advisory is a follow-up). **N4** left (no authorable parent has an inbound FK from `sys_comment`). ## Human Minimum Each item is one rule from [CONTRIBUTING.md › Human Minimum](https://github.com/objectstack-ai/objectstack/blob/main/CONTRIBUTING.md#human-minimum), which links the AGENTS.md text that states it. - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (The new `related-list-entry.ts` holds only the name constants and two pure name readers, like `related-list-body-table.ts`.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (ESLint on every changed file: 0 errors.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. (Two cards folded by the dispatch order, one `Fixes` line each.) - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (Except the maintainer's 维护者速读 block.) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. Tier H (`docs/adr/**`): the ADR-0085 and ADR-0035 notes need the approver's review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgTgsPwrw3VbvRRcqth <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgTgsPwrw3VbvRRcqth --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv
Fixes #35978
Clause-②: no — measured:
@object-ui/i18nbuilt before (base catalogue, key present) and after (key removed); all 73 emitted.d.tsfiles underdist/are byte-identical (diff -rexit 0). The studio catalogues are declaredRecord<string, string>, so no key is part of a typed literal or union on any published entry; the key lived only in the emittednamespaces/studio/en.js/zh.jsvalues.Metadata-protocol: none
Skills-docs: none — no skill text names the Studio key-fields editor's preview or the removed catalogue key; what
highlightFieldsdrives on the record page is the record-page rule follow-up #35942 already carries.维护者速读
What changes
HighlightFieldsEditor(app-shell, Studio object settings): the "Highlight strip preview" block (highlight-preview/highlight-preview-cell) is removed. The ordered row list stays — order still decides which fields each surface takes. The file header and theHIGHLIGHT_FIELDS_MAXcomment now say whathighlightFieldsdrives, quoting the spec describe fix(spec): record page descriptions no longer claim a key-field strip or stage path #35977 landed ("Ordered most-important fields; first entry wins where only one fits. Drives default list and related-list columns, cards, hover cards, previews and the record picker; the default record page draws no strip from it.").ObjectSettingsPanel.tsxheader comment: "an ordered list with a strip preview" becomes "an ordered list", and "title/stepper/columns" becomes "title/stage/columns" (the default page draws no stepper). Theengine.studio.settings.highlightFieldshelp text fix(spec): record page descriptions no longer claim a key-field strip or stage path #35977 rewrote still reads right and is untouched;RelatedListsEditor.tsxhas no strip wording and is untouched.engine.studio.settings.highlightPreviewleaves the studio namespace (en.ts,zh.ts— the namespace's only two catalogues). Repo-wide grep for the key and both test ids: no reader left outside historical CHANGELOG entries.@object-ui/app-shell,@object-ui/console(app-shell is private and ships inside the Console, as earlier app-shell changesets declare) and@object-ui/i18n.Tests
ObjectSettingsPanel.highlightOrder-27054.test.tsx: the order is pinned on the ROW order (highlight-row-*) instead of the preview; the first case asserts the editor is drawn and the preview absent (highlight-previewnull, zerohighlight-preview-cell); the move case reads the rows after the move; the remove case asserts no rows left.Acceptance notes
examples/app-showcase/e2e/detail-shapes.spec.tsrider moved to nightly-tiers: red on main #36007 by claim amendment; this PR leaves that file as onmain(a WIP edit was reverted in its own commit).en.ts/zh.ts(the related-list keys right after the removed line), so a textual conflict arises whichever lands second; resolution is mechanical — drop thehighlightPreviewline and keep feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923's lines. feat(spec, ui): an object takes a colour from a fixed palette, and the navigation draws it as a white glyph on a square of that colour #36012 shares the same files and merges cleanly.Verification
Local runs (head c3bf8d3)
pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ObjectSettingsPanel.highlightOrder-27054.test.tsx— Test Files 1 passed (1), Tests 6 passed (6).pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/— Test Files 352 passed (352), Tests 2739 passed (2739).pnpm --dir ui exec vitest run packages/i18n/— Test Files 105 passed (105), Tests 1957 passed, 13 skipped.pnpm --filter @object-ui/i18n --filter @object-ui/app-shell run type-check— both Done, lock VERDICT command-exit 0.git checkout ec243639 -- HighlightFieldsEditor.tsxrestored the preview (data-testid="highlight-preview"count 1 on disk); the file went red on exactly the new assertion — "shows the stored order in the rows, and draws no strip preview":expected <div …(2)>…(3)</div> to be null, Tests 1 failed, 5 passed. Restored withgit checkout HEAD --;git diff HEADempty and the blob hash equalsHEAD:(92b4e34c).Clause-②:line above.dispatch-gates --ran: 38 derived families accounted for — 37 run (exit 0), 1 NOT MEASURED:pnpm check:type-check-debtexit 3 (PREREQUISITE NOT MET, needs a full build) — CI's run is the verdict.node scripts/pm/overlap-check.mjs --branch=HEAD: origin/main merges cleanly; feat(spec, ui): an object takes a colour from a fixed palette, and the navigation draws it as a white glyph on a square of that colour #36012 merges cleanly; feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923 conflicts in studioen.ts/zh.ts(see Acceptance notes).Read first:
HighlightFieldsEditor.tsx(the removed block and header), then the test file.Two-minute check: run the single test file above; expect 6 passed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv