Repository navigation
fix(plugin-kanban): a lane header over a windowed fetch says 77+, not 77 (objectui#8307) - #8780
Conversation
…ot `77` (objectui#8307) `object-kanban` fetches with a real `$top` (objectui#4025) and groups what came back into lanes client-side, so `col.cards.length` counts fetched rows that fell into this lane rather than the size of the group. Over any object holding more rows than the window every lane number is wrong and they sum to the window — measured at 77 / 19 / 2 against a true 88 / 46 / 28 / 14 / 9 / 15 on 200 records. The board has no group total and cannot compute one without a server-side group-count aggregate. What it can stop doing is claiming one. When the fetch comes back saturated — at least as many rows as the window allowed — every lane header renders `N+`, which is exactly what a count over a window establishes. A short fetch is the one case where the client knows the result set was exhausted, and there the bare number is kept; so is the bare number on rows handed to the board whole. `DEFAULT_KANBAN_LIMIT` is unchanged. All three headers (flat column, swimlane column-title row, swimlane lane row) go through one `laneCountLabel`, so the board cannot be honest in one layout and silently wrong in the other. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
CI red — diagnosed, this PR's, patch round dispatched
It is ours, and it is not a flakeobjectui#7322 pinned that literal source text. This PR extracts ⛔ Not re-run, and ⛔ not called a flake: the diff touches exactly the pinned line, so the single failing assertion is caused by this change. One test, named, reproducible. What the fix may and may not beThe pin's intent must survive: Preference order given to the dev: keep the pinned spelling inline if that costs nothing real; ⛔ not two spellings of one expression merely to appease a grep; otherwise update the pin to the new spelling with the reason stated. That file lives in
Everything else standsAll other 32 checks are green, and the seat review on objectui#8307 is already ACCEPT: the Generated by Claude Code |
… the window back from the query The saturation reading added for objectui#8307 had hoisted the row cap into a local (`const rowWindow = schema.limit ?? DEFAULT_KANBAN_LIMIT`), which left the behaviour identical but removed the literal source text `objectui#7322` pins off disk in `packages/types/src/__tests__/object-kanban-group-by-limit-7322.test.ts`. The query is now a named object with the cap spelled inline exactly as before, and the saturation comparison reads `query.$top` — the very number this request carried. That is one spelling, not two: a separate local kept only for the comparison could drift from the value on the wire, and a windowed-ness marker computed against a window the server was never asked for is precisely the silent wrongness objectui#8307 exists to remove. No behaviour change, and no pin weakened: `$top: schema.limit ?? DEFAULT_KANBAN_LIMIT` is back on disk verbatim, so the assertion still fails if the renderer ever stops reading `schema.limit` or stops defaulting to `DEFAULT_KANBAN_LIMIT`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
…ban-lane-count-honesty
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Fixes #8307
Ships option 2 exactly as triage ruled it (comment 5583024663): make the number say what it means, with no contract change.
DEFAULT_KANBAN_LIMITis untouched.Anchors, re-derived on today's tree (
c03d03b)Triage warned the card's anchors had drifted. One of triage's own has drifted again since
83d4fda16:ObjectKanban.tsx:264KanbanImpl.tsx:66383d4fda16:365✅:689c03d03bObjectKanban.tsx:365✅KanbanImpl.tsx:732Assumption 2 confirmed at both ends:
$top: schema.limit ?? DEFAULT_KANBAN_LIMITis a real top-level$topthat the adapters read, andcol.cardsis the post-grouping client array built bybucketCardsIntoColumnsfrom what came back.A third header site the card does not name.
KanbanImplpaints lane counts from three places, not one — the flat column header (KanbanColumnView,safeCards.length), and the swimlane layout's column-title row (col.cards.length, the card's anchor) and lane rows (laneCardCount, derived fromcol.cards). All three are the same defect. Fixing one would have left a board honest in one layout and silently wrong in the other, which is exactly the split objectui#8508 shipped.kanban-enhancedalso renders counts but is out of scope and correct as-is: it is a schema-only component that takesdatainline and issues no windowed fetch.Which half of option 2, and why — chosen by measurement
Option 2 offered two forms. The honest pair (
77 of 88) needs a per-lane total, and the measurement says nobody here has one:extractRecords(packages/core/src/utils/extract-records.ts:75) reads onlydata/valueand no count member; nothing on this path requests$count; and even a board-level total would not give per-lane totals. A per-lane total is a server-side group-count aggregate — the card's option 1, a different card size and a different Clause-② answer. Not attempted here, not silently escalated into.So: mark the lane as windowed. One helper,
laneCountLabel, called by all three headers:77+reads "at least 77", which is exactly what a count over a window establishes. No new copy string, so no i18n key and no locale-pack edit — consistent with this file's existing untranslated/ limitseparator.Assumption 3 — the off-by-one shape, measured and answered
The card suggested
rows.length === limit. Two changes:>=, not===. The predicate is saturation: the fetch asked for at mostwindowrows and gotnback.n >= windowmeans the response may be capped;nbelowwindowis the one case where the client knows the result set was exhausted, and there the bare number is the truth and is kept. A source that ignores$topand over-returns still yields a count this component can only treat as a lower bound, and>=is the predicate that cannot be talked into a false claim.The exactly-at-the-window board is resolved towards the true statement, deliberately. A board holding exactly
limitrows is indistinguishable from a truncated one from the client side — both answer a$top: Nquery with N rows. It therefore renders77+for a lane that really holds 77. That is the safe half of the ambiguity: "at least 77" is TRUE when the lane holds exactly 77, whereas the bare "77" is FALSE on every truncated board. The marker is conservative; it is never wrong. Pinned as its own row (BOUNDARY) so changing it means arguing the opposite in writing.The alternative heuristic (ask for
limit + 1, displaylimit) was rejected: it changes what reaches the wire, and$top === DEFAULT_KANBAN_LIMITis pinned by objectui#4025 inObjectKanban.elementDataSource.test.tsx:184.Saturation is captured as state at fetch time, not derived at render. The optimistic move/create/delete paths rewrite
fetchedData; a delete would otherwise drop the array towindow - 1and silently retract the marker from a board that is still showing a window.The signal applies only to rows this board fetched.
countsAreWindowed = fetchWindowSaturated && rawData === fetchedData— an identity comparison against the same precedence chainrawDatajust resolved, so the two cannot disagree. External, bound and inline data arrive whole from whoever owns them and keep the bare number.Evidence — rendered output, plus ablation
packages/plugin-kanban/src/__tests__/laneCountHonesty-8307.test.tsxreads the text of the header count node after a realfindresolves, anchored onKanbanColumnView's ownid. Whole-boardtextContentwould not do:'3'is a substring of'3+', so a bare-number assertion written that way can never fail.WINDOWED3+/1+; non-vacuity: the request really carried$topUNSATURATED(control)3/0BOUNDARY3+, and the lane really does hold 3INLINE(control)datakeeps bare3, andfindwas never calledSWIMLANESAblation.
laneCountLabelreverted toreturn String(count)— the shipped defect — on disk, proven by hash and by grep in both directions before the run, restored viagit checkout HEAD -- PATHunder anEXIT INT TERMtrap and re-verified against the HEAD blob hash:Three marker rows red, both negative controls still green — which is the right shape: the ablation makes every count bare, and bare is what the controls expect. The swimlane failure printed the shipped defect verbatim:
Screen(3)Offer(1)andinbound(2)/referral(2), all bare.Gates run locally, exit codes as printed
Derived by hand from
package.jsonscripts plus.github/workflows/{ci,lint,performance-budget,changeset-presence,changeset-guard,control-bytes}.yml— objectui has noscripts/pm/dispatch-gates.mjsand no verify lock.turbo run build --filter '@object-ui/plugin-kanban^...'(12 pkgs)turbo run build --filter='!@object-ui/site'(43 tasks, for the dist-reading gates)pnpm --filter @object-ui/plugin-kanban test(36 files, 237 tests)pnpm --filter @object-ui/plugin-kanban type-checkturbo run lint— whole repo, 47/47 tasks, 0 errorscheck:control-bytes·check:handler-key-reads·check:element-data-source-declarationcheck:side-effects-array·check:i18n-keys·check:spec-symbolscheck:unreferenced-sources·check:doc-example-readerscheck:phantom-deps·check:unused-depscheck:vi-mock-specifiers·check:vi-mock-inheritcheck:readme-exports·check:dist-completeness·check:esm-specifierscheck:sdui-registration-pins(after the console build)check:eager-closure·lint:coverage·type-check:coverage·check:lint-rule-coveragecheck-changeset-presence·check-changeset-fixed·check-changeset-no-majorcheck-governed-queue-guard --test(the five paths)check:readme-exportsandcheck:sdui-registration-pinsfirst returned prerequisite-not-met, not red — "type entry not on disk, runpnpm buildfirst" and "no console build to weigh". Both were re-run after the full build and are the 0s above. Type-check likewise reported phantomTS2307s until the dependency closure was built.Changeset
.changeset/8307-kanban-lane-count-honesty.md,@object-ui/plugin-kanban: patch. Owed and checked, not assumed:check-changeset-presence.mjsreports "3 source file(s) of 1 released package(s) changed" — the package publishesdistand the change moves rendered output.Patch round — objectui#7322's spelling pin, kept rather than moved
CI went red on one test,
packages/types/src/__tests__/object-kanban-group-by-limit-7322.test.ts:221— ours, not a flake. Reproduced locally one33d6ffbefore touching anything: 1 failed / 28 passed, identical assertion.objectui#7322 pins that literal source text in
READ_TEXT.limit. The first cut of the saturation reading hoisted the cap intoconst rowWindow = schema.limit ?? DEFAULT_KANBAN_LIMITand passed$top: rowWindow: behaviour identical, pinned spelling gone.Siblings, measured not assumed.
git grep -Fon the literal finds nine occurrences. Exactly one is executable — theREAD_TEXT.limitrow above. The other eight are prose: docblocks inpackages/types/src/objectql.ts:2861,packages/types/src/zod/objectql.zod.ts:1185,packages/plugin-kanban/src/index.tsx:379,packages/app-shell/.../previews/block-config.ts:237, a ledgerwhystring inblock-config-schema-parity-8216.test.ts:188, and two changesets. Separately,object-kanban-record-source-7780.test.tspins three more literals out of this same file (const boundData = useDataScope(schema.bind);, the fetch guard, and theconst rawData = …line). All three are untouched by this PR and are green — they are also why this file is treated as text-pinned by house style.Resolution: constraint 2, and it costs nothing. The query is now a named object with the cap spelled inline exactly as pinned, and the saturation comparison reads
query.$topback off it:This is one spelling, not two — no expression is duplicated to appease a grep. It is also strictly better than the
rowWindowlocal it replaces: a second copy of the cap kept only for the comparison could drift from the value actually on the wire, and a windowed-ness marker computed against a window the server was never asked for is precisely the silent wrongness this card exists to remove. The structure now makes that drift unrepresentable.No pin weakened, skipped, quarantined or edited.
packages/typesis untouched by this PR; no file surface was extended. The assertion still fails if the renderer ever stops readingschema.limitor stops defaulting toDEFAULT_KANBAN_LIMIT— verified by the same ablation discipline that produced it: the row is red one33d6ffand green on the head below.Green, on the pushed head:
object-kanban-group-by-limit-7322.test.ts(the failing file)✓ limit is still read, as the exact text the docblocks cite+ object-kanban-record-source-7780.test.ts+packages/plugin-kanban/pnpm --filter @object-ui/plugin-kanban type-checkquery.$toptypes cleanpnpm --filter @object-ui/plugin-kanban lintorigin/mainmerged before pushing (4d78b42); it brought#8737and#8771and touched no file underpackages/types, so neither #8776 nor #8777 has landed yet and there was no conflict. The ablation above is still anchored to the exact bytes it was run on:KanbanImpl.tsxis untouched by this patch round and its blob is stillcbc94487407f46c8b5649806b91596b29645a0c0.⛔ Unchanged by this round, as instructed: the
77+design, the>=saturation predicate, the three header sites and theBOUNDARYrow.验收备注
noted, not filed:the flat column header renders a bare EnglishFullbadge and the swimlane lane toggle a bare▶, neither behinduseKanbanT. Pre-existing, untouched here, and cosmetic-copy rather than a wrong number. Carrier: whoever next opensKanbanImpl.tsx's header block.noted, not filed:no tooltip explains the+to a first-time reader. Adding one means a new key across ten locale packs, which is outside this card's declared file surface; the marker itself is self-describing and never false, so the gap is legibility, not honesty.🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code