Skip to content

fix(plugin-detail): draw the approval band once on a record page split around a body table - #35478

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-35253-approval-lock-chip-once
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-35253-approval-lock-chip-once

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #35253

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户看到的变化:待审批被锁定的记录,详情页里如果有正文子表(例如明细行),「审批锁定」提示现在只显示一次(在子表上方),不再在子表上下各出现一次。
  • 为什么改:默认详情页会把字段区按子表切成两段,每段各画一遍审批提示,看起来像有两把锁,用户会误以为有两个审批在进行。
  • 改错的后果:最坏情况是拆分页面上的审批提示(含撤回按钮和进度)消失或仍然重复;不涉及数据与权限,单纯回退本 PR 即可恢复原状。
  • 需要你做的:无,席位落地。

What changes

The synthesized default record page splits its details around a body table (a relatedList: 'primary' list): one record:details part per run of sections. Each part mounts its own DetailView with its header suppressed, and each drew the record's approval band, so an approval-locked record showed "Locked for approval" twice: above the table and again above the next section.

Mechanism: a module-internal ApprovalBandContext (in defaultRecordPage.ts, default true, not in the barrel, neither a DetailView prop nor a schema key, the same pattern as EmptySectionsLineContext). RecordPageColumns draws the details column through drawDetailsNodes, which wraps every record:details node after the first in the provider with false; DetailView gates its approval band on it. The band (status chip, recall lever, tally, recall error) therefore stays with the first details part, above the body table.

Why this does not drop the chip elsewhere:

  • An authored page's details body, a standalone DetailView and the record drawer are never under RecordPageColumns, so they read the default true and keep their band.
  • A default page with one details part has that part as the first one, so it keeps its band.
  • The locked-or-editable reading is untouched: it is still resolveApprovalLock over the host-threaded state, the same for every part. A lockRecord: false node reads as an editable approval ("In approval · editable"), now drawn once, never as locked.

No spec key, no app-shell source, no new i18n key.

Tests

New top-level describe in the existing RecordPageColumns.test.tsx harness ("the approval band is drawn once per page"). The harness's record:details stub now optionally mounts the DetailView the real block mounts (showHeader: false, inline edit on), opted in by this describe only; the other describes keep the bare stub.

  • wide / two-column / stack: a locked record split around its body table draws "Locked for approval" exactly once, and before the body table in document order.
  • CONTROL: a default page with one details part draws one chip.
  • CONTROL: an authored details body outside the laid-out page draws one chip.
  • CONTROL: no approval running draws no band.
  • A lockRecord: false approval on the split page draws "In approval · editable" once and no lock chip.
Red first, on the test commit before the fix (df979ee, test only)
× wide: a locked record split around its body table draws "Locked for approval" once, above the table
× two-column: ... × stack: ...
× a `lockRecord: false` approval on the split page reads as editable, once — never as locked
AssertionError: expected [ span, span ] to have a length of 1 but got 2
Tests  4 failed | 22 passed (26)
os-verify-lock: VERDICT command-exit 1

The three CONTROL cases were green on that run.

Green on 0122020
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/
Test Files  387 passed | 1 skipped (388)
Tests  3519 passed | 18 skipped (3537)
os-verify-lock: VERDICT command-exit 0

pnpm --filter @object-ui/plugin-detail type-check   (tsc --noEmit && tsc -p tsconfig.test.json; the test file is in the second program's --listFiles)
os-verify-lock: VERDICT command-exit 0

Acceptance notes

  • Scope is the laid-out default page, which is what draws the synthesized page at every tier. A synthesized page that cannot be laid out (buildDefaultPageColumns answers null, so the host draws it as its tab strip) renders its Details tab through the generic page:tabs block, outside this package; a split there would still draw one band per part. Not measured on any real object; noted, not filed.
  • An authored page that places two record:details nodes on purpose still draws a band in each. The card's Expected is about the synthesized split; noted, not filed.

Verification

Derived gate families (dispatch-gates --commands, 38) on 0122020

All 38 derived commands ran locally, each EXIT=0 (captured before any pipe); dispatch-gates --ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. check:new-line-citations (ui): 0 new citations. Every other family is CI's and is read from this PR's check-runs.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Final head for review · area ux-2 · 2026-11-19T11:23Z
Head: 0122020a2405467af96225f2c5f08decd5899632. All check runs on it concluded: 42 success, 13 skipped, 0 failed (the PR-side subset). K = 13 (< 15, no main merge owed).
Fixes #35253 · Clause-②: no (no spec change, no authorable key; the new context is module-internal) · Metadata-protocol: none · +191/−11 over 5 files. Not governed (0 of 5).
Scope: on the laid-out default page, only the first record:details part draws the approval band; later parts get a module-internal context set to false. Authored pages, a standalone details view and the drawer read the default and are unchanged; resolveApprovalLock is untouched, so a lockRecord: false node is still never shown as locked. Readings in os-dev-report 7007256219.
Review route: L1-a thread. The area lands it after the ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:处于审批锁定中的记录(如带明细行的报价、商机),系统默认记录页只显示一次"审批锁定"标识,不再在明细表格上下各出现一次。
  • 为什么做:出现两次会让人误以为有两道锁。
  • 出错会怎样:锁不锁的判断规则没变,只改显示次数;自定义的记录页、单独的详情视图和侧边抽屉不受影响。
  • 要你做什么:无。区域自行落地。

席位核对

L1-a: ACCEPT · head 0122020a2405467af96225f2c5f08decd5899632 · Fixes #35253 · 2026-11-19T11:24Z

Readings: K=13 (under 15, no main merge owed); check-governed-merges --pr 35478 not governed; merge-tree against main clean; CI 42 success / 13 skipped / 0 failed.

Code (5 files, +191/−11).

  • ApprovalBandContext defaults to true. It is module-internal, like EmptySectionsLineContext: not a prop, not a schema key, not in the barrel, so it is no new published surface.
  • RecordPageColumns draws the details column through drawDetailsNodes. That wraps every record:details node after the first in a false provider, which adds no DOM, so the siblings stay siblings and the band stays above the body table.
  • DetailView adds drawsApprovalBand as one more conjunct on the existing band condition (inlineEdit && showHeader === false && !isPrintPage). resolveApprovalLock is untouched, so a lockRecord: false node still reads editable.

Pins. RecordPageColumns.test.tsx adds a split-page shape check and one fault pin per tier (wide, two-column, stack). Those were red on test-only df979eef with 2 chips. Four CONTROLs pass: one details part, an authored single details body, no approval running, and lockRecord: false reading editable once.

Declaration: agreed. Clause-②: no / Metadata-protocol: none / @object-ui/plugin-detail patch.

Routing. Not governed, no contract face: ux-2 lands it. A new push needs a fresh L1 only if it changes more than a main merge.

Follow-up (non-blocking, file before landing). The dev named two out-of-scope cases in the acceptance notes and did not file them. File each as a p3 card under #35253 so they are not lost:

  1. A synthesized page that cannot be laid out falls back to page:tabs, which is not drawn through RecordPageColumns.
  2. An authored page with two record:details nodes.
    A third case is worth one line in card 1: if the first details part draws no DetailView body, for example all sections empty and folded, the band is suppressed on every later part, so a page could show none. Measure it before deciding whether it is real.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Landing · area ux-2 · 2026-11-19T11:27Z

reading value
L1-a ACCEPT comment 7007712812 at head 0122020a24 (= current head)
CI green at 0122020a24 (42 success, 13 skipped, 0 failed); K = 13 (< 15)
check-governed-merges --pr 35478 NOT governed, 0 of 5 paths; +191 / −11; no L2 owed
Follow-ups owed by the ACCEPT filed and nested under #35253: #35483 (page-tabs fallback, plus the empty-first-part case to measure) and #35484 (authored page with two details nodes), both p3 pm:queue

State: draft → ready + auto-merge (merge queue). #35253 closes on merge via Fixes.

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

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants