Skip to content

主从子表默认放进记录页概览左侧(关键字段下面),始终显示、带合计;判断规则改为按关系类型 #35597

Closed
3 of 3 issues completed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #35590(专题:记录详情页重做,维护者直派)。⛔ 不是认领。优先级 p2(维护者 2026-11-19:「这一批卡p2」)。

维护者 2026-11-19 原话:「就是master-detail表类型的子表」「主从 的子表是否应该始终显示?主从的子表是否应该默认出现在概览的左侧区域?关键字段下面。」「包括有多个主子表的时候怎么处理」;看到 Twenty 的主记录区域和页签里都能放关联表格后:「一个客户下面有七八张子表都有记录,感觉都显示页没问题。」

目标(图 37)

图 37 记录页:概览、相关表页签、抽屉

图是深色稿,只表达结构和尺寸,颜色沿用现有主题变量。参照对象 Twenty 是 AGPL,只参照结构,⛔ 不抄代码。代码读数取自 origin/main 7ece0204a6。外壳(顶栏、左侧栏)不动。

现状

  • 关系类型有 lookup、master_detail、tree、user(packages/spec/src/data/field.zod.ts:80-91)。
  • 哪些相关列表进记录正文由 isBodyTableRelationship 决定(packages/spec/src/data/related-list-body-table.ts:54-60):relatedList: 'primary',或「master_detail 并且声明了 inlineEdit」。光是主从不算,仍是右栏卡片。
  • 正文表格才有合计(只对父对象用 summary 汇总的列,ui/packages/plugin-detail/src/RelatedList.tsx:697-810),空了也不折叠。
  • 手写页面不享受正文表格待遇(RecordDetailView.tsx:5071,bodyTableIds 为空)。
  • HotCRM:opportunity_line_item.crm_opportunity、quote_line_item.crm_quote 是主从,但都没有声明 inlineEdit,所以现在不是正文表格。

要做的

  1. 规则:master_detail 的子表默认是正文表格,不再要求同时声明 inlineEdit。relatedList: false 可以关掉,relatedList: true 可以降回普通相关列表,relatedList: 'primary' 的现有含义不变。
  2. 位置:概览左侧,通栏的阶段条和关键字段之下、字段分组之上。多张主从子表按对象 relatedLists 的顺序依次排。
  3. 始终显示:一行都没有时也显示表头和一行空状态(「还没有…」加添加入口)。
  4. 行数:行不多时全部显示;超过一个上限(协调席建议 10,页面定义可改)时先显示前面的,「显示全部 N 条」原地展开;标题旁的「↗」去子对象的列表页并带上「属于这条记录」的条件。
  5. 合计:有数值列时显示合计行,与列对齐。没有父对象汇总字段时由服务端对该子表按条件汇总,不只算已显示的行。
  6. 只出现在概览这一处:不进右栏,也不占页签(维护者:「如果主子表已经在 概览中,还需要出现在右侧和顶部tab中吗」)。
  7. 手写页面同样生效:手写页面里放的主从相关列表也得到正文表格的待遇(合计、空也显示)。
  8. 抽屉里同样排在关键字段下面。

不做的

  • 编辑和保存(子卡「记录页编辑」)。
  • 普通关联(lookup)子表不进概览左侧,仍在页签和右栏。
  • 不改级联删除、共享继承等主从的数据语义。

验收

  • 一个对象新加一张主从子表、不写任何界面声明:它的记录页概览里,关键字段下面出现这张表;没有行时显示空状态和添加入口。
  • 写 relatedList: false 后不出现;写 relatedList: true 后只在页签和右栏。
  • HotCRM 报价单(主从子表:报价行):概览里有报价行表格和合计,合计等于服务端对全部行的汇总;行超过上限时先显示一部分,「显示全部」原地展开;页签行里没有「报价行」这个页签,右栏里也没有它。
  • 一个有两张主从子表的对象:两张依次排在关键字段下面,各有合计。
  • 既有的 inlineEdit、relatedList: 'primary' 声明行为不变(RelatedList.bodyTable-27055 等测试按新规则更新)。
  • 一次合入、一次验收。PR 正文列出迁移和作废的测试,以及同笔修改的 docs/qa/platform-checklist 条款。

Reader: domain:ui 车道,规则改动与 domain:spec 对齐。packages/spec/src/data/related-list-body-table.ts、ui/packages/plugin-detail/src/RelatedList.tsx、synth/buildDefaultPageSchema.ts、ui/packages/app-shell/src/views/RecordDetailView.tsx。

