Skip to content

fix(ui): the list footer's record count starts on the 16px left edge - #37124

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-37028-footer-count-edge
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-37028-footer-count-edge

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37028

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户在每个列表页底部看到的「N 条记录」左边缘从 52px 挪到 16px,和全选框、页头图标对成一条线;合计数字仍在各自列下。
  • 属于「列表页重做」这一 epic 的验收收尾:页面只有一条左边缘的承诺此前在页脚这一处没兑现。
  • 若出错,只是页脚第一格的排版错位(计数或第一列合计挤位),不影响数据,改动可直接撤回。
  • 无。

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 a lead, 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's px-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 whenever frozenColumns > 0, so the spanning cell keeps the leading cell's left: 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 reading 12 records under 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, frozen left: 0, the figure in the same cell, every column covered once, and the unspanned cases).
  • .changeset/37028-footer-count-left-edge.md: @object-ui/components patch.

Tests

Read first (by risk):

  1. data-table.tsx, the summary row hunk: leadSpansLeading and the left: 0 for the frozen spanning cell.
  2. list-left-edge-35663.spec.ts, the fixture's residentSummaryRow / summaryRowLead and the firstFigure reading.

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).

  • Unit pin, pnpm exec vitest run packages/components/src/__tests__/data-table-summary-lead-edge-37028.test.tsx (from ui/): at 9a56330a0 Test Files 1 passed, Tests 6 passed. With data-table.tsx put back to a68b475bb (the rest at 614d23050): Tests 4 failed, 2 passed (an empty cell precedes the lead: expected null to be 'name'; frozen left '' vs 0px). Restored with git checkout HEAD --; the file's hash equals the HEAD blob (3b6d3d8f).
  • Left-edge spec, e2e/list-left-edge-35663.spec.ts (chromium, a local config without the preview server; the spec mounts its own page): at 9a56330a0 4 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. With data-table.tsx at a68b475bb: 3 failed, 1 passed: footer count starts at 52, not 16 (wide, narrow) and the 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 test at e70b80df2: Test Files 509 passed, 1 skipped (510); Tests 4958 passed, 24 skipped.
  • Summary-row consumers (plugin-grid footer suites, plugin-detail body-table suites, ListView.test.tsx, app-shell recordCountFooter-10636), 9 files at e70b80df2: 9 passed, 330 tests passed.
  • pnpm --filter @object-ui/components type-check (after building its closure) at e70b80df2: exit 0. tsc -p tsconfig.e2e.json (ui): exit 0.
  • Derived gate families (dispatch-gates.mjs --commands, 38): 36 exit 0. check:test-source-alias was 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 in js-comment-mask-returns-interpolation-9424.test.ts (a tsc program build), run on a loaded shared box; no file in this diff is under ui/scripts/. The rerun under the lock was cut off by the foreground limit: NOT MEASURED here, CI runs it.

Acceptance notes

  • The checklist item records-forms.list-view-capabilities acceptance[11] already states the 16px promise for the footer count; nothing is re-pointed there (a separate card owns checklist re-points).
  • The browser check on the running showcase app is reported under Verification.
  • Visible side effect: the summary row's first cell is now wider by the selection column, so a first column whose own width came from the footer text (the count plus a picker) can come out up to about 24px narrower. In the showcase the first column's header and body text stay at 52, as before.

Verification

