Repository navigation
Commit f068cde
fix(plugin-grid): fold a row's inline primary action into its menu while the table overflows with it (#33441)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHq9zDwuvUTBNrthT2ngEFS)_
Fixes #33230
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:列表行的主按钮(variant:
primary)只在表格放得下它时内联显示;放不下就并进该行的「⋮」菜单顶部,右侧固定的操作列随之缩到只剩「⋮」。
- 为什么改:记录抽屉里放大的相关列表只有 622 px 宽,内联按钮让固定操作列宽一倍(139 px 对 68
px),表格因此溢出,固定列盖住最后一列「状态」。
- 风险与回滚:只动 plugin-grid 的行操作列宽度决策,不改协议、不改服务端;回滚即 revert 本
PR。全页列表放得下时行为不变,手机卡片布局不经过这段代码。
-
先看:objectGridInlineActionFold.ts(折叠规则与读数时机)、objectGridActionsColumn.tsx(折叠时内联预算取
0)、ObjectGrid.tsx(接线)。
- 两分钟验证:在本 PR 的 E2E chromium 检查日志里搜 related-list-pinned-actions,预期
drawer1440 / drawer1280 / drawer1024 三行都是 folded:true、inlineButtons:0,且
statusRight 不大于 actions.left;fullPage1440 一行
folded:false、inlineButtons:3。
- 需要你做的:无,席位落地。
## What changes
`ObjectGrid` pins its Actions column to the right edge of the table's
scroll box. A `variant: 'primary'` row action draws as an inline button
beside the row's "⋮" trigger, and that button roughly doubles the pinned
column. In a record drawer's enlarged related list the content is 622 px
wide at the default drawer size, and the extra width alone turns a table
whose data columns fit into one that overflows. The pinned column then
sits over the last data column (Status) at rest.
The grid now draws inline row buttons only while the table fits its
scroll box with them.
- When the table overflows with them, each row's primary action moves to
the top of that row's "⋮" menu, through the row-menu planner with an
inline budget of 0. No action is dropped, and the pinned column shrinks
to the trigger.
- The buttons come back once the scroll box is at least as wide as the
table was with them.
- Every reading waits until the table's size has held for two animation
frames, because the table sizes its columns from what the cells drew
over several passes, and a reading taken mid-pass sees widths it never
settles at.
- The decision starts over (unfolded) whenever the rows or the column
set change.
- The grid's host carries `data-row-actions-inline="folded"` while
folded, so the state is readable in the DOM.
No export, prop or authored key changes. `maxInlineRowActions` stays a
non-author surface.
**Producer, measured on origin/main before the fix.** It is the pinned
column's width, not the scroll box's reservation. The box does reserve
the column: its scroll width includes it, and scrolling to the end
reveals Status. At rest, though, the 139 px column (with the inline
button) covers the last data column, and `elementFromPoint` at the
Status cell's centre answered the inline Allocate button (box 900 px,
table 954 px, Status spanning 735 to 815 under the column from 761).
Menu-only the column is 68 px.
## Tests
`ui/e2e/related-list-pinned-actions-width.spec.ts` mounts the real
`RelatedList` enlarged face (then `object-grid`, `data-table` and the
row menu) in Chromium, with Vite-bundled sources and compiled Tailwind,
inside a frame of the drawer's or the list page's width. Reachability is
read from layout with `elementFromPoint`, and the menu path is driven
with real clicks.
- Drawer (622 px) at 1024, 1280 and 1440 px windows: the inline button
is folded, the table no longer overflows, Status's cell and header are
hit at their centres, Status ends at or before the Actions column's left
edge, and Allocate dispatches from the "⋮" menu.
- CONTROL, full list page (1184 px at a 1440 window): not folded, three
inline buttons, Status hit, and the inline click dispatches.
- CONTROL, 390 px: the card layout draws (no table scroll box, no fold
mark), with Allocate in the card's menu.
- A table that overflows the drawer even menu-only: it folds too, and
Status is reached by scrolling to the end.
<details><summary>Readings, at this head</summary>
```text
drawer1440 box 622/622 folded true inline 0 actions left 554 width 68 statusRight 554 hit true
drawer1280 box 622/622 folded true inline 0 actions left 554 width 68 statusRight 554 hit true
drawer1024 box 622/622 folded true inline 0 actions left 554 width 68 statusRight 554 hit true
fullPage1440 box 1184/1184 folded false inline 3 actions left 1045 width 139 statusRight 1045 hit true
drawerWide1440 box 622/912 folded true inline 0 actions left 554 width 68 statusRight 844 (reached after scrolling)
6 passed
```
</details>
<details><summary>Ablation at 3afff0c (the fold's decision made a
no-op, through scripts/ablation-replace.mjs)</summary>
```text
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 53abf59 -> 4dec1046a3e3
drawer1440 box 622/654 folded false inline 3 actions left 483 width 139 statusRight 515
Error: the pinned Actions column covers part of Status at rest
drawer1280 (same readings) Error: the pinned Actions column covers part of Status at rest
drawer1024 (same readings) Error: the pinned Actions column covers part of Status at rest
fullPage1440 unchanged, passed
drawerWide1440 folded false, failed
4 failed, 2 passed
ablation-replace: ok restored: blob == HEAD (53abf59) and `git diff HEAD` is empty
```
</details>
## Acceptance notes
- When the table overflows the box even with the menu alone (many
columns in a drawer), the folded "⋮" column still sits over the data at
the box's right edge at rest, as on any list that scrolls sideways,
including the full list page today. The fold makes room for every table
that the inline button alone tipped over. Holding the line for a table
that overflows anyway would need un-pinning the column or drawing
columns narrower than their content, which is a separate design choice
and not in this card.
- The card's figures (a 753 px reading against 623 px of scroll) do not
add up to one table width, so this PR reproduced the defect from the
drawer's measured content width (622 px at the default 720 px pane)
rather than from those figures.
- The live showcase drawer has no enlarged related list to open (its
authored page has no enlarge control), so the drawer width was measured
live and the defect was reproduced and pinned in the browser harness
above.
## Verification
Head `ee03c81e`. The gate list comes from `dispatch-gates --commands` on
this diff (37 families). Each exit code was captured before any pipe,
then reconciled: `dispatch-gates --ran` reads 37 derived, 37 run, 0
NOT-MEASURED, 0 UNRUN, plus 4 ui runs outside the derivation. The
workspace packages were built first (`turbo run build` over
`./packages/*`, exit 0).
The first `ui` scripts run went red on one test,
`e2e-type-check.test.ts` "imports no workspace package". The pin's page
entry named `@object-ui/*` packages in its source string. It now names
their sources by path, and the whole suite reran green (171 files
passed, 2 skipped). The gates that read the spec file reran after that
change.
<details><summary>Local gate record (COMMAND :: exit N)</summary>
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm --dir ui --filter @object-ui/plugin-grid run type-check :: exit 0
pnpm --dir ui run type-check:e2e :: exit 0
pnpm --dir ui run check:new-line-citations :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:published-files :: exit 0
pnpm check:where-matcher :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --dir ui exec vitest run packages/plugin-grid/ :: exit 0
```
</details>
CI families outside this list (the e2e chromium run that executes the
new pin, the type-check lanes and the wide-population families) are read
from this PR's check runs.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5osPMA12JX9fGcBzR3)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 629e567 commit f068cde
5 files changed
Lines changed: 585 additions & 4 deletions
File tree
- .changeset
- ui
- e2e
- packages/plugin-grid/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments