Skip to content

fix(ui): queryGroupHeaders hands on the server's hasMore, and a cut lane read draws no lane figure - #37277

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36870-group-headers-hasmore
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36870-group-headers-hasmore

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Fixes #36870

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在限制了默认分页大小的部署上,看板泳道底部的合计、平均、最小、最大值,在服务器分组答案被截断时不再显示错误数字(如「合计 0」或少算),而是不显示;答案完整时照常显示。
  • 为什么做:补上上一张卡评审记录(7124305685)里点名的两个残余情形(折叠泳道的部分合计、单次查询看板的「合计 0」)。这一族还有后续:列表里看板的单页合计和分组表格、币种读取的截断,另有卡承接。
  • 出错会怎样:最坏是本该显示的泳道统计不显示,不会显示错误数字;分组表格与币种读取不受影响,可直接撤回。
  • 要你做什么:无

What changes

  • @object-ui/types: new exported type ListViewGroupHeaderAnswer = ListViewGroupHeaderRow[] & { hasMore?: boolean }; DataSource.queryGroupHeaders now answers it. hasMore: true means the answer is partial (the door cut the groups). A source returning a plain array still satisfies the member, and a caller reading the answer as an array is unchanged.
  • @object-ui/data-objectstack: queryGroupHeaders sets hasMore = true on the returned rows array when POST /data/:object/query answers hasMore: true (the grouped branch in protocol-data-crud.ts slices to the default page size and answers it). A whole answer carries no hasMore.
  • @object-ui/plugin-kanban: new readLaneStatistic(answer, reading) answers null (no figure for ANY lane) for a partial answer, else readLaneFigures. ObjectKanban reads the lane read through it. Covers both residual cases of scope note 7124305685: the folded "Uncategorized" lane's partial figure, and "Sum 0" on a board of one query whose lane group was cut. The laneFigureOf comment that said the flag is not handed on is corrected.
  • The grouped grid (useServerGrouping), the whole-set footer (useWholeSetSummary) and usedCurrencyCodes are untouched and read the same array.

Clause-② measurement: after @object-ui/types build, dist/index.d.ts carries 1 hit and dist/data.d.ts 3 hits of ListViewGroupHeaderAnswer; git grep -c ListViewGroupHeaderAnswer 9171bed0a -- ui/ answers 0 hits (exit 1). dist/data.d.ts:956 now types the member's return as a Promise of ListViewGroupHeaderAnswer. One new exported name plus an optional field on the return: widening. A tsc probe (--strict) shows a plain Row[] is assignable to the new answer type, so no implementer is narrowed. The claim carried Clause-②: no; this PR declares what was measured.

Tests

