Repository navigation
Commit 6210a08
fix(kanban): a list view board laned by a lookup shows each lane's whole sum, avg, min and max, not one page's (#37295)
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes #36871
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:列表里的看板,泳道按查找字段决定时,泳道底部的合计、平均、最小、最大值现在按整条泳道的全部记录计算,不再只加当前这一页;平均、最小、最大也不再空白。
- 为什么做:看板泳道统计这一族的收尾(上一张卡已让看板自己查询时按整条泳道计算),这里补上列表把一页数据交给看板的那条路径。
- 出错会怎样:最坏是泳道底部不显示统计数字,不会显示错误的数字;卡片、泳道和计数不受影响,可直接撤回。
- 要你做什么:无
## What changes
Route **(A)**, the preferred one: on ListView's rows-handed kanban path
the board now queries its lane figures over the whole lane, through the
same `queryGroupHeaders` + `readLaneStatistic` read a self-querying
board uses (a cut answer, a refused read or a source without the door
draws no figure). That fixes `sum`, `avg`, `min` and `max` at once, so
no "loaded only" marker and no new locale string is needed, and the
view-settings picker stays as it is.
- `@object-ui/plugin-list` (`ListView.tsx`): new
`kanbanLaneStatisticHosted` = kanban view, not lane-paged, and this list
fetches for itself (not inline rows, not a `value` provider). For that
board the node's `filter` is the effective filter the list's own window
was fetched with (`selfQueryFilter`, the same value the lane-paged board
gets), and a new host prop `laneStatisticQuery` carries the toolbar
search term and fields and a reload key built from `refreshKey`,
`refreshTrigger` and the invalidation nonce.
- `@object-ui/plugin-kanban`: `ObjectKanban` takes `laneStatisticQuery`
(type `KanbanLaneStatisticRequest`, in `KanbanLaneStatistic.ts`). With
handed cards and that prop, `laneReadAsked` is true and the board asks
the lane read under the node filter and the host's search pair, and asks
again when the reload key moves. Without the prop nothing changes: cards
handed in whole still get a `sum` added up over them, and no other
figure.
- Docblocks updated: `LaneFootStatistic` (`KanbanImpl.tsx`),
`KanbanColumnSummary.figures`, the `KanbanLaneStatistic.ts` module
header.
- `@objectstack/spec`: the `KanbanConfig.summary` describe
(`packages/spec/src/ui/view.zod.ts`) and the `KanbanLaneSummarySchema`
docblock drop the "known gap" sentence and say what that board draws.
The generated mirror `content/docs/references/ui/view.mdx` carries the
same text (`check:generated` and `check:docs` green). The describe lives
in `@objectstack/spec`, not `@object-ui/types` as the claim's file
surface put it: same text, different package.
- `.changeset/36871-kanban-rows-handed-lane-statistic.md`: new (patch:
plugin-kanban, plugin-list, spec). One sentence in it supersedes the
"known gap" line of #36857's still-pending note
(`.changeset/36520-kanban-lane-statistic-server.md`, left byte-identical
to `main`) for the lookup-lane list view board.
### What widens (Clause-② yes)
- `ObjectKanbanComponentProps`, exported by `@object-ui/plugin-kanban`,
gains the optional `laneStatisticQuery?: KanbanLaneStatisticRequest`.
`KanbanLaneStatisticRequest` itself is not exported from the package
index. No other exported member changed: the spec edit is describe text
only, and ListView's exported props are unchanged.
Overlap: `overlap-check` (no exclusions) is clean at head 790a943,
and `origin/main` merges cleanly.
## Tests
<details><summary>Pins added (3 files) and the ablation</summary>
-
`ui/packages/app-shell/src/__tests__/listKanbanEveryRecord-12619.test.tsx`:
new top-level describe. The real board runs under the real ListView with
a lookup lane field (`account` references `crm_account`, no options), 60
deals alternating over two accounts, and `pagination.pageSize: 25`. A
rig self-check asserts 25 cards (13 / 12) are drawn. Then `sum`, `avg`,
`min` and `max` read 870/900, 29/30, 0/1 and 58/59: the whole lanes,
never the page's 156/144 or 24/23. The read runs under the view's filter
(850/875). CONTROL: a source with no grouped door draws no figure, never
the page's sum.
-
`ui/packages/plugin-kanban/src/ObjectKanban.laneStatistic-36370.test.tsx`:
a board handed 3 cards plus `laneStatisticQuery` draws the whole lane's
`sum`, `avg`, `min` and `max` (2415 / 34.5 / 0 / 69) and calls no
`find`. The read carries the node filter and the host's search pair, and
it is asked again when `reloadKey` moves. The existing "adds the cards a
host hands in" test is the control for cards handed in without their
query.
-
`ui/packages/plugin-list/src/__tests__/ListView.kanbanOwnsLanes-12619.test.tsx`:
the rows-handed board gets `data`, `laneStatisticQuery` and, as
`filter`, exactly the `$filter` of the list's own query. The swimlane
board gets the request too. CONTROLS: the lane-paged board does not get
it, and neither does a board over `value`-provider rows.
- Ablation, committed first and then run with `node
scripts/ablation-replace.mjs` on `ObjectKanban.tsx`: `const
laneReadAsked = boardQueriesItself || hostHandsQuery;` became `... ||
(hostHandsQuery && false);`. Anchor count went 1 to 0, blob
`908a872bc29b` to `396418ba8a82`. Result: **11 failed / 25 passed**.
That is every new 36871 pin in both suites, the no-door CONTROL
included, because the page's sum came back. The red is the defect
itself: `expected '156' to be '870'`, `expected '286' to be '850'`,
`expected '3' to be '2415'`. Restored: blob after restore equals HEAD
(`908a872bc29b`), and `git diff HEAD` is empty.
</details>
<details><summary>Suites and type-checks (head da9a59c; 790a943
changes only changeset text)</summary>
- `vitest run packages/plugin-kanban/ packages/plugin-list/` (ui root
config): Test Files 274 passed, Tests 2650 passed.
- The three touched test files alone: Test Files 3 passed, Tests 49
passed.
- `pnpm --filter @object-ui/plugin-kanban run type-check` and `...
plugin-list run type-check`: exit 0, both. Each covers
`tsconfig.test.json`.
- `@object-ui/app-shell` type-check: not run locally, left to CI (`Type
Check UI`).
</details>
## Acceptance notes
- **Swimlane board (a view with grouping).** The swimlane layout draws
no lane foot at all: `LaneFootStatistic` is rendered only in
`KanbanColumnView`, the flat layout. So the card's "grouped view" face
does not exist as a page-scoped sum. The board still offers every
statistic in the picker and then draws none. That is reported, not fixed
here.
- **Other faces of the same path, left alone.** On the rows-handed board
the lane header count and the foot `count` still count the page, with no
`+`. A lane whose records all fall past the first page is not drawn. A
`summarizeField` header total still sums the page. The list footer's
window warning is the only marker of the window. All of these are
reported, not fixed here.
- Cards handed in whole without a query (inline rows, or a host that is
not ListView) still draw `sum` only. That is correct for `sum`, and
`avg`/`min`/`max` stay blank there, as before.
## Verification
- Read first: `ObjectKanban.tsx` at `hostQuery` / `hostHandsQuery` /
`laneReadAsked` (the gate), `ListView.tsx` at
`kanbanLaneStatisticHosted` and the `laneStatisticQuery` spread, then
the app-shell describe.
- Two-minute check: `cd ui && pnpm exec vitest run
packages/app-shell/src/__tests__/listKanbanEveryRecord-12619.test.tsx`.
Expect 9 passed, and the 36871 describe shows `sum covers every record
of each lane over a window of one page`.
<details><summary>Derived gate families (local subset, head
da9a59c)</summary>
`dispatch-gates --commands` derived 117 commands. With `--ran`: 117
derived, 116 run, 1 NOT-MEASURED. Exit codes:
- 114 exited 0. `check-empty-changeset.mjs --base origin/main` exited 1
at da9a59c on the pending note's edit, which is now reverted.
- Re-run at head 790a943: `check-empty-changeset --base origin/main`,
`check-adr-0087-registration --base origin/main` and
`check-changeset-no-major --base origin/main` all exit 0.
- `pnpm --dir ui exec vitest run scripts/` exit 1, NOT MEASURED. Its
failures (absent eager-closure chunk, date-only-zone forks runs,
doc-snippet root bound) need a full ui build this box does not have, and
none names a file in this diff. Left to CI.
- `pnpm check:dual-build-cjs-loads` exit 3, NOT MEASURED: it needs a
full `pnpm build`.
- Re-run after the spec and closure build, all exit 0:
`check:doc-formula-expressions`, `check:doc-security-posture`,
`check:skill-examples`, `check:generated`, `check:docs`,
`check:dts-closure`. On the first pass these exited 3 or 1, against dist
still being built.
- `check:nul-bytes` exit 0.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 039b288 commit 6210a08
11 files changed
Lines changed: 393 additions & 34 deletions
File tree
- .changeset
- content/docs/references/ui
- packages/spec/src/ui
- ui/packages
- app-shell/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 | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| |||
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | | - | |
| 1046 | + | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| |||
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
1514 | | - | |
| 1514 | + | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2384 | 2384 | | |
2385 | 2385 | | |
2386 | 2386 | | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
2392 | | - | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
2393 | 2394 | | |
2394 | 2395 | | |
2395 | 2396 | | |
| |||
2515 | 2516 | | |
2516 | 2517 | | |
2517 | 2518 | | |
2518 | | - | |
2519 | | - | |
2520 | | - | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
2521 | 2523 | | |
2522 | 2524 | | |
2523 | 2525 | | |
| |||
0 commit comments