Repository navigation
fix(ui): the list footer's record count starts on the 16px left edge - #37124
Conversation
The summary row's first cell spans the leading (selection) cell where one is drawn and starts at its 16px inset; the left-edge spec now measures the real summary row's lead instead of a stand-in footer. Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
|
list-frame-geometry-35548.spec.ts reads the summary cell's base class and its right-aligned arm out of data-table.tsx as adjacent lines; the span's pl-4 arm now follows the align arms (later classes still win under cn). Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Final green head for L1 (2026-11-24T21:20Z):
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Landing (2026-11-24T21:45Z) — head
State change: ready for review + auto-merge armed; the merge queue lands it. On MERGED, #37028 closes by |
…e widens after its rows are drawn (objectstack-ai#37253) Fixes objectstack-ai#37239 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员在工作室「全部元数据」列表(例如共享规则)里,表格比可视区域宽时,右侧固定列前那道提示「右边还有列」的阴影现在每次都会出现;以前大约一半的打开次数不出现。 - 为什么做:夜间回归测试因此变红(共享规则列表在 1440 宽下的可达性检查),这是让它恢复的产品修复。 - 出错会怎样:最坏只是宽表右侧阴影不显示或多显示一次,不影响数据和操作;改动可直接撤回。 - 要你做什么:无。 ## What changes - `ui/packages/components/src/custom/use-horizontal-overflow.ts` (`useHorizontalOverflow`): the box re-reads its overflow when the box, each child of the box, **or each child's own children** resize. Before, it watched the box and its direct children only. - Why that matters: every table here sits inside the shadcn `Table` wrapper (`relative w-full`, `overflow-visible` inside a box that scrolls). The wrapper keeps the box's width, so when the table element widens past the box with no row added and the box unchanged, no observer fired, `overflowRight` stayed `false`, and `data-table`'s right seam shadow (`data-table-scroll-shadow-right`) was never drawn. - The same hook drives `HorizontalOverflowBox` (`data-overflow-right` and its edge or pinned seam), so a table placed in that box inside a wrapper (the approvals inbox mounts one that way) follows the table's width too. Pinned below; not measured live. - Changeset: `@object-ui/components` patch. ## Why Nightly `nightly-tiers` run 45554381420 (`0a1b69c0b`) failed `ui/e2e/live/declared-sharing-rules-reach-13091.spec.ts`: the seam shadow was not found within 5 s although the table's scroll box was wider than its client box. **Which suspect it is.** objectstack-ai#36978 (`c48f06c87`, the metadata list on ObjectGrid) is the change that exposed it, and is not itself wrong. It moved the list onto `data-table` and pointed the spec at `data-table`'s shadow. That shadow carried a latent defect in `useHorizontalOverflow`, and the new list's layout hits it about half the time. objectstack-ai#37089 (the permission set full-screen) is ruled out: it does not touch this list's grid or the overflow hook. Nothing else changed the data-table seam shadow between the last green nightly (`d9c799c10`, 2026-11-24) and the red one. The only other `data-table.tsx` edit in that window is objectstack-ai#37124 (the footer summary row), which does not touch the overflow read. **Measured DOM** (Chromium 1440x1000, this tree's Console against the workspace showcase backend, a requestAnimationFrame log of the scroll box from first paint): ``` before the fix, a failing open (12 of 20 opens ended like this): +1315ms sw=1134 cw=1134 child=1134 table=1134 rows=3 shadow=false rows drawn, the table fits +1331ms sw=2168 cw=1134 child=1134 table=2168 rows=3 shadow=false the columns widen the table +1384ms sw=1826 cw=1134 child=1134 table=1826 rows=3 shadow=false ...and it stays without a shadow a passing open: the table is already wider than the box when the rows draw (sw=1826 at the first frame) after the fix (20 of 20 opens with a shadow), the same sequence: +1379ms sw=1134 cw=1134 child=1134 table=1134 rows=3 shadow=false +1391ms sw=2168 cw=1134 child=1134 table=2168 rows=3 shadow=false +1427ms sw=1826 cw=1134 child=1134 table=1826 rows=3 shadow=true ``` `child` is the wrapper, the box's only child, and it stays at 1134 throughout. That is why the old read never ran. The scrollbar-at-rest read in `data-table` already observed the table element itself, which is why the bar showed while the shadow did not. So the product regressed, and the spec is unchanged. It still measures that the controls are in reach and that a seam shows while columns remain to the right. ## Tests - `data-table-scroll-shadow-12463.test.tsx`: a new top-level describe. A recording `ResizeObserver` calls back only the observers watching the element that resized, as a browser does. The table element alone grows past the box (no scroll, no row added), and the shadow is drawn. CONTROL: a table that grows but still fits draws none. - `horizontal-overflow-12708.test.tsx`: a new top-level describe, the same reading for `HorizontalOverflowBox` with a wrapped table. CONTROL: a resize of the wrapper itself still re-reads. Read first (by risk): 1. `use-horizontal-overflow.ts`: the nested observe loop. It adds observers on grandchildren and changes no read. 2. `data-table-scroll-shadow-12463.test.tsx`: the recording observer and the new describe. Two-minute check: `pnpm --dir ui exec vitest run packages/components/src/renderers/complex/__tests__/data-table-scroll-shadow-12463.test.tsx`. Expect 8 passed, including "draws the shadow once the table alone grows past the box". <details><summary>Unit and package runs at ddb6f6f: both pin files 15/15; the whole components package 510 files passed, 1 skipped; type-check green</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/src/renderers/complex/__tests__/data-table-scroll-shadow-12463.test.tsx packages/components/src/__tests__/horizontal-overflow-12708.test.tsx Test Files 2 passed (2) Tests 15 passed (15) pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/ Test Files 510 passed | 1 skipped (511) Tests 4970 passed | 24 skipped (4994) os-verify-lock: VERDICT command-exit 0 pnpm --filter @object-ui/components type-check (tsc --noEmit && tsc -p tsconfig.test.json, the ui/ dependency closure built first) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Local gate families at ddb6f6f: 38 derived, 38 run, every one exit 0</summary> ``` node scripts/pm/dispatch-gates.mjs --ran FILE Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3). pnpm check:test-source-alias -> exit 0 node scripts/pm/overlap-check.mjs -> VERDICT clean exit 0 (origin/main; and with --pr=37168,37169,37166,37226: every one merges cleanly) ``` </details> ## Acceptance notes - Ablation (one run, both pins, `scripts/ablation-replace.mjs`): deleting the grandchild-observe line, `anchor 1 -> 0, blob 7965aaa -> aae15c0c6be7`, makes both new pins fail. The data-table one fails with "Unable to find an element by: data-testid=data-table-scroll-shadow-right", and both CONTROLs stay green (`Tests 2 failed | 13 passed (15)`). Restored: `blob == HEAD (7965aaa)`, `git diff HEAD` empty. Both test files import the hook from source, so no build is involved. - Size: 4 files, 182 changed lines (176+, 6-). - Deviation: part of the scratchpad logs (the raw Playwright and probe outputs) was deleted mid-session by a process this run does not own. The readings above were copied from those runs as they finished. ## Verification The stack the nightly boots, step for step: `ui/e2e/live/ci/start-backend.sh` (this tree's CLI serving `examples/app-showcase`, a throwaway database), the Console built with `VITE_BASE_PATH=/` and served by `vite preview`, then Playwright from `ui/` with `playwright.live.config.ts`, Chromium. <details><summary>Before the fix (main at d7f299c): the spec fails 5 of 10 repeats, with the nightly's error</summary> ``` playwright test --config=playwright.live.config.ts declared-sharing-rules-reach-13091.spec.ts --repeat-each=10 Error: expect(locator).toBeVisible() failed (Locator: getByTestId('data-table-scroll-shadow-right').first()) 5 failed 5 passed (57.3s) ``` </details> <details><summary>After the fix (Console rebuilt from this branch): 20 of 20, and the whole nightly list 28 of 28</summary> ``` playwright test --config=playwright.live.config.ts declared-sharing-rules-reach-13091.spec.ts --repeat-each=20 20 passed (55.0s) pnpm --dir ui run test:e2e:live:nightly (the 14 spec files console-live-specs.live.test.ts runs) 28 passed (1.7m) ``` </details> The backend and the preview server this run started were stopped by their recorded PIDs. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (CI) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnxVj5xoUcFUWLa5Aw)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #37028
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/components/src/renderers/complex/data-table.tsx, the summary row (data-testid="data-table-summary-row"): where the table draws a leading cell (selection or row numbers) and the row has alead, the first column's summary cell now spans the leading cell (colSpan) and takes the leading cell's 16px inset (pl-4) instead of an empty 40px cell followed by the first column'spx-3. The lead (the list's record count) therefore starts at 16px, on the one left edge of 列表页左侧一条线对齐:勾选列在列多时被压到 16 宽并贴住屏幕左边;页面栏、视图栏、表格、页脚的左起点各不相同 #35663, and the first column's figure keeps ending at its column's right edge (列表框架:页面栏 + 视图栏两条、表头 32 / 行高 33、统一 13 号字、合计与列对齐(图 36) #35548: each figure in its column's cell). Frozen: both the leading cell and the first column are frozen wheneverfrozenColumns > 0, so the spanning cell keeps the leading cell'sleft: 0. Unchanged: a row without a lead, a table without a leading cell, and a right-pinned first column (all keep the old cells).ui/e2e/list-left-edge-35663.spec.ts: the footer half now measures the real summary row's lead. The grid is mounted the way the list mounts it (residentSummaryRow,summaryRowLead), with a declared calculation on the first column. The stand-in footer (a span reading12 recordsunder the record-count bar's class) is kept only at phone width, where the grid draws cards and no summary row and the list really draws that bar. New assertions: the count at 16 on the wide and the narrow list, at 16 after scrolling to the far right and back, and the first column's figure inside its column's header box and clear of the count.ui/packages/components/src/__tests__/data-table-summary-lead-edge-37028.test.tsx: jsdom pin of the row structure (span, inset, frozenleft: 0, the figure in the same cell, every column covered once, and the unspanned cases)..changeset/37028-footer-count-left-edge.md:@object-ui/componentspatch.Tests
Read first (by risk):
data-table.tsx, the summary row hunk:leadSpansLeadingand theleft: 0for the frozen spanning cell.list-left-edge-35663.spec.ts, the fixture'sresidentSummaryRow/summaryRowLeadand thefirstFigurereading.Two-minute check: open any list page (for example
showcase_task) at 1280 wide. The footer's 「10 条记录」 starts on the same vertical line as the select-all box above it.All readings are against the tree named on each line, in this repository (
objectstack-ai/objectstack).pnpm exec vitest run packages/components/src/__tests__/data-table-summary-lead-edge-37028.test.tsx(fromui/): at9a56330a0Test Files 1 passed, Tests 6 passed. Withdata-table.tsxput back toa68b475bb(the rest at614d23050): Tests 4 failed, 2 passed (an empty cell precedes the lead: expected null to be 'name'; frozenleft''vs0px). Restored withgit checkout HEAD --; the file's hash equals the HEAD blob (3b6d3d8f).e2e/list-left-edge-35663.spec.ts(chromium, a local config without the preview server; the spec mounts its own page): at9a56330a04 passed. Footer count at 16 on the wide list (scrolls sideways) and the narrow list (fits); 16 at the far right and back; first column's figure 100.6 to 150 inside its column 40 to 162, the count ends at 78.7. Withdata-table.tsxata68b475bb: 3 failed, 1 passed:footer count starts at 52, not 16(wide, narrow) andthe footer count starts at 52 after scrolling, not 16. So the pin fails on the defect it once let through.pnpm --filter @object-ui/components testate70b80df2: Test Files 509 passed, 1 skipped (510); Tests 4958 passed, 24 skipped.ListView.test.tsx, app-shellrecordCountFooter-10636), 9 files ate70b80df2: 9 passed, 330 tests passed.pnpm --filter @object-ui/components type-check(after building its closure) ate70b80df2: exit 0.tsc -p tsconfig.e2e.json(ui): exit 0.dispatch-gates.mjs --commands, 38): 36 exit 0.check:test-source-aliaswas red on the new test file and is green after the module-top import it prescribes.pnpm --dir ui exec vitest run scripts/had 1 failure, a 15 s timeout injs-comment-mask-returns-interpolation-9424.test.ts(atscprogram build), run on a loaded shared box; no file in this diff is underui/scripts/. The rerun under the lock was cut off by the foreground limit: NOT MEASURED here, CI runs it.Acceptance notes
records-forms.list-view-capabilitiesacceptance[11] already states the 16px promise for the footer count; nothing is re-pointed there (a separate card owns checklist re-points).Verification
Browser check on the running showcase app (
pnpm dev -- --fresh, Console from this branch'sui/source through Vite, Chromium 1280x800, locale zh-CN), measured fromrecord-list-host(left 256):showcase_task「10 条记录」showcase_project「5 条记录」The issue measured the count at 52 on both before this change.
Generated by Claude Code