Dedupe: 主从 子表 概览、master_detail body table record page(objectstack,open)→ 0。

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Feature (master-detail child tables sit in the Overview under key fields, always shown, with totals) · a child of the maintainer's record-page topic #35590 (his words for this batch: 「这一批卡p2」) → p2 as he set it.

  3. added
    pm:queue
    on Nov 19, 2026
  4. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Claim: PM loop round 18 · area ux-2 (maintainer direct dispatch: epic #35590, Bill 2026-11-19 「继续处理 35590 的记录详情页子卡」, which overrides the p1-only rule for this epic's cards; seat split file names #35597 first in the ux-2 lane) · 2026-11-19T21:53Z
    Area: ux-2
    Session: session_01Utp6CZrgaiMgTJCnswR6jQ
    Account: os-bill
    Branch: claude/issue-35597-md-body-tables
    Worktree: objectstack-issue-35597
    Domain: domain:ui (rule aligned with domain:spec)
    Seat: repo:objectstack#5
    File surface: packages/spec/src/data/related-list-body-table.ts (+ its test, the generated spec baselines it moves), ui/packages/app-shell/src/utils/deriveRelatedLists.ts, ui/packages/plugin-detail/src/RelatedList.tsx (the body-table region, ~697-810: totals, empty state, row cap, "show all"), ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts (the body-table placement section only; section posted on this card before the edit), ui/packages/app-shell/src/views/RecordDetailView.tsx (~5071, the authored-page bodyTableIds region only), their tests, docs/qa/platform-checklist items it changes, docs/adr/0035-config-driven-master-detail.md (an amendment note only, in its own commit), root .changeset/. ⛔ Not the record header (~5522) or tab (~5610) regions of RecordDetailView.tsx, containers.tsx, RecordPageColumns.tsx, recordPageColumns.ts, record-reference-rail.tsx, DetailView.tsx (another area's cards on this epic); no list-page epic files; no edit/save path (#35599); no related-tab toolbar or batch add (#35601). Stop on breach and report.
    Container & model: L, mode:subagent, model: default — no path-derived mandate, effort: xhigh (contract face)
    Clause-②: yes (the body-table predicate's verdict widens: a master_detail FK with no relatedList becomes a body table without inlineEdit) — seat contract L2 owed
    Metadata-protocol: widened (measure; report if it differs)
    Responsibility: spec isBodyTableRelationship and ui plugin-detail / app-shell in objectstack decide and draw record-page body tables; no platform path covers it; every record page whose object owns master_detail children
    Thread-read: none
    Premise: holds as filed on origin/main d96c878e (predicate at related-list-body-table.ts:54-60 still requires inlineEdit; RecordDetailView.tsx authored-page body tables empty)
    Serial constraints cleared: open PR #35629 (os-sales) touches buildDefaultPageSchema.ts +6/-1; whichever lands second merges main; no other open PR touches the surface (live read of all open PRs' files at claim time). #35595 (ux-4) shares buildDefaultPageSchema.ts: section posted on this card before the edit, seat orders on a collision.
    Pre-claim lane: domain:ui + spec rule (packages/spec/src/data/)
    Pre-claim deps: none open
    Prior rulings read (check-prior-rulings --card 35597 --paths related-list-body-table.ts,RelatedList.tsx,RecordDetailView.tsx): ruling B on #27055 (#27478, the ONE body-table predicate, master_detail + inlineEdit) and ADR-0035 Amendment (#27069) clause (1) are the rule this card changes, on the maintainer's own words in the card and the epic's direct dispatch, so the PR amends the ADR note rather than leaving it stale; ADR-0035 §3 "only inlineEdit children are inlined" stays true for the WRITE side (create/edit form), untouched here; the predicate stays the one judgement with no second copy (module header); relatedList: false / true / 'primary' keep their meanings as the card states; ADR-0035 server-owned rollup binds the totals (server aggregate, never a client sum of shown rows); RelatedList.tsx ~:340 seam ruling (objectui#5935, option C) untouched

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Section notice (area ux-2, before the first edit of ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts), 2026-11-19T21:59Z:

    This card's PR (branch claude/issue-35597-md-body-tables) changes only the body-table section of that file:

    • bodyTablePlacement (the function that places body tables among the details sections): a body table no field group positions moves from after the first field section to before the field sections (under the header strip, above the field groups); several stay in the order the host passes (the parent's relatedLists). Group-positioned tables keep their group position.
    • The isBody split inside synthTabs (isBody / bodies / sides, the BODY_TABLE_PAGE_SIZE default) and the isBody / isPrimary option docs on BuildPageOptions.related: comment wording for the new rule (a master_detail FK with no relatedList is a body table), no behaviour change beyond the predicate.

    No other function or section of the file is touched (tab strip composition, highlights, header, timeline, approvals, attachments stay as they are).

  7. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
    os-dev-report

    {
     "issue": 35597,
     "status": "done",
     "branch": "claude/issue-35597-md-body-tables",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35691",
     "head": "f6595c599562c77dc3210d6c737150273603e443",
     "session": "session_01Utp6CZrgaiMgTJCnswR6jQ",
     "premise_still_valid": true,
     "summary": "isBodyTableRelationship now reads a master_detail FK with no relatedList as a body table without inlineEdit (false hides, true side, 'primary' unchanged, lookup stays side); every reader follows it, and the field-group refusal widens to accept plain md groups. The synthesized page places unpositioned body tables above the field sections (parent relatedLists order), never as tab or rail card, same in the drawer; authored pages get the body treatment via a new authoredBodyTableIds. The body-table face takes server-owned totals (parent summary field when it sums the same rows, else dataSource.aggregate over the parent scope on the existing data query path, no new endpoint), a 10-row cap with in-place 'Show all N', a ↗ to the filtered child list, and an always-drawn empty table (headers + one empty row with New). ADR-0035 amendment in its own commit d4364f43; checklist item records-forms.master-detail-body-tables added; changeset minor for spec, plugin-detail, app-shell.",
     "readings": {
      "A1": "Flip to body tables: showcase_task.project→showcase_project, showcase_field_zoo.f_master_detail→showcase_project, showcase_project_membership.team→showcase_team, showcase_project_membership.project→showcase_project. None is a comment/attachment/activity association. CRM crm_opportunity_line_item.opportunity, showcase expense line and invoice line already declare inlineEdit (body tables before and after). No platform-objects master_detail. HotCRM is not in this repo (not measured).",
      "A2": "Today (origin/main): BodyTableTotals summed the rows on show client-side ('Totals (this page)'). Server path used now: dataSource.aggregate(child, {aggregations:[sum], where: parent scope [AND list filter], groupBy?}) → ObjectStackAdapter spec-shape branch → POST /api/v1/data/:object/query aggregations → engine.aggregate; parent summary field read when it rolls up the same rows. No new endpoint.",
      "A3": "Pinned: rule cells (spec related-list-body-table.test.ts, deriveRelatedLists*.test.ts, harness 'the relation type decides' x3); placement order (buildDefaultPageSchema.bodyTables-27055); empty state, cap + show-all, ↗, total over ALL rows at cap 1 of 3, no-aggregate means no total (RelatedList.bodyTable-27055); authored-page body treatment (authoredBodyTableIds describe); no tab/no rail (harness cases). Migrated/retired list in the PR body.",
      "A4": "NOT MEASURED, reason: console build + showcase/CRM stack boot not run on the memory-tight shared box beside the test runs; the live legs are carried by checklist item records-forms.master-detail-body-tables."
     },
     "section_comment_id": 7023388416,
     "adr_commit": "d4364f43",
     "tests": "At f6595c59: ui record-page set re-run: Test Files 88 passed, Tests 762 passed (VERDICT command-exit 0). Earlier broad run (plugin-detail whole package + app-shell RecordDetailView*, deriveRelatedLists*, inspectors, PagePreview, AppContent 29552): 13 failures, all side-list fixtures, migrated with relatedList: true; those 3 files then 22/22. spec whole vitest: Test Files 952 passed, Tests 29054 passed | 1 todo. lint whole vitest: Test Files 221 passed, Tests 9311 passed. No ablation: rule change pinned by verdict cells that flip with the predicate.",
     "gates": "plugin-detail type-check+build exit 0; app-shell type-check exit 0; spec typecheck exit 0. dispatch-gates --commands at 2450e9d0: 122 families, --ran with exit codes: 120 run exit 0, 2 NOT MEASURED (exit 3 PREREQUISITE NOT MET: check-plugin-teardown-shape --self-test needs an unshallow clone; check:dual-build-cjs-loads needs every package dist). check:skill-examples first exit 3 (client-react dist), re-run after building it exit 0. check:test-source-alias first exit 1 on the edited ObjectFieldInspector test (collection-time imports), fixed in f6595c59, re-run exit 0. check-platform-checklist --changed-from origin/main exit 0 (31 anchors, 0 lost). PR check-runs: in_progress at report time.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "line_budget": "1265 changed lines excluding generated references (+1010/-255), generated content/docs/references +7/-7; under the ~2000 split line",
     "files_changed": 28,
     "deviations": [
      "Metadata-protocol declared semantic, not the order's 'widened' (vocabulary is added|narrowed|semantic|none; a changed default reading)",
      "No new i18n keys (fence): existing list.showAll, detail.viewAll, detail.noRelatedRecords, form.masterDetail.total reused",
      "Edited tests of fenced or out-of-surface sources because the rule change moved their fixtures: RecordPageColumns.test.tsx (fixture only, RecordPageColumns.tsx untouched), RecordDetailView.childWriteRefreshesParent-12244 / recordPageTiers-26678 / relatedListFilter-4664 tests (relatedList: true on side-list fixtures)",
      "RelatedList.tsx edits extend past the claim's ~697-810 line range into the body-table branches of the render (row cap, empty row, ↗, summaryRow); all body-table-only",
      "Stale comments outside the surface left as acceptance notes (ObjectFieldInspector ~2977/3006, ObjectGroupInspector, RecordDetailView ~4285, field.json/object.json liveness notes, lint data-model-rules)",
      "One extra write: the step-0 section comment 7023388416 on #35597 (ordered by the dispatch)"
     ],
     "mcp_calls": "0",
     "api_writes": "3 relay writes: POST issue comment 7023388416 on #35597 (post-stamped, section), pr_create #35691 (POST pulls + POST issues/35691/assignees), this os-dev-report comment (post-stamped); plus git push (not REST)",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — published skills text (skills/objectstack-data/rules/relationships.md, skills/objectstack-ui/evals/record-page.json) still describes the inlineEdit rule; declared on the Skills-docs line as follow-up owed"
     ]
    }
  8. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Claim amendment · area ux-2 · 2026-11-20T00:15Z · amends claim 7023261217 (answers L1-a R1, 7026045793)

    File surface, added (all already in PR #35691 at b4ba2a6d; nothing new is edited by this amendment):

    • Spec sources, published describes: packages/spec/src/data/field.zod.ts (the relatedList jsdoc and .describe) and packages/spec/src/data/object.zod.ts (the field-group jsdoc and .describe).
    • Side-list fixtures in tests of fenced or other packages, moved because a plain master_detail FK is now a body table (each gains relatedList: true or the refusal case moves to relatedList: false; no source of those packages is edited):
      • ui/packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx (RecordPageColumns.tsx itself stays ⛔ and untouched);
      • packages/lint/src/validate-related-list-refs.test.ts;
      • packages/metadata-protocol/src/protocol.runtime-authoring-gate.test.ts;
      • packages/spec/src/stack-related-lists-order.test.ts;
      • ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.relatedList-27054.test.tsx;
      • RelatedList.parentCurrency-31912.test.tsx;
      • record-related-list.emptyFold-25895.test.tsx.
    • The generated reference pages under content/docs/references count as "the generated spec baselines it moves".

    Everything else in claim 7023261217 stands.

  9. added a commit that references this issue on Nov 20, 2026
  10. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

    Seat ACCEPT for #35597: PR #35691 is handed to the approvers (Tier H). Seat record on the PR at head af275005; contract L2 PASS plus delta PASS. Lands by ux-2 after an APPROVED review. Known, not a regression: #35710.

  11. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Closed-out · area ux-2 · 2026-11-20T02:18Z

    reading value
    PR #35691 MERGED as 9b6db730b2 by a governed approver (Fixes #35597; this card closed completed)
    contract record L2 PASS 7026219725 + delta PASS 7027524146; L1-a ACCEPT 7026045793; Tier H handoff 7027543971

    Delivered: a master_detail child with no relatedList is now a body table on its parent's record page by default (no inlineEdit needed): drawn in the overview above the field sections in the parent's relatedLists order, never as a tab or rail card, always drawn when empty, 10-row cap with in-place "Show all", ↗ to the filtered child list, server-owned totals. Authored pages get the same treatment. ADR-0035 carries a dated amendment superseding ruling B on #27055 and #27069 amendment (1). Browser reading (A4) is in the PR body.
    Follow-ups (children of this card, now unblocked): #35692 skills text, #35701 shipped migration notice + stale comments, #35710 currency-less total (folded into #35601's PR, same file).
    State: pm:dispatched removed; card closed.

  12. removed
    pm:dispatched
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions