You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 46ad134
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-detail): a laid-out record page whose first details block draws no body keeps its approval band (#36287)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTRdLmK9YYgMSCJ7NH2PuUY)_Fixes#35483
repo:objectstack#4 · os-project-manager ·
session_01FEkQ5oLLK7uoxp33riiBJL
Clause-②: no
Metadata-protocol: none
This PR also carries the folded card #35484 (authored page with two
details nodes), closed into this one by the fold ruling on the card.
## 维护者速读
-
用户能看到什么变化:记录被审批锁定时,「替换详情区」的记录页如果第一个详情区对当前用户隐藏(无权限)或自带标题,原来整页一个锁定标识都不显示,现在由下一个详情区显示一次;其他记录页不变。
- 为什么做:记录页「审批锁定标识每页只显示一次」的收尾,同时核实了自定义页面和页签回退两种情形已经只显示一次。
- 出错会怎样:只影响锁定标识显示在哪个详情区、显示几次,锁定规则本身不变;可以直接撤回。
- 要你做什么:无。
## What changes
Measured first on `origin/main` a5a5312, as the card asks. Three
readings, each a rendered test on an approval-locked record through the
real `record:details` / `page:tabs` renderers:
| Row | Page | Bands drawn |
|:---|:---|:---|
| (a) | synthesized page falling back to its `page:tabs` strip, two
details parts, inside the host's `ApprovalBandOnceScope` | 1 (2 marks);
2 without the scope |
| (b) | authored page, two `record:details` nodes | 1 (already pinned at
host level by the PR that closed the approvals-tab card) |
| (c1) | laid-out synthesized page split around a body table, first part
with every section empty | 1 |
| (c2) | laid-out slotted page, `details` slot, first `record:details`
withheld by `requiredPermissions` | **0** |
| (c3) | laid-out slotted page, `details` slot, first `record:details`
with `showHeader: true` | **0** |
| (c4) | laid-out slotted page, two plain `record:details` | 1 |
Rows (a) and (b) were already fixed on `main` by the approvals-tab
rework: the host wraps every page drawn as written in
`ApprovalBandOnceScope`. The one reachable route to (a) is a slotted
page that places a `page:tabs` node in a strip slot (`highlights`,
`header`, `actions`, `alerts`): two strips, which
`buildDefaultPageColumns` cannot partition. A page the synthesizer
writes on its own always lays out.
What still failed is the case both cards name ("without dropping the
band from a page whose first details node ... draws no body"): on the
LAID-OUT page, `RecordPageColumns` gave the band to the first
`record:details` node and set `ApprovalBandContext` false on every later
one, so a first node that draws no band took it off the page. The fix
gives the laid-out details column the same rule as a page drawn as
written:
- `RecordPageColumns` wraps its details column in
`ApprovalBandOnceScope`: the first details body that reaches the band's
place draws it.
- `ApprovalBandContext` is removed: the per-part suppression was its
only provider, and `DetailView` no longer reads it. It was
module-internal (not in the barrel, not a prop, not a schema key), so no
public face moves.
- `resolveApprovalLock` and the lock rule are untouched; a `lockRecord:
false` approval still reads `In approval · editable`, once.
All edits are under `ui/packages/plugin-detail/**`;
`RecordDetailView.tsx` and `RelatedList.tsx` are not touched.
Read first, by risk:
1. `ui/packages/plugin-detail/src/RecordPageColumns.tsx`
`drawDetailsNodes`: the scope replaces the per-part context; the band
still sits above a body table on the split page.
2. `ui/packages/plugin-detail/src/DetailView.tsx`: the band now gates on
the scope alone.
3. `ui/packages/plugin-detail/src/defaultRecordPage.ts`: the context and
its doc, merged into the scope's doc.
## Tests
- `RecordPageColumns.test.tsx`: a new top-level describe (the shared
harness file) pins a first part withheld by `requiredPermissions` and a
first part with `showHeader: true` (band once, on the second part), a
`lockRecord: false` approval behind a withheld first part (editable
once, never locked), and CONTROLs for two drawing parts (band on the
first), a single part, and a single withheld part (no band, notice
shown). The harness's `record:details` stub now hands its node to the
body it mounts.
- `DetailView.approvalBandOnce-35484.test.tsx`: a new top-level describe
draws the synthesized page's `page:tabs` fallback through the real
renderers: the page cannot be laid out and its overview holds two
details parts; one band under the scope; CONTROL two bands without it;
CONTROL one part draws its one band. The file header's pointer to the
host pin now names the file that holds it.
Reverse verification (one-off, fix committed first): the three `src`
files restored to a5a5312, the two test files kept: 3 failed, 39 passed
(the two first-part cases and the `lockRecord: false` case: no band
found). Restored with `git checkout HEAD`, `git diff HEAD` empty.
## Acceptance notes
- Overlap: `overlap-check` reports PR #36234 (seat 1, the field-list
card) sharing the four plugin-detail files, with a textual conflict in
`RecordPageColumns.test.tsx` (both append to it). Whichever lands second
takes a mechanical merge of that test file.
- (a) is reachable only through a slotted page with a `page:tabs` node
in a strip slot; whether that shape should be authorable at all is not
this card's question (noted, not filed).
## Verification
Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx
packages/plugin-detail/src/__tests__/DetailView.approvalBandOnce-35484.test.tsx`
— expect 42 passed.
<details><summary>Readings at head 02f7053 (local, under the shared
verify lock; shared-box wall times)</summary>
- Measurement (scratch file, deleted), real renderers at a5a5312: `(a)
scoped marks 2 bands 1` · `(a) unscoped bands 2` · `(c1) bands 1` ·
`(c2) refusal 1 bands 0` · `(c3) bands 0` · `(c4) bands 1`; slotted
`highlights` slot with `page:tabs` gives `buildDefaultPageColumns` null.
- Two pinned files after the fix: `Test Files 2 passed (2)`, `Tests 42
passed (42)`, `VERDICT command-exit 0`.
- Reverse verification (src at a5a5312, tests kept): `Tests 3 failed |
39 passed (42)`, `VERDICT command-exit 1`; restored, `git diff HEAD`
empty.
- Whole `@object-ui/plugin-detail` suite: `Test Files 403 passed | 1
skipped (404)`, `Tests 3737 passed | 18 skipped (3755)`, `VERDICT
command-exit 0`.
- `pnpm --filter @object-ui/plugin-detail type-check` (both programs,
`tsc --noEmit && tsc -p tsconfig.test.json`): `VERDICT command-exit 0`.
- `dispatch-gates --commands` derived 38 families; 37 run locally, each
exit 0; `pnpm --dir ui exec vitest run scripts/` is reported separately
in the dispatch report.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(plugin-detail): a laid-out record page whose first details block draws no body still shows the approval band
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The laid-out record page draws the record's approval band ("Locked for approval" / "In approval · editable", with its recall lever and tally) once per page. It used to give the band to the first `record:details` node of the details column and tell every later one not to draw it, so on a slotted page whose `details` slot puts first a `record:details` the reader may not see (its `requiredPermissions` withheld) or one that draws its own header (`showHeader: true`), a locked record showed no band at all. The details column now draws the band by the first details body that reaches its place, the rule a page drawn as written already follows: the next part draws it. Every other page reads as before, the band stays above a body table, and whether the band reads locked or editable (a `lockRecord: false` approval node) is unchanged.
0 commit comments