Repository navigation
fix(kanban): a windowed swimlane board counts each whole swimlane, and each whole column when it queries itself - #38234
Conversation
…d each whole column when it queries itself A board drawn in swimlanes over a window of its query asks one grouped read on the lane field and the swimlane field together. Each swimlane row's count, and on a board that queries itself each column's count, is the sum of its groups. A board holding every record asks nothing. Claude-Session: https://claude.ai/code/session_01L9qibwxBy3QieJMqJbJtTk Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibwxBy3QieJMqJbJtTk {
"issue": 37844,
"status": "done",
"branch": "claude/project-thread-aadedf",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38234",
"session": "session_01L9qibwxBy3QieJMqJbJtTk",
"premise_still_valid": true,
"summary": "Route A per claim 7236708287 (cells A1, scope item 2 yes). A swimlane board holding a window of its query (self-query fetch saturated its $top, or a handed page whose lane-read counts exceed the cards it holds) asks one queryGroupHeaders read with groupBy [laneField, swimlaneField] and COUNT(*), compiled by compileLaneReadQuery (same where/search) plus the second key. Folded with readLaneCounts by the swimlane key into a new package-internal swimlaneCounts prop (KanbanBoardCore pass-through, KanbanImpl swimlaneRowCount) and, on a self-querying board, by the lane key into its column counts. No door, refusal or a cut answer keep today's '+'. A board holding every record asks nothing. No new export, spec key or host prop; no new cell display. KanbanLaneStatistic.ts needed no change. Patch changeset @object-ui/plugin-kanban, Clause-② no, Metadata-protocol none.",
"tests": "Premise at f294277d (probe /mnt/project-files/card-37844/): self-query limit 10 columns 10+/0+, rows 5+/5+, no grouped read; handed page rows 3+/1+; cells draw cards only. Pins in ObjectKanban.swimlaneStatistic-37326.test.tsx (rig door now groups by every key and can cut): (c) handed page rows 12/12, lane read then one two-key read, no find; (d)/(f) controls holding every record ask no swimlane read; self-window limit 10 rows 12/12 columns 20/4 from one read; own filter rows 10/10 columns 18/2; controls no door/refused/cut keep 5+/5+ and 10+/0+; unfilled window asks nothing; handed page with cut lane read asks no swimlane read. Real backend (scratch, not in PR): RestServer POST /data/:object/query over ObjectQL+SqlDriver sqlite answered the exact two-key query 200 with open/null 2, open/north 10, open/south 10, won/north 2, won/south 2, hasMore false; where and search honoured; OS_DATA_DEFAULT_PAGE_SIZE=3 -> 3 groups, hasMore true. Ablations (ablation-replace.mjs, restored blob == HEAD): swimlaneCounts -> undefined 3 failed | 15 passed; laneCounts={boardLaneCounts} -> hostLaneCounts 2 failed | 16 passed. plugin-kanban type-check exit 0; plugin-kanban test 91 files / 621 tests; 19 off-disk reader files + app-shell kanban rig 642 tests; eslint 0 errors.",
"gates": "dispatch-gates --ran at c302aa27: 38 derived, 38 run, every one exit 0, 0 NOT MEASURED, 0 unrun (record /mnt/project-files/card-37844/gates-ran-c302aa27.txt). overlap-check before first push: clean vs origin/main and #38169. Local narrowing: app-shell full suite left to Test UI. PR CI: in progress at report time.",
"dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
"mcp_calls": "0 GitHub MCP writes (reads only)",
"api_writes": "2 — fleet-write relay pr_create (POST pulls + assignees leg, read-back 7774 bytes identical, assignee os-tesla); this os-dev-report comment via post-stamped",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": []
} |
Claude-Session: https://claude.ai/code/session_01L9qibwxBy3QieJMqJbJtTk Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a ACCEPT at head Face. No Against claim 7236708287.
Evidence (report 7237186331).
Changeset Checks at this head: 13 skipped · 39 success · 0 pending; floor checks (Lint & Repo Gates, TypeScript Type Check) green. Nit, not blocking (N1). A record whose swimlane value is a stored empty string draws in its own |
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T10:07Z · zone
|
Requested by Tesla · project thread
Fixes #37844
repo:objectstack#3 · os-tesla · session_01L9qibwxBy3QieJMqJbJtTk
Clause-②: no
Metadata-protocol: none
维护者速读
limit读满一窗),每条泳道的计数只是已加载卡片数,带+;看板自己读数时连列计数也是这样。现在发一次「列字段 × 泳道字段」两键分组读,泳道计数(自查询看板还有列计数)都显示整数。+。不改数据和配置,可以直接撤回。What changes
ui/packages/plugin-kanban/src/ObjectKanban.tsx: the swimlane read. On a board drawn in swimlanes (swimlaneField, orgrouping.fields[0]) that holds a window of its query, onequeryGroupHeadersread withgroupBy: [laneField, swimlaneField]andCOUNT(*), compiled by the existingcompileLaneReadQuery(samewhere,search,searchFieldsas the lane read), plus the second key. "Holds a window": a board that queries itself whose fetch filled its$top(countsAreWindowed), or a board handed one page (hostLaneRead) once the lane read's counts add up to more records than the board holds. The answer is folded twice withreadLaneCounts: by the swimlane key intoswimlaneCounts(the no-value group under''), and by the lane key into the column counts of a board that queries itself (a board handed a page keeps the lane read's). A cut or refused answer folds tonull.ui/packages/plugin-kanban/src/KanbanImpl.tsx: aswimlaneCountsprop. A swimlane row writes its whole count from it (swimlaneRowCount, read the waywholeLaneCountreads a column), and falls back to today's cards-plus-+(swimlaneCountIsWhole) where it gives none. The no-value row reads the''group; a row keyed''(a stored empty text) shares that group and keeps the fallback.ui/packages/plugin-kanban/src/KanbanBoardCore.tsx: passesswimlaneCountsthrough, a package-internal prop likelaneCounts.patchchangeset for@object-ui/plugin-kanban.No new export, spec key or host prop. Cells draw no new figure (claim: A1).
Tests
ui/packages/plugin-kanban/src/ObjectKanban.swimlaneStatistic-37326.test.tsx(24 deals: open 20, won 4; north 12, south 12). The rig's grouped door now groups by everygroupBykey and can cut its answer.12and12, not3+and1+; the reads are the lane read, then one{ groupBy: ['stage', 'region'], aggregations: [{ function: 'count', alias: 'count' }] }; nofind.limit: 10: rows12/12and columns20/4from one two-key read, onefind; under the board's own filter (amount >= 2) rows10/10, columns18/2; CONTROL no door / refused / cut keep5+/5+and10+/0+; CONTROL a window the query does not fill (limit: 50) asks nothing; CONTROL a handed page whose lane read is cut asks no swimlane read and keeps3+/1+.Readings (head c302aa2, base origin/main f294277)
/mnt/project-files/card-37844/, not in this PR): a board that queries itself throughlimit: 10wrote columns10+/0+, rows5+/5+, and asked no grouped read; a handed page wrote columns20/4and rows3+/1+from one read grouped bystagealone; cells draw cards only./mnt/project-files/card-37844/real-backend-two-key-probe.test.ts):RestServer'sPOST /api/v1/data/:object/queryoverObjectQL+SqlDriver(better-sqlite3), 26 deals, the query exactly as the board compiles it.200,records: [open/null 2, open/north 10, open/south 10, won/north 2, won/south 2],hasMore: false. Withwhere: { amount: { $gte: 2 } }: open/null 2, open/north 9, open/south 9, won/north 1, won/south 1. Withsearch: 'won': won/north 2, won/south 2. WithOS_DATA_DEFAULT_PAGE_SIZE=3: 3 groups andhasMore: true, which the board reads as no counts. Folded as the board folds it: columns open 22, won 4; rows no-value 2, north 12, south 12.scripts/ablation-replace.mjs, each restored to blob == HEAD withgit diff HEADempty:swimlaneCounts={swimlaneCounts}→swimlaneCounts={undefined}:Tests 3 failed | 15 passed (18), (c) and the two self-window pins;laneCounts={boardLaneCounts}→laneCounts={hostLaneCounts}:Tests 2 failed | 16 passed (18), the two self-window column pins.pnpm --filter @object-ui/plugin-kanban type-checkexit 0;pnpm --filter @object-ui/plugin-kanban test:Test Files 91 passed (91),Tests 621 passed (621); every test file outside the package that readsObjectKanban.tsx,KanbanImpl.tsx,KanbanBoardCore.tsxorKanbanLaneStatistic.tsoff disk, plus the app-shell kanban rig:Test Files 19 passed (19),Tests 642 passed (642).overlap-checkbefore the first push: clean against origin/main and feat(spec,ui): an object declares when a whole record is read-only by hand (object-level uiReadonlyWhen) #38169 (sharesObjectKanban.tsx).Acceptance notes
KanbanLaneStatistic.tswas in the claimed surface and needed no change:compileLaneReadQuerybuilds the query, and the second key is added beside it.@object-ui/app-shell's full suite is left toTest UI.dispatch-gates --ranreconciles 38 derived, 38 run, every one exit 0, 0 NOT MEASURED, 0 unrun.Verification
Read first (by risk):
ui/packages/plugin-kanban/src/ObjectKanban.tsx:hostWindowed/selfWindowed,swimlaneQuestionandboardLaneCounts, besideheaderTotals.ui/packages/plugin-kanban/src/KanbanImpl.tsx:swimlaneRowCountand the swimlane header.ObjectKanban.swimlaneStatistic-37326.test.tsx.Two-minute check: from
ui/,pnpm exec vitest run packages/plugin-kanban/src/ObjectKanban.swimlaneStatistic-37326.test.tsxshows 18 passing; setswimlaneCounts={undefined}inObjectKanban.tsxand (c) and the self-window pins fail.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibwxBy3QieJMqJbJtTk