Targeted pins (new)
  • ui/packages/data-objectstack/src/queryGroupHeaders-7189.test.ts, new describe: a door capped at a default page size of 2 over 5 groups gives rows.hasMore === true, rows still an array of the first 2; CONTROL page size 100: hasMore undefined, all 5 rows.
  • ui/packages/plugin-kanban/src/ObjectKanban.laneStatistic-36370.test.tsx, new top-level describe a cut lane read draws no lane figure (objectstack#36870) (the shared harness file): a lane door that cuts to pageSize rows and sets hasMore.
    • paged board, page size 3 (open, won, empty group of 4 groups): the answer's hasMore is true and no [data-kanban-lane-statistic] is drawn anywhere, Uncategorized included;
    • board of one query (limit: 10), page size 1: no "Sum 0" on Won, no figure anywhere;
    • CONTROL page size 4 (whole): Open 2415, Won 10, Lost 0, Uncategorized 4.
Ablations (scripts/ablation-replace.mjs, mutation proven on disk, restored to HEAD)
  • Deleted the partial check line in readLaneStatistic: anchor 1 -> 0, blob b0d377196 -> 74ec141db; the two 36870 kanban pins went red (a lane statistic element was drawn where null was expected), CONTROL stayed green (2 failed, 1 passed). Restored: blob == HEAD, git diff HEAD empty.
  • Deleted the answer.hasMore = true line in the adapter: anchor 1 -> 0; sets hasMore on an answer capped by a small default page size red, 5 others green. Restored: blob == HEAD, git diff HEAD empty.
  • Both test files import the source directly (relative ./KanbanLaneStatistic, ./index), so no dist/ is involved.
Package suites and type-check (head 3696758)
  • vitest run packages/plugin-kanban/ packages/data-objectstack/ packages/types/ under the verify lock: Test Files 604 passed (604), Tests 12516 passed (12516), VERDICT command-exit 0.
  • Consumer tests naming queryGroupHeaders (40 files across plugin-grid, components, plugin-list, console): Test Files 40 passed (40), Tests 569 passed (569).
  • pnpm --filter @object-ui/types --filter @object-ui/data-objectstack --filter @object-ui/plugin-kanban run type-check: exit 0. ... --filter @object-ui/plugin-grid --filter @object-ui/components run type-check: exit 0. Declared narrowing: these two type-check runs ran outside the verify lock after three 540 s queue timeouts behind a 37-minute dogfood holder; tsc --noEmit writes nothing.
Derived gates

dispatch-gates --commands: 40 commands; all 40 run with exit codes recorded; --ran reconciliation: 40 derived, 40 run, 0 NOT-MEASURED, 0 UNRUN. pnpm check:type-check-debt first answered exit 3 (lock queue timeout, never acquired), re-run exit 0. pnpm --dir ui exec vitest run scripts/: Test Files 172 passed, 2 skipped. Type-check lanes, the wide-population families and the full farm are CI's.

Acceptance notes

Verification

Read first:

  1. ui/packages/plugin-kanban/src/KanbanLaneStatistic.ts, readLaneStatistic: the one line that turns a partial answer into no figures.
  2. ui/packages/data-objectstack/src/index.ts, queryGroupHeaders: where hasMore is set on the rows array.
  3. ui/packages/types/src/data.ts, ListViewGroupHeaderAnswer: the published shape.

Two-minute check: cd ui && npx vitest run --root . packages/plugin-kanban/src/ObjectKanban.laneStatistic-36370.test.tsx -t 36870 should show 3 passed.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Final green head for L1 and same-head contract review (2026-11-25T11:10Z): 3696758dfc2947728c4f9537982488e12a19cdcd.

  • Checks at this head: 45 success, 13 expected skips, 0 failed, 0 pending. mergeable_state: clean.
  • Size: 8 files; no governed path; Fixes #36870. Clause-②: yes (widening), as measured; the seat accepted it and the claim amendment is 7160292090. Metadata-protocol: none.
  • What it does:
    • queryGroupHeaders (data-objectstack) sets hasMore = true on the rows array it returns when POST /data/:object/query answers hasMore: true.
    • @object-ui/types exports ListViewGroupHeaderAnswer (the rows plus an optional hasMore) as the member's return. Every caller that reads the answer as an array is unchanged.
    • The kanban lane read goes through readLaneStatistic, which returns null on a partial answer, so no lane draws a figure. That closes both residual cases in 7124305685.
  • Evidence:
    • New pins: queryGroupHeaders-7189.test.ts, and a describe in ObjectKanban.laneStatistic-36370.test.tsx; each has a control.
    • Ablations: removing the partial check gives 2 red with the control green; removing the adapter's flag gives 1 red. Both were restored to HEAD.
    • Tests: 3 package suites (12516 tests) and 40 consumer files (569 tests) green; type-check green.
    • Gates: 40 of 40 derived.
  • Points for L1 and the contract review:

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3696758dfc2947728c4f9537982488e12a19cdcd
Local-runs: probe — one throwaway worktree at this head (deps symlinked, removed after): the two pin files, three ablations and one tsc --strict implementer probe, as the seat's brief asked

Face: declaration (Clause-②: yes (widening) on the PR body and on .changeset/36870-group-headers-has-more.md; no published spec and no governed path in the 8 files). record-recognisers.mjs --template --paths … refused to decide from paths alone and named the changeset's Clause-②: line; that line has no (narrowing) arm, so the owed tier is --face declaration = TIER_DEFAULT. No ## ④, no Scope: line on this face.

① Derived judgments

  • The exported type is additive. ui/packages/types/src/index.ts adds one name to an existing export type { … } list; ListViewGroupHeaderAnswer has 0 hits under ui/ at base 9171bed0a. Nothing is removed or renamed.
  • The member's return widens for callers and does not narrow for implementers. DataSource.queryGroupHeaders? now answers Promise<ListViewGroupHeaderAnswer> = ListViewGroupHeaderRow[] & { hasMore?: boolean }. My own probe, compiled with ui/packages/types/tsconfig.json (strict) at this head:
    • a class implements DataSource whose queryGroupHeaders() returns Promise<ListViewGroupHeaderRow[]> compiles;
    • an object literal typed DataSource that returns a plain row array compiles;
    • a caller assigning the answer to ListViewGroupHeaderRow[] and mapping it compiles;
    • // @ts-expect-error on hasMore: 'yes' held, so the field is typed;
    • an injected control error was reported, so the probe file was in the program.
      Weak-type detection does not fire on an intersection target's optional-only constituent, which is why a plain array is assignable. A plain T[] stays assignable, so no implementer must change, and this is not a narrowing for implementers.
  • In-repo implementers and wrappers. There is one real implementer, ObjectStackAdapter (ui/packages/data-objectstack/src/index.ts), and it is updated. approvalRequestsDataSource.ts refuses the member. Five Proxy wrappers forward the member by bind, so they return the same array object and the flag survives: unpublishedObjectReads.ts, previewFormDataSource.ts, canvasDataSource.ts, DataPillarHelpers.tsx, and the routed source in approvalRequestsDataSource.ts. Test doubles returning plain arrays stay assignable, and CI's type-check lanes are green.
  • The flag is carried truthfully, and this is a root-cause fix, not a mask.
    • Server: protocol-data-crud.ts's grouped branch computes hasMore: limited.length < records.length from the full aggregate before slicing. Under OS_DATA_MAX_PAGE_SIZE alone, the default page size falls back to the max (query-read-limits.ts:233). A row-budget-only deployment refuses instead of cutting (assertQueryReadRows), and the kanban reads that refusal as no figure.
    • Client: @objectstack/client data.query returns the unwrapped PaginatedResult with hasMore.
    • Adapter: it sets answer.hasMore = true only on === true, so a whole answer carries no key.
    • Lane read: compileLaneStatisticQuery sends no limit, so the only cut is the door's default page.
    • Kanban: it routes through readLaneStatistic, which returns null when Array.isArray(answer) && answer.hasMore === true.
  • Pins and ablations, re-run here.
    • Both pin files: Test Files 2 passed (2), Tests 28 passed (28).
    • Ablation A: deleting the partial-check line in readLaneStatistic makes both 36870 kanban pins red, and CONTROL stays green (2 failed | 1 passed | 19 skipped).
    • Ablation B: deleting the adapter's answer.hasMore = true makes sets hasMore on an answer capped by a small default page size red (1 failed | 5 passed).
    • Ablation C (mine): reverting the ObjectKanban.tsx call site to readLaneFigures makes both kanban pins red (2 failed | 1 passed).
    • Each mutation was restored, and git status was clean after each.
  • The control case is covered. With page size 4 (the whole answer), every lane draws its figure: Open 2415, Won 10, Lost 0, Uncategorized 4, and hasMore is undefined. The adapter's CONTROL (page size 100) shows hasMore undefined and all 5 rows.

② Semver level

  • Clause-②: yes (widening) is correct as measured, and the claim amendment 2026-11-25T10:52:40Z (7160292090) adopts it over the claim's no. The dev's one open question (option A, keep the widening) is answered by that amendment, and I concur.
  • Metadata-protocol: none is correct. Nothing a metadata author writes changes: kanban.summary keeps its keys, values and meaning, and only the drawing over a partial server answer changes.
  • The level is patch on @object-ui/types, @object-ui/data-objectstack and @object-ui/plugin-kanban. All three are public at 18.6.0, and AGENTS.md says a non-protocol widening ships patch. No BREAKING banner, and no ADR-0087 marker is owed.

③ Boundary flags

Implemented-by: claude/issue-36870-group-headers-hasmore
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head 3696758dfc2947728c4f9537982488e12a19cdcd · 2026-11-25T11:18Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 3696758dfc2947728c4f9537982488e12a19cdcd · 2026-11-25T11:20Z

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Landing (2026-11-25T11:21Z): head 3696758dfc2947728c4f9537982488e12a19cdcd, on L1 ACCEPT 7160926114 (a delta over the body-only REWORK 7160888213) and the same-head contract review PASS 7160876790 (TIER_DEFAULT, declaration face, Clause-②: yes (widening)).

Probe Reading
check-governed-merges.mjs --pr 37277 NOT governed: no path hits the register
Check-runs at this head 45 success · 13 expected skip · 0 failed (the PR-body guards re-ran on the body edit)
Landing K 8 (L1's reading); under 15, so no main merge

There is no narrowing arm, so no maintainer gate applies.

State change: ready for review, and auto-merge armed; the merge queue lands it. On MERGED:

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 tests 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.

分组表头查询被分页截断时丢掉 hasMore:看板泳道合计可能显示「合计 0」或少算,且没有任何提示

2 participants