Skip to content

记录页字段页签:对象新键 fieldTabs,把指定字段分组放成概览之后的页签 #37802

Backlog

Description

@objectstack-fleet

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

Filing gate: ① maintainer-asked. Jack in the seat thread, 2026-11-27: 「现在记录详情页可以配置不按左右栏显示吗?」 (03:34Z); 「我觉得这个应该是一个元数据的配置项吧,这种应该是常见需求。」 (03:36Z); 「我能够具体配置每一个页签显示哪些分组吗?然后还有一个开关控制第一个页面要不要pin到左侧」 (03:40Z); 「是否建议保留 relatedList 这个语法」 (03:51Z, no rename); 「同意,立卡 p1」 (03:52Z); 「刚才的任务以及你现在的建议用 fable 评审」 (03:55Z); decision card 04:07Z: 「例外 + 新键 fieldTabs」 (ADR-0085 ruled exception; field tabs as a sibling object key, relatedLists untouched; three cards S, S–M, M).
Fable review (code-verified at objectstack 3ed97b7): /mnt/project-files/record-page/fable-review.md. Trigger app: brightrule policy record (long 正文 in a 276 px value cell).
Grading: domain:ui · Task · p1 · size M · reach: objects that declare it (absent = unchanged).
Dedupe: searched fieldTabs, field group tab, group as tab: none.
Blocked-by: #37800 (ADR-0085 Note, AGENTS.md rule 13). Pairs with #37792 (pinOverview); long-text card #37801 is independent; either may land first.

维护者速读

  • 是什么:对象上新增 fieldTabs: [{ key, groups: [...] }]。点名的字段分组从概览移出,按声明顺序成为紧跟概览的页签(宽屏钉栏时就是右侧第一个页签),相关列表页签排在它们后面。relatedLists 一个字不动。
  • 例子:fieldTabs: [{ key: 'content', groups: ['content', 'import'] }] → 右侧第一个页签「正文」,里面是正文和原件两组。
  • 影响:不写的对象完全不变;编辑表单不变。
  • 要你做什么:无。

Background (verified, Fable review "设计问题 二")

  • Putting field tabs inside relatedLists was rejected for this card: a field-tab-only list would flip the object to "declared" and hide its related lists (deriveRelatedLists.ts:416, buildDefaultPageSchema.ts:1153), two save paths drop entries without a list (recordTabsConfigModel.ts:321, registry-custom-arrangement.ts:301-304), and the laid-out tab row does not follow declared order (RecordPageColumns.tsx:589-593). A sibling key avoids all three.
  • record:details already accepts sections: [{ group: KEY }] (buildDefaultPageSchema.ts:769-779): synthesize field tabs with it; no new renderer.
  • The empty-fields count and its "show N empty fields" row exist once, at the overview's foot (RecordPageColumns.tsx:501, :711-723; recordFieldList.ts:46).
  • Group visibleWhen is evaluated inside the record:details renderer (record-details.tsx:222), after the tab row is drawn; a tab item carrying visibleWhen takes the page out of the column layout (recordPageColumns.ts:316).
  • The open tab lives in ?related=; taken words include timeline, attachments, approvals, overview, details (recordTabBadges.ts:17-18, RecordTabRow.tsx:24, recordPageColumns.ts:231-240).

What to do (v1 decisions are fixed here; do not widen them)

  1. spec ObjectSchema.fieldTabs: z.array(strictObject({ key: snake_case, groups: z.array(string).min(1) })).optional(). No label/icon in v1: the tab's title and icon are its first group's (label already translated). Refuse at parse/validate: unknown group key; a group in two tabs; a group that has relatedList (body-table groups stay in the overview in v1); duplicate key. Not accepted on ObjectExtensionSchema and not in CUSTOM_ARRANGEMENT_KEYS (field-customization.ts:128) in v1. Describe it for generated docs/forms; say it affects only the standard record page (not the entry form, print pages, kind: 'full'|'html'|'react' pages).
  2. Overview always exists: the groups no field tab names, plus ungrouped fields, the approval band and the meta footer. @objectstack/lint warns when every group is moved out.
  3. Placement: field tabs come right after the overview, in declared order, before every related-list and built-in tab. The reader cannot reorder or hide them. They count as "other tabs" for pinning. With pinning on, the first field tab is the default open right tab.
  4. Tab id: fields:<key> in ?related=, registered in recordPageColumnOfTab so the page keeps its column layout.
  5. Visibility: lift group visibleWhen / requiresFeature evaluation to where the tab row is built; a tab whose groups are all hidden is not drawn. A group missing at runtime (e.g. a .custom package replaced fieldGroups) is skipped; a tab left with none is not drawn.
  6. Empty fields: each field tab has its own empty-field count and "show empty fields" row.
  7. Deep links: ?section= that targets a field inside a field tab opens that tab first, then scrolls (recordSectionAnchor.ts).
  8. Single-group tab: do not repeat the group's own heading under the tab title.
  9. Liveness ledger entry enforced in this PR (ADR-0049); generated artifacts; changeset (@objectstack/spec minor, Metadata-protocol: added; ui as usual). Leave the ADR-0085 Note id in the code.

Acceptance

  • spec: each refusal; valid two-tab declaration; extension refuses the key.
  • ui unit: a field tab with two groups draws them in order and removes them from the overview; related lists and attachments are unaffected; tab order overview → field tabs → others; reader arrangement cannot move a field tab; all-hidden tab not drawn; missing group skipped; per-tab empty-fields row; ?section= into a field tab opens it; single-group tab has no duplicate heading; entry form still shows every group.
  • Inline edit: switching tabs mid-edit has an asserted outcome; a server error on a field in an unopened tab is still surfaced.
  • Browser (dogfood-verification skill): brightrule-like object with fieldTabs: [{ key: 'content', groups: ['content'] }], desktop full page and side preview, screenshots.

Activity

  1. added
    enhancement
    priority:p1
    domain:ui
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

    State 2026-11-27T04:12Z: filed per Jack 04:07Z decision card; waits for the ADR-0085 Note.
    Blocked-by: #37800

  3. added
    pm:blocked
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · Feature · priority:p1 · pm:blocked · size M; rationale: record page field tabs, a new object key fieldTabs that places named field groups as tabs after the overview. Maintainer-asked, p1 as filed. Blocked by #37800; area:ux added.

  5. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Carrier note 2026-11-27T15:37Z, from #37800 (draft PR #38010, the ADR-0085 Note that records pinOverview and the object-level fieldTabs as ruled exceptions). When this card lands the object-level fieldTabs key, it has the same name as the form-level FormSchema.fieldTabs (ui/packages/types/src/form.ts) but a different shape. Each refusal message should point to the other key, so an author who puts one shape in the other place learns which key they meant.

  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Carrier note 2026-11-27T15:51Z, from #37800 (PR #38010, contract record 7222395316, nit N3). The ADR-0085 Note dated 2026-11-27 says that neither pinOverview nor the object-level fieldTabs is in the spec yet. When this card lands its key, add a Built by #<this card> line to the end of that Note, as the actionLayout Note ends with "Built by #36629", so the sentence does not go stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxdomain:uienhancementpm:blockedpriority:p1

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions