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 517e415
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ui): the list footer's record count starts on the 16px left edge (#37124)
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
#35663, and the first column's figure keeps ending at its column's right
edge (#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](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
fix(ui): the list footer's record count starts on the list page's one left edge
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
- The summary row at the foot of a list table led with its record count inside the first column's cell, after the 40px selection cell, so the count sat 52px in while the page bar's icon, the select-all box and every row checkbox sit 16px in. Where the table draws a selection or row-number cell, the summary row's first cell now spans that cell and starts at its 16px inset, so the count lines up with the select-all box, on a list that fits and on one that scrolls sideways (the cell stays frozen with the selection column). The first column's own figure still ends at its column's right edge.
@@ -496,6 +531,12 @@ test.describe('the list page draws one left edge (objectstack#35663)', () => {
496
531
expect(r.selection.left).toBeCloseTo(0,0);
497
532
// The first column's header label and its cells start on one line.
498
533
expect(Math.abs(r.left.firstHeaderText-r.left.firstCellText),`header text ${r.left.firstHeaderText} vs cell text ${r.left.firstCellText}`).toBeLessThanOrEqual(1);
534
+
// objectstack#37028 / #35548: the count on the edge, and the first
535
+
// column's figure still inside its column, clear of the count.
536
+
constf=r.firstFigure;
537
+
expect(f.left,`the first column's figure starts at ${f.left}, left of its column (${f.columnLeft})`).toBeGreaterThanOrEqual(f.columnLeft-0.5);
538
+
expect(f.right,`the first column's figure ends at ${f.right}, right of its column (${f.columnRight})`).toBeLessThanOrEqual(f.columnRight+0.5);
539
+
expect(f.left,`the first column's figure (${f.left}) overlaps the count (ends ${f.leadRight})`).toBeGreaterThanOrEqual(f.leadRight);
499
540
// No row numbers; every row's checkbox shows without a hover.
500
541
expect(r.rowNumbers,'the grid draws row numbers').toBe(0);
501
542
expect(r.rowCheckboxOpacity.length).toBe(12);
@@ -523,6 +564,10 @@ test.describe('the list page draws one left edge (objectstack#35663)', () => {
0 commit comments