Skip to content

fix(app-shell): the permission matrix's field boxes stay reachable while the matrix scrolls sideways - #29744

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-4j0nrd
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-4j0nrd

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29677

Clause-②: no
Metadata-protocol: none

Claim: 6593552174

维护者速读

  • 改了什么:权限集矩阵里展开一个对象后,下方的字段面板(筛选、计数、批量按钮和字段表)现在固定在视口内,横向滚动矩阵时不再跟着跑,也不再被“字段名”那一列盖住;Studio Access 和元数据管理两处的矩阵都改了。
  • 为什么改:矩阵最窄 1304 px,窗口更窄就要横向滚动;原来钉在左边的字段名列宽约 700 px,滚动约 80 px 后就把每个字段的“读 / 编辑”勾选框全部盖住,窄屏上管理员根本点不到,字段权限改不了。
  • 风险与回滚:只改了一个文件里的样式类(滚动区加容器查询、字段面板改为吸附定位),没有数据、接口或元数据变化;窗口够宽、矩阵不滚动时外观与原来一致。回滚即还原本 PR。
  • 先看:PermissionMatrixEditor.tsx 里的 FIELD_PANEL / MATRIX_PANE 两个常量和 FieldsSubTable 根节点;ui/e2e/permission-field-panel-scroll.spec.ts(浏览器里逐个滚动位置点中每个勾选框)。
  • 两分钟验证:cd ui && CI=1 pnpm exec playwright test e2e/permission-field-panel-scroll.spec.ts --project=chromium,预期 6 条全绿;在 main 的编辑器上同一命令在 scrollLeft 80 处报“勾选框被字段名单元格盖住”。
  • 需要你做的:无,席位落地。

What changes

ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx only:

  • The field panel is pinned, not the name column. The field sub-table under an expanded object sits in one cell spanning the whole 1304 px matrix, and the table is w-full, so its name column (the only unsized one) took all the leftover width, about 697 px. objectstack#26846 pinned that column sticky left-0, so once the pane scrolled about 80 px it slid over both boxes. Bounding the column's width alone would not do: the boxes sit right after the name, so any scroll past the cell's inset still slides them under a pinned name. Now FieldsSubTable's root (filter, count, bulk buttons, legend and table) carries FIELD_PANEL = sticky left-12 max-w-[calc(100cqi-6rem)]: it holds its place at the expanded cell's own inset (pl-12 on Studio's matrix, px-12 on the metadata admin's) and is no wider than the pane shows less both insets. The name header and cells lose their own pin (FIELD_NAME_CELL is gone); the header keeps its top pin from objectstack#27866 (FIELD_HEAD_CELL).
  • The pane is the size container. Both MatrixScrollPane call sites pass MATRIX_PANE = flex-1 @container, which sets the container on the pane's outer box (the same width as its scroll box), so 100cqi is the pane's width. MatrixScrollPane.tsx is unchanged.
  • Where the pane holds the whole matrix, nothing scrolls and the panel spans the cell as the table did (measured: equal on the metadata admin's 48 + 48 px insets, 24 px narrower on Studio's 48 + 24 px).

The QA item studio-authoring.permission-matrix-editor-ux (revision 10) gains clause acceptance[6], step B5 (steps[8]) and negative[2] for the field boxes under a sideways scroll, appended so no existing index moves, and its automated.ref names the new spec. One changeset, @object-ui/app-shell patch.

Why

The card's runner reading on main at 3482f3d8d2: elementFromPoint at a field box centre answered perm-field-name-OBJ-FIELD from scrollLeft 80 up, and below 1304 px of pane width the boxes could not be reached at all. Re-measured on main at c76cdebf before the fix (below).