Browser check on the running showcase app (pnpm dev -- --fresh, Console from this branch's ui/ source through Vite, Chromium 1280x800, locale zh-CN), measured from record-list-host (left 256):

list footer count select-all row 1 checkbox page-bar tile selection column footer cell colspan
showcase_task 「10 条记录」 16 16 16 16 40 2
showcase_project 「5 条记录」 16 16 16 16 40 2

The issue measured the count at 52 on both before this change.


Generated by Claude Code

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>
@github-actions github-actions Bot added size/m 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 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Build & E2E UI is red at head 9a56330a0 (2026-11-24T20:46Z), check run 138762658032. This PR changes ui/e2e/list-left-edge-35663.spec.ts, which that job runs, so the failure is presumed this PR's until its log says otherwise. A fix round (log read, root cause, fix — no re-run as a remedy) goes back to the PR's dev at the zone's next free dev slot; the PR stays draft and out of the queue until then.

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Final green head for L1 (2026-11-24T21:20Z): 10040d56a51ca62ca2c646aaa7e22043e068b850.

  • Checks at this head: 58 check runs, every one success or skipped (Build & E2E UI and Test UI among them; Lint & Repo Gates, TypeScript Type Check, Lint UI, Type Check UI, Live E2E UI, Check Changeset, Governed Surface Queue Guard).
  • Size: 4 files, about +195 / −13; no governed path; over the zone's self-review threshold, so the L1 read goes to the seat's L1 thread.
  • The earlier red at 9a56330 (my comment 7144066525), resolved: Build & E2E UI failed at collection — the sibling spec ui/e2e/list-frame-geometry-35548.spec.ts:134 reads the summary cell's class string out of data-table.tsx by regex, and the new pl-4 arm sat between the two lines it expects; the arm now follows the align arms (under cn/twMerge the later pl-4 still overrides px-3). The sibling spec was not edited. Test UI at 9a56330 was 11 shards cancelled by the fix push's new run (per-PR concurrency group), not a test failure.
  • Points for L1: the lead cell spans the selection column (colSpan) with the leading cell's pl-4 inset, frozen at left 0 when columns are frozen; the first column's figure stays in its column; the left-edge spec now measures the real summary-row lead (16 on wide and narrow lists and after a sideways scroll), red on the base at 52; ui/scripts vitest family NOT MEASURED locally (CI's Test UI green here).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 10040d56a51ca62ca2c646aaa7e22043e068b850 · 2026-11-24T21:21Z

Requested by zone a4-C (7144817987) for card #37028.

  • Shape. 4 files (+187/−12): ui/packages/components/src/renderers/complex/data-table.tsx, a new unit test, the left-edge e2e spec, one changeset (@object-ui/components patch, Clause-②: no, Metadata-protocol: none). Not governed; no contract face.
  • Fix, read against the code. In the summary tfoot, when a leading (selection / row-number) cell is drawn, the row has a lead, there is a first column and it is not pinned right, the empty leading cell is dropped and the first column's cell spans it (colSpan = leadingCellCount + 1) with pl-4, so the record count starts 16px in like the select-all box; a frozen first column keeps left: 0, the leading cell's own place (both freeze together under frozenColumns > 0). The span ends at the first column's right edge, so a right-aligned first-column figure is unmoved. No lead, or no leading cell: unchanged.
  • Tests. The unit file pins the span, the inset, the lead and first figure in one cell, the column sum equal to the header's, the frozen left: 0, and the two unchanged arms (no leading cell; no lead); the e2e spec measures the edge. The two reds on the previous head (9a56330a0) are explained in the announcement: an inserted line moved a source position another spec reads by regex (moved back after the align arms, commented), and a cancelled Test UI run.
  • Gates. Check-runs at this head: all success or expected skip, 0 failed.
  • Landing K: 17 since the merge base — over the bound: merge main first (a merge-only move keeps this ACCEPT), then land when green.
  • No must-fix, no should-fix. The zone lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Landing (2026-11-24T21:45Z) — head 7aca70e0865a7417d2713c8f7e99f3413a4e4a36, on L1 ACCEPT 7144841084 (at 10040d56a) carried over a merge-only move: the relay's pr_update_branch merged main in, as that ACCEPT asked (K was 17).

Probe Reading
check-governed-merges.mjs --pr 37124 NOT governed — no path hits the register; under 3000 changed lines
Check-runs at this head 58, every one success or skipped (Build & E2E UI, Test UI, Lint & Repo Gates, TypeScript Type Check among them)
Landing K 0 after the base sync (the head's merge parent is the main tip the platform merged)

State change: ready for review + auto-merge armed; the merge queue lands it. On MERGED, #37028 closes by Fixes #37028 and its pm:dispatched comes off.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 21:46
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 517e415 Nov 24, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37028-footer-count-edge branch November 24, 2026 22:08
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
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 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.

List page footer: the record count sits at a 52px left edge; the page-bar promise puts every lead item on one 16px edge

2 participants