Repository navigation
Commit 598a34d
fix(list): one 16px left edge on the list page, a 40px selection column at any width, no row numbers (#35706)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgEV9LRY8FfTWS7J6T3MwsSL)_
Fixes #35663
repo:objectstack#5 · os-bill · session_01Utp6Cb8qTxAVaE2QKwquQU
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:列表页左边对齐成一条线:页面栏图标、视图栏图标、表头和每行的勾选框、页脚条数都离左边
16;勾选列在列多要横向滚动时不再被挤到贴边,宽度始终一样;表格不再显示行号,勾选框不用悬停就看得见。
- 为什么做:属于列表页重做这一大项,解决维护者指出的「左侧一列没有对齐、左边距太小」和「行号没必要、勾选框应始终显示」。
-
出错会怎样:只改列表和各处表格的左侧排版与行号显示,不动数据和权限;关联列表、设计器里的表格也一并不再显示行号;「选项」里的行号开关和「已个性化」里的行号一项一起去掉;有问题可以直接撤回。
- 要你做什么:无
## What changes
- **The selection column is 40px at any width** (`data-table.tsx`,
`LEADING_CELL_WIDTH`). Every cell of the leading column (header, rows,
summary row, the row-number-only cell) carries `w-[1%] min-w-10` instead
of `w-10`. Under the table's automatic layout a plain `w-10` let the
column shrink to its content once the columns overflowed (16px, the
checkbox flush against the page), and on a table narrower than its box
it took a share of the spare width (93.9px measured). `min-w-10` holds
the floor; the 1% width makes it a percentage column, which auto layout
sizes to its minimum and does not widen while a fixed or auto column can
take the spare width (the same `1%` the `fitContent` columns use).
- **The checkbox sits 16px in** (`LEADING_CELL_INSET = 'pl-4 pr-2'`): 16
+ 16 box + 8 gap = 40.
- **The checkbox is shown at rest.** The hover swap (`opacity-0` until
hover / focus / coarse pointer / any selection) now applies only when a
host opts into row numbers; without them every row's checkbox is
visible.
- **`ObjectGrid` draws no row numbers unless its host asks**
(`hostShowRowNumbers ?? false`, was `?? true`). Hosts whose grids lose
their numbers with this: the related lists (`plugin-detail`
`RelatedList`), the designers' grids (`plugin-designer` `ObjectManager`,
`FieldDesigner`), `plugin-view`'s `ObjectView` grid and any page block
of type `object-grid`. None is kept on as an opt-in: after this PR no
host passes the prop. `data-table`'s `showRowNumbers` stays as an opt-in
for other hosts (it is a declared `DataTableSchema` key in
`@object-ui/types`).
- **The view bar's ends** (`listToolbarRow.ts`, `TOOLBAR_ROW`): from
`sm` up, `pl-2.5 pr-2` instead of `px-4`. Every item in the bar is a
padded control, so the switcher's 6px-padded icon lands on 16, and the
last text trigger's 8px-padded label ends 16 in, where the page bar's
「新建」 ends. Below `sm` the row is unchanged.
- **The list page stops passing row numbers, and the 行号 switch goes**
(round 2, after #35646 merged). `ListView` drops its session-only
row-number state, the `defaultRowNumbers` host prop and the
`'rowNumbers'` personalization part; the console host's
`defaultRowNumbers={!inSetup}` line goes (`objectViewListRenderer.tsx`);
the switch leaves the Options menu's More level
(`ViewSettingsPopover.tsx`, which now draws More only for how records
open and Edit inline); the 「已个性化」 marker drops its entry
(`ListPersonalizedMarker.tsx`); `list.rowNumbers` and
`console.objectView.personalizedParts.rowNumbers` leave all 11 packs.
Premise correction recorded on the claim: no stored personal row-number
setting exists (it was session-only React state), so "刷新后也不显示" needs no
migration.
- **The docs sentence on the marker** (`content/docs/ui/views.mdx`,
claim amendment 3): it no longer lists row numbers among what the marker
names.
- **A column diagnostic that became false**
(`columnSpellingDiagnostics.ts`, claim amendment 2): a grid whose
authored columns all fail to resolve "renders NO data columns", no
longer "renders its row-number column and NO data columns".
## Tests
New:
- `ui/e2e/list-left-edge-35663.spec.ts` (Playwright). Real `ObjectGrid`
+ `data-table` + app-shell `PageHeader` (list posture), bundled by Vite
from source, the view bar from `listToolbarRow.ts`'s own constants, the
switcher's and the footer's classes read from their sources, real theme
Tailwind. Cases: 1280 wide list (overflows), 1280 narrow list (fits),
the wide list scrolled to the far right and back, and 375.
Migrated (the grid no longer has a `#` column by default):
- `plugin-grid`: `columnDeclaredSpellingOnly`,
`columnSpellingDiagnosticRender`, `columnSpellingDiagnostics`,
`gridColumnMembers-8071`, `gridDependentValues-7165`,
`lookupPickerKeys-7154`, `relationalMetaCopySet-7166` (header lists lose
`#`; data-cell indexes lose the +1), `rowColorTint-12375` (two sticky
cells, not three; the leading cell's tint stays pinned in
`data-table-row-tint-sticky-12375`), `rowHeightOffSpecBoundary` (opts
into `showRowNumbers` so the table-level cell copy stays observable on
the row-number cell), `serverSearch` (see Acceptance notes).
- `components`: `data-table-leadingCell-12423`, the "blank until hover"
case reversed to "shown at rest".
- `plugin-list` (the switch is gone): `ListView.displayPopover-12423`
(More carries Edit inline only; the "Row numbers is on by default" case
becomes "the list hands the grid no row numbers, and no level offers a
Row numbers switch"), `ListView.harness` (the displayMenuClose control
flips Edit inline instead), `ListView.restoreViewDefaults-28948`,
`ListView.toolbarIconButtons-12695`, `ListView.personalization-28950`
(each used the switch as "a Display setting outside the stored
preference"; now Edit inline, reported as `inlineEdit`),
`ViewSettingsPopover.optionsMenu-35551` (More is offered through Edit
inline), `ListViewBlock.compactRegion-12703` (the full list is "the grid
was mounted", no longer "with row numbers").
- `plugin-list`, also: `ListView.permissions` (with Edit inline withheld
and no drawer to choose, the menu now draws no More row at all; the two
withheld cases assert that, each beside its control that opens More and
finds the switch), `htmlTierColumnSpellings-6598` and
`htmlTierListViewDefaultColumns-6598` (the authored headers no longer
start with `#`).
- `app-shell`: `ObjectView.setupListChrome-12606`, the control becomes
"the same list under another app draws no `#` column either";
`rowClickModifierPayloadForward-9462` (RED 2 opts its grid into
`showRowNumbers`, since the hover "open record" button lives in the
row-number cell; red on CI at e5c9c4e).
Retired: `ListView.harness` › `ListView.setupChrome-12606` CONTROL
("without the prop the grid numbers its rows"); its prop is gone. The
describe keeps one case: no list hands the grid row numbers, and Display
still draws.
## Acceptance notes
docs/qa/platform-checklist items edited:
- **`records-forms.list-view-capabilities`** (rev 11 → 12): steps[11]
and an acceptance clause for the left edge, the 40px selection column
under a sideways scroll, no row numbers and the checkbox at rest, and
≥12 at 375. No earlier clause changed.
Readings (the e2e harness, main area 1024 wide beside a 256 sidebar at
1280; x from the main area's left):
| | page icon | view icon | select-all | row checkboxes | footer |
selection column | row numbers | checkbox at rest |
|---|---|---|---|---|---|---|---|---|
| main, wide (overflows) | 16 | 22 | 0 | 0 | 16 | 16 | 12 | opacity 0 |
| main, narrow (fits) | 16 | 22 | 38.9 | 38.9 | 16 | 93.9 | 12 | opacity
0 |
| this PR, wide | 16 | 16 | 16 | 16 | 16 | 40 | 0 | opacity 1 |
| this PR, narrow | 16 | 16 | 16 | 16 | 16 | 40 | 0 | opacity 1 |
- Scrolled to the far right and back: 40 / left 0 both legs (main: 16);
no gap between frozen cells (0). First column's header text and cell
text both at 52.
- Right edges: page bar 「新建」 box 16 in; view bar's last label 16 in
(main: 24).
- 375: page icon 16, view icon 14, card content 21, footer 16 (unchanged
from main; below 768 the grid draws cards).
- The main-branch readings reproduce the card's live readings (0 / 22 /
16 / 28 on the wide list).
Found on the way, not filed:
- `serverSearch.test.tsx` "reports the real match total" was green
because the second row's NUMBER put a "2" in the text; a one-page grid
draws no pager, so no total is on screen. Re-pointed to the rows on
screen. class: none (a test read, no product defect).
- A non-selectable grid with a row click drew a hover 「打开 ›」 button
inside its row-number cell (`data-table.tsx`, `row-expand-button`). With
row numbers off by default, that button is drawn only where a host opts
into row numbers; clicking the row still opens the record, and a
Cmd/Ctrl-click on the row still forwards its modifiers
(`rowClickModifierPayloadForward-9462` RED 1). carrier: none (follows
from the card's "no row numbers").
- The chart view's own view bar copy (`objectViewListRenderer.tsx` ~355,
`sm:px-4`) keeps the switcher icon at 22 there; it is outside this
card's surface. carrier: none.
Screenshots (before / after, 1280 wide, narrow, scrolled, 375):
`objectstack-seat5/area-ux/ux-4/list2/card-35663/` in the project files.
## Verification
Read first, by risk:
1. `ui/packages/components/src/renderers/complex/data-table.tsx`:
`LEADING_CELL_WIDTH` / `LEADING_CELL_INSET` on every leading cell, and
the visibility arm now gated on `showRowNumbers`.
2. `ui/packages/plugin-grid/src/ObjectGrid.tsx`: the `?? false` default.
3. `ui/packages/plugin-list/src/ListView.tsx` and
`components/ViewSettingsPopover.tsx`: the row-number state, prop and
part gone; `hasMore` without the switch.
4. `ui/packages/plugin-list/src/listToolbarRow.ts`: `TOOLBAR_ROW`'s
`sm:` padding.
Two-minute check: open any wide list (e.g. Contacts) at 1280 and scroll
it sideways; the checkbox column keeps its width, 16px from the left, in
line with the page bar icon. Open 「选项」 › 更多: no 行号 switch.
<details><summary>Local readings</summary>
- Geometry spec: 4 passed at this head. On `origin/main` sources: 3 of 4
red (wide, narrow, scroll), 375 green.
- Ablations (each through `scripts/ablation-replace.mjs`, restored to
the HEAD blob, `git diff HEAD` empty):
- `LEADING_CELL_WIDTH` → `'w-10'`: 3 red ("the selection column is 32
wide", "93.9 wide", "32 wide after scrolling").
- `TOOLBAR_ROW` `sm:pl-2.5 sm:pr-2` → `sm:px-4`: 2 red ("view-bar icon
starts at 22, not 16").
- `LEADING_CELL_INSET` → `'px-3'`: 3 red ("select-all box starts at 12,
not 16").
- visibility arm `showRowNumbers && !selectionActive` →
`!selectionActive`: 2 e2e red ("a row checkbox is hidden until hover")
and `data-table-leadingCell-12423` red (1 of 6).
- Vitest, round 1 (e5c9c4e): `components` complex renderers + the
selection tests, `plugin-grid`, `plugin-list`, `plugin-detail`,
`plugin-view`, `plugin-designer`, `GridField`,
`RecordPickerDialog.layout-11903`, app-shell `ObjectView*`,
`views/__tests__`, `rowTable-31856`, `RecordDetailView.topBar-27524`:
1213 files, 11183 passed, 18 skipped. CI at e5c9c4e then found one more
pin, `rowClickModifierPayloadForward-9462` (migrated above).
- Vitest, round 2 (after merging origin/main at 238661f): `plugin-list`
whole, app-shell `views/ObjectView*` + `views/__tests__`, `i18n`: 476
files, 5559 passed, 5 failed in 3 files, all migrated above
(`ListView.permissions`, both `htmlTier*-6598`); those 3 files plus
`rowClickModifierPayloadForward-9462`, `renderer-copy-locale-25916`,
`ObjectView.setupListChrome-12606` and
`ObjectView.listPersonalized-28950` re-ran green (7 files, 53 passed). A
wider local run (all of app-shell, console, plugin-detail, plugin-view)
did not finish inside the box's hour, so the full suite is CI's 16
shards at this head.
- Type-check: `components`, `plugin-grid` (round 1), `plugin-list`,
`app-shell`, `i18n` (round 2) `type-check` exit 0; `ui` `type-check:e2e`
exit 0 (round 1).
- i18n: `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys`
exit 0.
- Derived gates (`dispatch-gates.mjs --commands`): 74 derived at the
round-2 tree, 74 run, each exit 0; `--ran` reconciliation: 74 run, 0
NOT-MEASURED, 0 UNRUN.
- `overlap-check --branch=HEAD --pr=35643,35691,35708`: clean against
origin/main and each (shared files with #35708: the 11 locale packs,
merges cleanly).
</details>
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CXPqjy7g6EGFoAkYrr
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6Cb8qTxAVaE2QKwquQU -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a457b51 commit 598a34d
46 files changed
Lines changed: 767 additions & 237 deletions
File tree
- .changeset
- content/docs/ui
- docs/qa/platform-checklist/areas
- ui
- e2e
- packages
- app-shell/src
- __tests__
- views
- components/src/renderers/complex
- __tests__
- i18n/src/locales
- plugin-grid/src
- __tests__
- plugin-list/src
- __tests__
- components
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
| 618 | + | |
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
| 658 | + | |
| 659 | + | |
659 | 660 | | |
660 | 661 | | |
661 | 662 | | |
| |||
723 | 724 | | |
724 | 725 | | |
725 | 726 | | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
726 | 733 | | |
727 | 734 | | |
728 | 735 | | |
| |||
812 | 819 | | |
813 | 820 | | |
814 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
815 | 828 | | |
816 | 829 | | |
817 | 830 | | |
| |||
0 commit comments