Repository navigation
Commit 755794f
feat(console): on a grouped list or a board, the record pane's counter and up/down step within the record's group or lane (#28492)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoUkJQrrXvVSkecCi4t5DBVd)_
Fixes #28461
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- **改了什么**:分组列表(如按客户分组的联系人列表)和看板里打开记录后,右侧记录面板现在有「1 / 3」计数和 ↓
↑,只在该记录所在的分组/看板列内切换,计数的提示写明分组名(「Acme Corporation 中第 1 条,共 3 条」)。
- **为什么改**:销售在分组列表或看板里看完一条记录,要关掉面板再点下一行;不分组的列表早就能用 ↓ ↑ / `j` `k`
连续翻看(#27524 Target 7 的遗留项)。
- **风险与回滚**:只加了三个可选的宿主回调(表格、看板、ListView
第二个参数),不传就与原来一致;不分组列表的行为与提示不变。回滚即 revert 本 PR。
-
**先看**:`ui/packages/plugin-grid/src/ObjectGrid.tsx`(分组上报:只报展开且当前页可见的分组)、`ui/packages/app-shell/src/views/objectViewRecordNavigation.ts`(按记录所在分组取兄弟集合与分组名)、`ui/packages/plugin-kanban/src/KanbanImpl.tsx`(看板列上报)。
- **两分钟验证**:HotCRM 打开按客户分组的联系人列表,点 Acme Corporation 下第一位联系人:面板顶栏显示「1 /
3」,悬停提示「Acme Corporation 中第 1 条,共 3 条」,按 ↓ 到同组第二位,同组最后一位的 ↓ 置灰。
- **需要你做的**:无,席位落地。
## What changes
- **`@object-ui/plugin-grid`** — `ObjectGrid` gains an optional host
prop `onRowGroupsChange(groups)`: on a grouped grid it reports every
open leaf group on the current page of groups, in display order, with
its heading (a nested group by its path of headings, joined by ` › `)
and the rows drawn under it (a server-grouped group's current page). A
collapsed group, or an open one with no rows yet, is left out. Reported
on a change of content (keys, headings, row ids), never of identity; an
ungrouped grid reports nothing. The band heading and the leaf rows are
read through one helper each (`groupHeadingOf`, `leafRowsOf`), so the
report and the bands cannot disagree. New type `ObjectGridRowGroup`.
- **`@object-ui/plugin-kanban`** — `ObjectKanban` gains the same
optional host prop, relayed to the board
(`KanbanBoardProps.onLaneRowsChange`): every open lane in board order
with its title and its cards in the order it draws them; on a swimlane
board, row by row down the open swimlanes. A collapsed lane is left out.
New type `KanbanLaneRows`, exported from the barrel.
- **`@object-ui/plugin-list`** — `ListView` hands the grouped grid and
the board that channel (only when a host passed `onRowsChange`) and
relays what they report: `onRowsChange(rows, groups)`, the rows end to
end and the groups as an optional second argument (`ListViewRowGroup`).
A report is held with the view kind that sent it and never relayed once
another kind is on screen. A paged ungrouped grid reports exactly as
before (no second argument).
- **`@object-ui/app-shell`** — the object page keeps the groups
(`listShownRowsOf`) and hands the pane's root the opened record's own
group as its sibling set, named by the group (`listSiblingSetOf`;
`RecordDrawerLevel.scope`). `RecordStackDrawer` names the root's set by
its `scope` before the list's view label; the record page opened from a
row (`from` state, or the ↗ way back) carries the same set and name, and
its counter names it. `ObjectView.tsx` and `record-top-bar.tsx` are
untouched: the tooltip key `detail.recordOfScope` already words Target 7
in all ten packs.
## Tests
- `plugin-grid/src/__tests__/rowGroupsReport-28461.test.tsx` — real
`ObjectGrid` grouping on the server: open groups in display order with
heading and rows; a group the reader collapses leaves the report;
control: an ungrouped grid reports nothing.
- `plugin-kanban/src/ObjectKanban.laneRowsReport-28461.test.tsx` — real
board: open lanes in order with their cards; the lost lane (collapsed by
its lifecycle kind) is left out until opened.
- `plugin-list/src/__tests__/ListView.rowGroups-28461.test.tsx` — the
relay: a grouped grid and a board each yield rows plus groups; control:
an ungrouped grid is not handed the channel and reports rows with no
groups.
- `app-shell/src/views/__tests__/recordPaneGroupScope-28461.test.tsx` —
the card's Tests: grouped grid counter and group-named tooltip, ↓ to the
next row of the same group, the last row of a group has no ↓, the first
row of a later group has no ↑; the board the same within a lane;
control: an ungrouped list keeps the whole list and the view's name; the
object page's root, and the ↗ page's stepper, carry the group's set and
name.
- `plugin-list/src/__tests__/ListView.onRowsChange-26679.test.tsx` — its
"no single row order" control moves from a board (which now reports its
lanes) to a calendar, which still reports no rows and no groups.
## Acceptance notes
- **Collapsed groups (the order left this open):** the reading the
reader sees — shown rows only. A collapsed group or lane draws no rows,
so it is not in the set; expanding it brings it back. A record opened by
URL inside a collapsed group gets no counter.
- **Server-grouped paging:** a server-grouped group steps through the
page of it on screen, not the group's whole count (the other pages are
not fetched); the counter says `n / rows on screen`. Paging whole groups
(the grouped pager) likewise scopes to the groups on the current page.
- **Swimlane boards:** a lane is the board column; its cards are ordered
row by row down the open swimlanes (the order the eye reads the column),
and a collapsed swimlane's cards are left out.
- **Nested grouping:** the scope name is the path of headings (`Acme
Corporation › Open`), because the leaf heading alone is ambiguous across
parents.
- **Neighbours:** `ObjectView.tsx` and `objectViewRecordNavigation.ts`
are shared with PR #28477 (#27058) — this PR does not touch
`ObjectView.tsx`, and edits only the row-set plumbing in
`objectViewRecordNavigation.ts`.
## Verification
Head `012ae4d6` on `claude/project-thread-4omx0a`, base `768ec4bf`.
<details><summary>New and moved tests — 7 files, 25 tests
passed</summary>
```
pnpm --dir ui exec vitest run (the four new files + ListView.onRowsChange-26679 + recordDrawerStack.rootStepper-26679 + objectViewRecordNavigation.listRows-27524)
Test Files 7 passed (7)
Tests 25 passed (25)
```
</details>
<details><summary>Ablations — each reds its test, each restored to
HEAD</summary>
```
ablation-replace ListView.tsx: shownRowGroups forced to null (the grouped report not relayed)
mutation landed: anchor 1 -> 0, blob 153dc09 -> f3f2576d12ce
× a grouped grid: the rows end to end, with the groups they sit in
× a board: the cards end to end, with the lanes they sit in
Tests 2 failed | 1 passed (3) (the ungrouped control stays green)
restored: blob == HEAD (153dc09), git diff HEAD empty
ablation-replace ObjectGrid.tsx: the open leaf group not pushed into the report
mutation landed: anchor 1 -> 0, blob 1fc257e -> 964ccdd1c912
× reports each open group in display order, with its heading and the rows it draws
× a group the reader collapses draws no rows and leaves the report
Tests 2 failed | 1 passed (3) (the ungrouped control stays green)
restored: blob == HEAD (1fc257e), git diff HEAD empty
```
Both subjects are imported from source (`../ListView`, `../ObjectGrid`),
so no dist rebuild sits between mutation and run.
</details>
<details><summary>Type-check — the four packages</summary>
```
pnpm --filter @object-ui/plugin-grid run type-check -> tsc --noEmit && tsc -p tsconfig.test.json · VERDICT command-exit 0
pnpm --filter @object-ui/plugin-kanban run type-check -> tsc --noEmit && tsc -p tsconfig.test.json · VERDICT command-exit 0
pnpm --filter @object-ui/plugin-list run type-check -> tsc --noEmit && tsc -p tsconfig.test.json · VERDICT command-exit 0
pnpm --filter @object-ui/app-shell run type-check -> tsc --noEmit && tsc -p tsconfig.test.json · VERDICT command-exit 0
```
</details>
<details><summary>Package suites — plugin-grid, plugin-kanban,
plugin-list, app-shell</summary>
```
pnpm --dir ui exec vitest run packages/plugin-grid/ packages/plugin-kanban/ packages/plugin-list/ + the 7 app-shell files that import recordDrawerStack / objectViewRecordNavigation / onRowsChange
Test Files 539 passed (539)
Tests 4653 passed (4653)
VERDICT command-exit 0
Declared narrowing: app-shell's whole suite (2,017 files) is left to CI's Test UI; locally its 7 files on the
pane / the list's row set ran (the 3 suites above run in full).
```
</details>
<details><summary>Derived gates (dispatch-gates --commands, reconciled
with --ran)</summary>
```
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
dispatch-gates --ran: 35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED
(type-check-debt re-measure: OK, 0 raw tsc errors above record; ui scripts/: 169 files passed, 2 skipped)
ui check:new-line-citations: 0 new citation(s) -> exit 0
```
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibvFWwhiepJS7DD4DXb)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2dbc774 commit 755794f
16 files changed
Lines changed: 947 additions & 47 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views
- __tests__
- plugin-grid/src
- __tests__
- plugin-kanban/src
- plugin-list/src
- __tests__
| 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 | + | |
| 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 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
46 | 93 | | |
47 | 94 | | |
48 | 95 | | |
| |||
143 | 190 | | |
144 | 191 | | |
145 | 192 | | |
146 | | - | |
| 193 | + | |
147 | 194 | | |
148 | 195 | | |
149 | 196 | | |
| |||
178 | 225 | | |
179 | 226 | | |
180 | 227 | | |
181 | | - | |
| 228 | + | |
182 | 229 | | |
183 | 230 | | |
184 | 231 | | |
| |||
189 | 236 | | |
190 | 237 | | |
191 | 238 | | |
192 | | - | |
| 239 | + | |
193 | 240 | | |
194 | 241 | | |
195 | 242 | | |
| |||
315 | 362 | | |
316 | 363 | | |
317 | 364 | | |
318 | | - | |
| 365 | + | |
319 | 366 | | |
320 | 367 | | |
321 | 368 | | |
322 | 369 | | |
323 | 370 | | |
324 | | - | |
| 371 | + | |
325 | 372 | | |
326 | 373 | | |
327 | 374 | | |
328 | 375 | | |
329 | 376 | | |
330 | 377 | | |
331 | | - | |
332 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
333 | 381 | | |
334 | 382 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
344 | 391 | | |
345 | 392 | | |
346 | 393 | | |
| |||
359 | 406 | | |
360 | 407 | | |
361 | 408 | | |
362 | | - | |
| 409 | + | |
363 | 410 | | |
364 | 411 | | |
365 | | - | |
| 412 | + | |
366 | 413 | | |
367 | 414 | | |
368 | 415 | | |
| |||
0 commit comments