Tests

  • New: ui/e2e/permission-field-panel-scroll.spec.ts (Playwright, picked up by ui/playwright.config.ts, testDir: ./e2e; CI runs it in the required Build & E2E UI job, pnpm --dir ui run test:e2e --project=chromium). It bundles the real PermissionMatrixEditPage from source with Vite (the metadata client stubbed at bundle time the way the jsdom tests vi.mock it), styles it with the real Tailwind theme, expands an object of eight fields, and at scroll offsets 0, 40, 57, 80, 120, 200, 320, 480 and the far end reads elementFromPoint at every Read and Edit box centre and at each field name. Six cases: Studio and metadata-admin renderings at 1000 px and 720 px panes (every box answers, the panel holds one left offset); a CONTROL at a 1600 px pane (nothing scrolls, every box answers at scrollLeft 0, green on main too); and the pin not binding at 1600 px (panel width equals the cell's content width).
  • Updated jsdom pins (class contract, guarded in Test UI): PermissionMatrixEditor.fieldTableLayout-26846.test.tsx now pins, on both renderings, the panel's sticky left-12 max-w-[calc(100cqi-6rem)], the cell's 48 px inset, @container on the pane, the toolbar, header, names and both boxes inside the panel, and no sticky on the name cells; PermissionMatrixEditor.gridChrome-27866.test.tsx's field-header pin now expects the name header without left-0 (it pinned the old left-0 z-[3]).
  • Ablation (main's PermissionMatrixEditor.tsx restored into the tree under a trap, blob aa5d4f53 = origin/main; restored to HEAD blob a0b449fd, git status clean): the spec's four sweep cases go red with Read box of amount at scrollLeft 80 (pane 1000/1304) is covered by td[data-testid=perm-field-name-a_project-amount] (same at 720 px), the 1600 px CONTROL stays green, the no-bind case is red (no panel); jsdom 4 of 12 red (both panel pins, both field-header pins).
Live Console measure (Vite on source + app-crm backend, 1000 px window)

/studio/~all/metadata/permission/qa_field_scroll (a writable env-scope set granting crm_account, metadata-admin rendering, pane 1000/1304) and /studio/com.example.crm/access?item=crm_sales_user (Studio Access rendering, pane 760/1304), crm_account expanded, 18 field boxes in view:

scrollLeft 0 40 57 80 200 far end
main, metadata admin (name cell 705 px) 18/18 18/18 18/18 9/18 0/18 0/18
main, Studio Access (name cell 720 px) 0/18 (off pane) 9/18 9/18 0/18 0/18 0/18
this PR, metadata admin (name cell 506 px) 18/18 18/18 18/18 18/18 18/18 18/18
this PR, Studio Access (name cell 350 px) 18/18 18/18 18/18 18/18 18/18 18/18

Every covered box answered perm-field-name-crm_account-FIELD. Before/after screenshots at scrollLeft 0, 200 and the far end are kept with the card thread's files.

Local runs on the final head 9d196c5 (after merging main)
  • Spec: 6 passed. jsdom: fieldTableLayout-26846, gridChrome-27866, fieldBulk, readonly: 4 files, 26 tests passed.
  • Before the merge, at 5799825: the 52 test files under ui/packages naming PermissionMatrixEditor, perm-field-, FieldsSubTable or MatrixScrollPane, 368 tests passed; pnpm --filter @object-ui/app-shell run type-check exit 0; tsc -p ui/tsconfig.e2e.json exit 0; eslint on the four touched ui files 0 errors (19 warnings, all pre-existing lines); pnpm --dir ui exec vitest run scripts/ 170 files passed.
  • dispatch-gates --commands derived 42 families at 5799825; all 42 ran, exit 0, reconciled with --ran (42 run, 0 NOT-MEASURED). Re-run on 9d196c5: check-sdui-manifest, check:platform-checklist, check-changeset-no-major --base origin/main, check:nul-bytes, all exit 0.
  • Main's 12 incoming commits touch none of this PR's files.

Acceptance notes

  • Seen on main and on this branch alike, not changed here: on the Studio rendering, the object row that is expanded or under the pointer lets the scrolled object boxes show through its pinned Object cell (the row's tint is not opaque over them); see the far-end screenshots. Reported to the seat, not fixed here.
  • The panel reserves 6rem (both insets of the metadata admin's cell); Studio's cell has a 24 px right inset, so there the panel ends 24 px short of the cell's edge when the pin binds.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the touched ui files: 0 errors)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTaAUD6ttuQLjbPsrZ


Generated by Claude Code

… column

The field sub-table's name column was its flexible one, so it took all the
width the matrix floor left over (about 697 px), and once pinned to the left
it covered the Read and Edit boxes after a sideways scroll of about 80 px.
The whole field panel now stays at the expanded cell's inset, as wide as the
scroll pane shows, so every box stays in view at any scroll offset.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTaAUD6ttuQLjbPsrZ
…ll; add the QA clause and the changeset

A Playwright spec bundles the real permission editor from source and reads
elementFromPoint at every field box over a sweep of scroll offsets, on both
matrix renderings and two narrow panes, with a wide-pane control. The jsdom
pins move from the pinned name column to the pinned field panel. The QA item
permission-matrix-editor-ux gains clause acceptance[6], step B5 and a negative
(revision 10).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTaAUD6ttuQLjbPsrZ
…ubbed holders module

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTaAUD6ttuQLjbPsrZ
…ngs; split the wide-pane control

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTaAUD6ttuQLjbPsrZ
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ

维护者速读

  • 改了什么:权限矩阵横向滚动时,展开对象下方的字段面板(筛选、计数、批量按钮、字段表)固定在单元格缩进处,宽度不超过可见区域;字段名列不再单独固定。Studio 权限页和元数据管理页同时生效。QA 清单对应条目加一条验收。
  • 为什么改:矩阵最小宽度 1304 px,窄窗格要横向滚动。原先固定在左侧的字段名列约 697 px 宽,滚过约 80 px 就盖住每个字段的"读/写"勾选框,窗格窄于 1304 px 时根本点不到。
  • 风险与回滚:低。只改一个组件的样式类(约 28 行源码);窗格放得下整张矩阵时外观不变。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx 的 FIELD_PANEL 与 MATRIX_PANE。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.fieldTableLayout-26846.test.tsx,预期全绿;浏览器几何测试 ui/e2e/permission-field-panel-scroll.spec.ts 由必跑的 Build & E2E UI 执行。
  • 需要你做的:无,席位验收后进合并队列。

席位意见: 实测 main 上 1000 px 窗格滚到 80 px 时 18 个勾选框只有 9 个可点,200 px 起全部被盖;修复后每个偏移都 18/18。只固定名字宽度不够(任何滚动仍会把框滑到名字下),所以改为固定整个字段面板。

席位核对 — ACCEPT · domain:ui#2 · head 9d196c52 · 2026-11-03T03:27Z

  • 形态: draft PR on main, Fixes #29677 on its own line. 6 files, +541/−33 (source +28/−11), Tier S (check-governed-merges --pr 29744: not governed; under 3000 lines). All inside claim 6593552174: PermissionMatrixEditor.tsx (the two scroll panes and the field panel; the panel's root div replaces the pinned name cell, seat-accepted at design), the QA item studio-authoring.permission-matrix-editor-ux (rev 10, acceptance[6], step B5, negative[2], an appended history row), tests, the changeset. fix(app-shell): a New similar copy in a base's .custom pair lists and counts its grants on the base's objects #29718's hunks in the same file do not meet these.
  • 前提实测: on main (admin, 1000 px pane) elementFromPoint reaches 9 of 18 field boxes at scrollLeft 80 and 0 of 18 from 200; the Studio pane at 760 px never reaches all. On this head: 18 of 18 at every offset on both renderings. The seat looked at the before/after shots in /mnt/project-files/issue-29677/screens/.
  • 门禁 check-runs (pinned to head 9d196c52fc9c5bb58cefbc1521e0d8d4df0dc84b): 48 success, 9 skipped, 0 failed, 0 pending (57 runs), including Check Changeset, Type Check UI, Lint UI, Test UI (16 shards) and Build & E2E UI (which runs the new geometry spec). Dev local gates: 42 derived, 42 run, all exit 0, 0 NOT-MEASURED; post-merge check-sdui-manifest, platform-checklist, check-changeset-no-major and NUL-byte checks exit 0. The new Playwright spec runs under the default config in the required Build & E2E UI (--project=chromium), 6 of 6; the jsdom class-contract pins on both renderings, 4 files / 26 tests; neighbours 52 files / 368. Ablation with main's editor: the spec reds at scrollLeft 80 (covered by perm-field-name) while its CONTROL stays green; jsdom 4 of 12 red.
  • Code read: the pane becomes a size container (@container) and the panel is sticky left-12 with max-w-[calc(100cqi-6rem)], the expanded cell's own pl-12 inset on both hosts, so the four-column field table never scrolls with the object columns. Where the pane holds the whole matrix nothing moves.
  • 接受的偏差: the whole field panel is pinned instead of the name cell only (bounding the name alone still slides the boxes under it on any scroll); a browser geometry spec plus jsdom class pins, since jsdom has no layout.
  • 范围外去向: on an expanded or hovered object row in Studio, scrolled object boxes show faintly through the pinned Object cell (its tint is not opaque); the same on main, cosmetic, no lost control, so recorded here, not filed. No Skills-docs: line is owed.
  • 落地条款: Clause-②: no (app-shell is private), Metadata-protocol: none, patch for @object-ui/app-shell; no contract review is owed. Land by pr_ready + automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 3, 2026 03:28
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 3, 2026 03:28
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit cba12d2 Nov 3, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-4j0nrd branch November 3, 2026 03:54
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio Access: scrolling the permission matrix sideways hides the field Read and Edit boxes under the sticky name cell

1 participant