Skip to content

fix(kanban): a windowed swimlane board counts each whole swimlane, and each whole column when it queries itself - #38234

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-aadedf
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-aadedf

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #37844
repo:objectstack#3 · os-tesla · session_01L9qibwxBy3QieJMqJbJtTk

Clause-②: no
Metadata-protocol: none

维护者速读

What changes

  • ui/packages/plugin-kanban/src/ObjectKanban.tsx: the swimlane read. On a board drawn in swimlanes (swimlaneField, or grouping.fields[0]) that holds a window of its query, one queryGroupHeaders read with groupBy: [laneField, swimlaneField] and COUNT(*), compiled by the existing compileLaneReadQuery (same where, search, searchFields as 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 with readLaneCounts: by the swimlane key into swimlaneCounts (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 to null.
  • ui/packages/plugin-kanban/src/KanbanImpl.tsx: a swimlaneCounts prop. A swimlane row writes its whole count from it (swimlaneRowCount, read the way wholeLaneCount reads 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: passes swimlaneCounts through, a package-internal prop like laneCounts.
  • patch changeset 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 every groupBy key and can cut its answer.

  • (c) a page handed in (3 north, 1 south on the page): the rows read 12 and 12, not 3+ and 1+; the reads are the lane read, then one { groupBy: ['stage', 'region'], aggregations: [{ function: 'count', alias: 'count' }] }; no find.
  • (d) CONTROL, the page holds every record: bare counts, one read (the lane read), no swimlane read.
  • (f) CONTROL, a board that queries itself and holds every record: no grouped read at all.
  • New describe, a board that queries itself through limit: 10: rows 12/12 and columns 20/4 from one two-key read, one find; under the board's own filter (amount >= 2) rows 10/10, columns 18/2; CONTROL no door / refused / cut keep 5+/5+ and 10+/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 keeps 3+/1+.
Readings (head c302aa2, base origin/main f294277)
  • Premise at f294277 (probe on the Kanban in swimlanes draws no lane-foot statistic, though the view settings offer one #37326 rig, kept in the project at /mnt/project-files/card-37844/, not in this PR): a board that queries itself through limit: 10 wrote columns 10+/0+, rows 5+/5+, and asked no grouped read; a handed page wrote columns 20/4 and rows 3+/1+ from one read grouped by stage alone; cells draw cards only.
  • Real backend (scratch test, not in this PR, kept at /mnt/project-files/card-37844/real-backend-two-key-probe.test.ts): RestServer's POST /api/v1/data/:object/query over ObjectQL + 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. With where: { amount: { $gte: 2 } }: open/null 2, open/north 9, open/south 9, won/north 1, won/south 1. With search: 'won': won/north 2, won/south 2. With OS_DATA_DEFAULT_PAGE_SIZE=3: 3 groups and hasMore: 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.
  • Ablations on the committed fix through scripts/ablation-replace.mjs, each restored to blob == HEAD with git diff HEAD empty:
    • 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-check exit 0; pnpm --filter @object-ui/plugin-kanban test: Test Files 91 passed (91), Tests 621 passed (621); every test file outside the package that reads ObjectKanban.tsx, KanbanImpl.tsx, KanbanBoardCore.tsx or KanbanLaneStatistic.ts off disk, plus the app-shell kanban rig: Test Files 19 passed (19), Tests 642 passed (642).
  • eslint on the four changed source and test files: 0 errors.
  • overlap-check before 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 (shares ObjectKanban.tsx).
  • Derived local gates: see Acceptance notes.

Acceptance notes

Verification

Read first (by risk):

  1. ui/packages/plugin-kanban/src/ObjectKanban.tsx: hostWindowed / selfWindowed, swimlaneQuestion and boardLaneCounts, beside headerTotals.
  2. ui/packages/plugin-kanban/src/KanbanImpl.tsx: swimlaneRowCount and the swimlane header.
  3. The new pins in ObjectKanban.swimlaneStatistic-37326.test.tsx.

Two-minute check: from ui/, pnpm exec vitest run packages/plugin-kanban/src/ObjectKanban.swimlaneStatistic-37326.test.tsx shows 18 passing; set swimlaneCounts={undefined} in ObjectKanban.tsx and (c) and the self-window pins fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibwxBy3QieJMqJbJtTk

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwxBy3QieJMqJbJtTk
os-dev-report

{
  "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": []
}

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T10:05Z

L1-a ACCEPT at head 206c5317a178bc4f212c36105093131adff6e1a9, which merges main bd5407e into c302aa2. The merge is mechanical: git diff <main parent> 206c5317 | git patch-id --stable gives 47571a74, the same as the c302aa2 diff against its base f294277. Five files, +261/−29, all in ui/packages/plugin-kanban plus one changeset.

Face. No packages/spec/src/**, no governed rules and no narrowing; Clause-②: no, Metadata-protocol: none. L1 only, no L2 owed.

Against claim 7236708287.

  • Route A. There is one queryGroupHeaders read with groupBy: [schema.groupBy, swimlaneField], built from compileLaneReadQuery (the same filter and $search/$searchFields as the lane read) plus the second key.
  • When it is asked. Only on a swimlane board whose swimlane field differs from the lane field, and only when the board holds a window of its query. That is either a self-queried, saturated window (boardQueriesItself && countsAreWindowed) or a handed page whose lane-read counts sum past boardData.length. A board that holds every record asks nothing, as controls (d), (f) and the unfilled-window control pin.
  • Fallbacks. No door, a refusal, or a cut answer returns null, because readLaneStatistic returns null on hasMore. The rows then keep +, and the no-door, refused and cut controls pin 5+/5+ and 10+/0+. A cut lane read on a handed page asks no swimlane read, which its own control pins.
  • Folding. The answer is folded twice with readLaneCounts: once by the lane key (the same laneIds/foldCase/KANBAN_UNCOLUMNED_ID reading as the lane read) for the columns, and once by the swimlane key through laneKeyOf for the rows. On the swimlane side that matches swimlaneKeyOf, with the no-value row reading the '' group. A row the read names no group for gets wholeLaneCount's 0 or floor.
  • Columns (scope item 2). On a self-queried windowed board, the columns take their counts from the same read through boardLaneCounts. On a handed page they still read the lane read (hostLaneCounts), as before.
  • Stale answers. The answer is held only while its question matches, and it is re-asked on refreshKey, invalidationNonce and hostReloadKey. This is the lane read's pattern.
  • Cells. A1 is kept: no new cell display and no new i18n keys. swimlaneCounts is a package-internal prop. Nothing is exported, no spec key is added and no host prop is added.
  • Deviation accepted. KanbanLaneStatistic.ts is named in the claim but left untouched. The second key sits beside compileLaneReadQuery's output, so the file surface only narrowed.

Evidence (report 7237186331).

  • A real backend answered the exact two-key query. RestServer POST /data/:object/query over ObjectQL and SqlDriver (better-sqlite3) returned 200 with five groups and hasMore: false, and the filter and search were honoured. With OS_DATA_DEFAULT_PAGE_SIZE=3 it returned three groups and hasMore: true, which is the cut path the board reads as no counts.
  • Two ablations went red and were restored. swimlaneCounts→undefined failed 3; boardLaneCounts→hostLaneCounts failed 2.
  • plugin-kanban: 91 files / 621 tests.
  • dispatch-gates: 38/38 exit 0 at c302aa2.

Changeset .changeset/37844-kanban-swimlane-whole-counts.md, read sentence by sentence: every sentence matches the code, as do the patch bump and both declaration lines. Fixes #37844 is right: this is the chain's last link, and the claim scoped the whole card.

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 '' row, which reads no count, as swimlaneRowCount intends. But its group is folded by laneKeyOf into the same '' key as the null group. The "Uncategorized" row therefore reads count(null)+count(''), unmarked. This only bites on data that keeps '' beside null, so it can go to a follow-up card if the seat wants one.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T10:07Z · zone o3-ux (seat card thread, kanban chain last link)
Head-sha: 206c5317a178bc4f212c36105093131adff6e1a9

  • L1 ACCEPT 7237675177 at this head (L1-a). L1 only: Clause-② no, Metadata-protocol none, no L2 owed. The main merge is mechanical: patch-id 47571a74 at both c302aa2 and 206c531.
  • Built as claimed (7236708287): route A (one two-key grouped read), A1 (no new cell display), column counts read whole on the self-queried window; every fallback (no door, refused, truncated, already whole) stays +. Real-backend reading (RestServer + ObjectQL + SqlDriver) and two ablations in report 7237186331.
  • Accepted deviation: KanbanLaneStatistic.ts named in the claim is not touched (the surface only got smaller).
  • Accepted nit N1 (L1-a): a stored '' lane value folds into the same group as null, so the Uncategorized row reads count(null) + count(''), unmarked. The seat files it if wanted.
  • check-governed-merges.mjs --pr 38234: NOT governed, +261 / −29.
  • K: 4 < 15, counted by hand.
  • Checks at this head: 39 success, 13 skipped, 0 failed. mergeable_state clean.
  • Action: ready for review and auto-merge (queue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kanban swimlanes: row counts and per-cell figures are page floors on a windowed board; read them whole with one grouped query

2 participants