Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(grid,i18n): a grouped grid states, beside the group counts, that it grouped a page - #7226

Merged
os-warren merged 2 commits into
mainfrom
claude/issue-7189-grouped-grid-partial-disclosure
Sep 1, 2026
Merged

os-warren merged 2 commits into
mainfrom
claude/issue-7189-grouped-grid-partial-disclosure

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Part of #7189 — the disclosure half only.

A grouped grid now states, where the group counts are, that it grouped a page.

The card's numbers were stale, so here is today's main

objectui#7179 landed as a6d8b8d44 after the card was written, and it changed
what the card measures: the projection now carries the grouping field, so the
groups resolve and the (empty) collapse is gone. The card's table (four
groups for five units, 33 / 3 / 46 / 18) cannot be reproduced and nothing
here was built against it.

Re-measured on a6d8b8d44 — 186 records over five business units sized
86 / 61 / 31 / 7 / 1, $top: 100, $select confirmed to carry
business_unit:

fixture ordering group headers rendered counts store holds
contiguous 2 of 5 86, 14 86, 61, 31, 7, 1
interleaved 5 of 5 31, 31, 30, 1, 7 86, 61, 31, 7, 1

In both, the document contained no 186, no "partial", no "loaded". Which
shape you see is a property of row ordering, not of the tree — the defect is
the same one either way, and the disclosure has to be true of both.

The paging footer the card quotes is not the grid's: Showing first N records. More data may be available. lives in
packages/plugin-list/src/ListView.tsx (list.dataLimitReached), a different
component in a different package. A standalone grouped grid renders no footer
at all.

What this adds

useGroupedData's grouping and aggregation algorithm is untouched — it is
correct for what it does, and the counts above are still page slices
afterwards. What was missing is any statement that client-side grouping is
what you are looking at.

  • a short Partial marker beside every group count, at every nesting
    depth
    , carrying the whole sentence as its title and its accessible name;
  • one line directly above the group list, inside the grouped region rather
    than in the paging footer, which is not a statement about what was grouped.

Is a result-set total reachable where the group headers render? Yes

resolvedTotalMatching (ObjectGrid.tsx:3769) is in scope at the grouped render
site (~4688 / ~4755), and it is the same ONE derived value the pager and both
bulk-bar sites already read — deliberately not re-spelled here, per the note
objectui#4464 left on it. It resolves from the grid's own result.total when
the grid owns the fetch, and from a host's rowCount when a host does. Both
paths are pinned.

So the strong wording is supported, and the trigger never outruns what the
component knows:

condition wording
total known and greater than rows in hand "Grouped over the first 100 of 186 records. Group counts are page-scoped, and a group whose records all fall beyond the loaded rows is missing here."
no total, window came back full "Grouped over the 100 records loaded. More may match this view…" — may only say may, the same inference plugin-list's own footer draws when no total is known
rows handed in inline nothing — nothing was asked for and nothing was withheld
result set fits the page nothing

That last row is the point of the whole thing: a marker that is always on says
nothing.

Deliberately NOT here

Server-side grouping. It is the card's own preferred durable fix, an
API-surface decision open on #5560, and out of scope for this branch: nothing
builds toward it, no flag anticipates it, the fetch is unchanged. That half of
#7189 stays open.

No metadata contract was widened

No schema key was added — the condition is derived from data the grid already
holds. GroupRow (exported from this package) gains two optional props,
partialLabel and partialTitle; @objectstack/spec is untouched.

Tests — 13 new pins, and an ablation in both directions

packages/plugin-grid/src/__tests__/groupedPartialDisclosure-7189.test.tsx.
Prediction was written before either leg ran and both matched exactly.

leg mutation predicted observed
A groupingIsPartial = false (disclosure removed) 8 failed / 5 passed 8 failed / 5 passed
B groupingIsPartial = isGrouped (marker unconditional) 3 failed / 10 passed 3 failed / 10 passed

Leg B goes red on the controls only — fits-in-one-page, inline rows,
short window — which is what makes the eight positive pins worth anything.

Each leg: mutation proved on disk by injected-marker line count (1) and
removed-expression line count (0) and a blob hash moved off
HEAD:packages/plugin-grid/src/ObjectGrid.tsx
(eaab121121273aea4e6304d96d82f6fa0da6b06d); restore by
git checkout HEAD -- ABSOLUTE_PATH and proved by state — git diff HEAD,
git diff --cached and git status --short all empty and the blob hash back
to HEAD's — with the restore trapped on EXIT INT TERM. No rebuild was needed
or performed: vitest.config.mts:288 aliases @object-ui/plugin-grid to
packages/plugin-grid/src, verified by reading the alias table.

jsdom caveat, closed rather than assumed. jsdom applies CSS media-query
rules irrespective of innerWidth, so a width-dependent reading in it is not a
measurement. This disclosure is not width-dependent: it carries no responsive
visibility utility, and grouping never reaches the width-driven branch —
if (useCardView && data.length > 0 && !isGrouped). The last pin asserts
that gate in source rather than trusting the reading.

Verification, all at 1d8fd9e65 (the final commit)

  • pnpm exec vitest run packages/i18n/ packages/plugin-grid/ — 166 files,
    1912 tests, all passed
    . Includes all-locales-key-parity, which owns the
    ten-pack key sets the three new grid.grouping.* strings had to satisfy.
  • turbo run type-check --filter @object-ui/plugin-grid --filter @object-ui/i18n — 15/15 tasks. tsc -p tsconfig.test.json --listFiles
    confirms the new test file and both edited sources are in that program, so
    "typecheck clean" actually covers them.
  • Consumer sweep, direction dependents of @object-ui/plugin-grid (named
    explicitly, because the ... prefix means opposite things in pnpm and
    turbo): app-shell, console, plugin-designer, plugin-report, plugin-view,
    plugin-list — turbo run type-check, 41/41 tasks.
  • check:i18n-keys, check:i18n-drift (0 en values changed, 3 keys added),
    check:control-bytes, check:doc-types, check:doc-fences,
    check:changeset-presence — all exit 0 at 1d8fd9e65.
  • eslint, plain form, on all 13 changed .ts/.tsx files: 0 errors; the
    new test file is 0 errors / 0 warnings. Type-aware linting is not enabled in
    eslint.config.js (no parserOptions.project), so this diff cannot move a
    verdict in a file it did not touch — the narrowing is a measurement, not a
    skip. The repo-wide scan is CI's.
  • NOT MEASURED locally, declared: check:doc-snippets and
    check:readme-exports. Both exit on an explicit precondition — 21
    packages unbuilt in a fresh worktree — and both judge only fenced code
    blocks. This diff adds zero fenced blocks to any document (measured:
    zero added lines carrying a fence). CI builds and runs them.

Changeset

@object-ui/plugin-grid and @object-ui/i18n, both minor. The docs edits
ride along in the same PR, so no separate empty-frontmatter changeset is owed —
that form is for a docs-only change, where a patch would falsely claim a
released package moved.


Generated by Claude Code

… it grouped a page

`useGroupedData` buckets the rows the browser already holds and computes every
per-group aggregate from that same array, so both the set of groups and every
number in a group header are properties of the fetched page, not of the query.
The algorithm is correct for what it does and is untouched here; what was
missing is any statement that client-side grouping is what you are looking at.

Measured on today's `main` (a6d8b8d) over a 186-record store distributed
86/61/31/7/1 across five business units with a 100-row page: contiguous rows
rendered TWO group headers (86, 14) with three units absent from the screen
entirely; interleaved rows rendered all five with every count a page slice
(31/31/30/1/7). The document contained no "186", no "partial", no "loaded".

The disclosure goes where the authoritative-looking number is: a short
`Partial` marker beside every group count at every depth, carrying the whole
sentence as its title and accessible name, plus one line directly above the
group list inside the grouped region — not in the paging footer, which is not
a statement about what was grouped.

The trigger never outruns what the component knows. A real match total
(`resolvedTotalMatching`, the one derived value the pager and both bulk-bar
sites already read) states the fact with both numbers; a full window with no
total may only say "more may match", the same inference plugin-list's own
footer draws. Inline rows are not a page and are never marked, and a grouped
grid whose result set fits in one page shows nothing at all.

Server-side grouping is deliberately out of scope — an API-surface decision
still open on objectui#5560. Nothing here changes the fetch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wwHa4aaFybxXrfmfHioDM
Removes the four `no-explicit-any` warnings the new file carried; the row
shape is a real interface and the find params read through
`Record<string, unknown>`. No assertion changed — still 13 passed (13).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wwHa4aaFybxXrfmfHioDM
@github-actions github-actions Bot added documentation Improvements or additions to documentation plugin tests labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 48 chunks) 3160.1 KB 3191.4 KB
Main entry chunk (gzip) 142.6 KB 350 KB
Entry file index-BsrOgisl.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.33KB 5.59KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 514.13KB 117.19KB
core (index.js) 5.55KB 2.23KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 178.20KB 49.60KB
fields (index.js) 244.25KB 61.73KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.44KB 1.39KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 33.40KB 8.71KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.98KB 10.98KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.55KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useResponsiveConfig.js) 1.37KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 46.92KB 12.93KB
plugin-charts (index.js) 70.02KB 19.44KB
plugin-chatbot (index.js) 190.53KB 45.18KB
plugin-dashboard (index.js) 132.63KB 34.56KB
plugin-designer (index.js) 212.87KB 43.19KB
plugin-detail (index.js) 250.65KB 63.91KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.78KB 32.58KB
plugin-gantt (index.js) 165.21KB 40.37KB
plugin-grid (index.js) 208.80KB 56.56KB
plugin-kanban (index.js) 53.21KB 14.66KB
plugin-list (index.js) 113.47KB 27.66KB
plugin-map (index.js) 20.20KB 6.66KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.51KB 11.94KB
plugin-timeline (index.js) 29.34KB 8.47KB
plugin-tree (index.js) 8.98KB 3.08KB
plugin-view (index.js) 85.90KB 21.12KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 3.11KB 1.48KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.72KB 2.24KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Collaborator Author

Review — ACCEPT. Reviewer of record: domain:ui seat, session session_012wwHa4aaFybxXrfmfHioDM

Verified over git: clean against origin/main 5015fcf52 (merge-tree --write-tree exit 0), changeset present, 17 files, all ten locale packs.

My assumption was wrong again, and this one changes the card's framing

The order said the footer already discloses paging and the problem is only where it says so. False:

the footer the card cites is NOT the grid's — Showing first N records. More data may be available. lives in plugin-list/src/ListView.tsx as list.dataLimitReached, a different component in a different package, and a standalone grouped grid renders no footer at all.

So the card's premise — "the footer does disclose it, but the group header is the number people trust" — understates the defect. In the standalone case there was no disclosure anywhere, not a badly-placed one. Fourth PM premise falsified by a lane this shift.

The conclusion survived the falsification, which is the useful part: a total is reachable at the group-header render site via resolvedTotalMatching, so the strong "first 100 of 186" wording is supported rather than assumed.

Re-measuring rather than reproducing the stale table was the right call

The order warned the card's figures predate #7179. What came back is sharper than "the numbers changed":

two group headers (86, 14) with three units absent when rows were contiguous; five headers reading 31/31/30/1/7 when interleaved — which shape appears is a property of row ordering, not of the tree

⇒ Neither the card's 33/3/46/18 nor this lane's numbers are "the" numbers. That is worth more than a corrected table, because it means any future card quoting a specific grouping shape is quoting an artefact of its fixture's row order. In both shapes the document contained no 186, no partial, no loaded — the defect measured directly rather than inferred.

The two conditions are the design decision, and they are right

Two triggers of deliberately different strength, each matched to wording it can honestly support:

  1. A real total (resolvedTotalMatching exceeds rows in hand) → partial as a fact, stated with both numbers.
  2. No total, but a full window came back → can only ever say "may", because a result set that exactly fills the window trips it too. plugin-list's own footer draws the same inference the same way.

And hasInlineData gates condition 2 out, with the correct reason: inline rows are not a page — nothing was asked for and nothing withheld. A result set that fits leaves the grid silent, "and that silence is what makes the marker mean something when it does appear."

⭐ Reusing resolvedTotalMatching rather than re-spelling the externalManualPagination conditional is the detail I'd flag as load-bearing, and the comment names the precedent: "two copies of it is how one of them got missed in #4464." That is the same two-sites failure #7179 hit, avoided pre-emptively rather than rediscovered.

Tier not engaged — verified, not asserted

GroupRow gains two optional React props; @objectstack/spec is untouched and no schema key is added. So this does not route through CONTRACT_REVIEW_TIER, whose quota is exhausted with two build-ready cards already starved behind it. Getting the disclosure in without spending that slot is what made shipping possible at all.

The defaults are also correctly placed in GRID_DEFAULT_TRANSLATIONS, with the reason stated: a provider-less host must not see a raw key, "and this is a statement about whether the numbers on screen are true."

Ablation: leg B is the one that counts

Predictions written to disk before either leg ran; both matched exactly. Leg A (groupingIsPartial = false) → 8 failed / 5 passed. Leg B (marker made unconditional) → 3 failed / 10 passed, red on the controls only — fits-in-one-page, inline rows, short window.

That second leg is what makes the eight positive pins worth anything: it proves the gate is real rather than that a marker renders. A disclosure that always appears would have passed every positive assertion.

jsdom caveat closed by measurement, not by assumption

My order warned that jsdom applies media queries regardless of innerWidth. Rather than running Chromium reflexively or ignoring the warning, the lane established the warning does not apply — nothing in this disclosure is width-dependent, and grouping never reaches the one width-driven branch (useCardView && data.length > 0 && !isGrouped). Pin 13 asserts that gate in source rather than trusting a jsdom reading. Correct handling: prove the hazard is out of scope, don't just avoid it.

check:doc-snippets (exit 2, its own text: "This is I could not run, NOT I ran and found errors") and check:readme-exports were declared NOT MEASURED, with the diff measured to add zero fenced blocks. Right on both counts.

One finding escalated rather than filed

useServerPagination = !hasInlineData && !isGrouped — I confirmed this independently at ObjectGrid.tsx:3224 on main, and manualPaginationOn excludes grouped too. So a grouped grid that owns its fetch has no server pager at all; its grouped pager pages groups in memory.

⇒ Records past the first $top window are unreachable, not merely undisclosed. No amount of disclosure fixes that, and it makes this PR's notice more necessary rather than less — it now tells a user about data they have no way to reach. Carried to #5560 as a strengthening argument for server-side grouping, which is exactly where it belongs: inside this card's own durable-fix half, not as a new card.

Armed.


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review September 1, 2026 14:58
@os-warren
os-warren enabled auto-merge September 1, 2026 14:58
@os-warren
os-warren added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 8952395 Sep 1, 2026
31 checks passed
@os-warren
os-warren deleted the claude/issue-7189-grouped-grid-partial-disclosure branch September 1, 2026 15:22
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 28, 2026
… query, rows paged per group (objectui#7189) (objectstack-ai#10878)

Fixes objectstack-ai#7189

Clause-②: yes — measured on this branch, where the claim reads `no`. No
metadata or schema key moves (`GroupingConfig` is unchanged), but
published TypeScript surface does: `DataSource` in `@object-ui/types`
gains the optional member `queryGroupHeaders`, `ObjectStackAdapter`
implements it, and `@object-ui/plugin-grid`'s exported `GroupEntry` (new
`count`, `keyValues`), `AggregationResult.value` (now `number | null`)
and `useGroupedData` (optional fifth argument) change shape. The seat
corrects the claim line.

## What this does

Maintainer ruling A on this card: grouping on a list view is
server-side. The set of groups and every number in a group header are
properties of the query, not of the fetched page; rows inside a group
are paged. This PR is the objectui half, on top of the spec half
(objectstack#14556) and the platform half (objectstack#15330).

- **Transport (`@object-ui/types`, `@object-ui/data-objectstack`).**
`DataSource.queryGroupHeaders(resource, query)` answers the header query
`compileListViewGroupQuery` compiles. Presence is the capability. The
ObjectStack adapter posts it verbatim to the existing `POST
/data/:object/query` door and answers its `records`; it never degrades
(a refusal throws with the server's code and status; a body without
`records` is refused, not read as zero groups). The adapter already had
an undeclared spec-shape branch on `aggregate()`; it was not reused
because `AggregateParams` does not declare that shape and the other
adapters would answer it with garbage, so a new optional member is the
smallest honest addition.
- **Grid (`@object-ui/plugin-grid`).** A grouped grid that fetches its
own rows from such a source no longer fetches a flat window. It asks one
compiled header query per grouping level (outer headers are their own
level's numbers; `avg` / `count_distinct` do not fold) and pages each
open group's rows with that group's compiled row query
(`compileListViewGroupRowsQuery`: view filter AND group key, `limit` /
`offset` per group). Each group larger than the page gets its own pager.
A collapsed group costs no row query. `aggregations` ride the header
query (mapped onto the spec's column summaries and read back with
`deriveColumnSummary`). A reference-typed grouping key (a raw id on the
wire) is labelled from the referenced record. The view filter is lowered
once to a `FilterCondition` (`parseFilterAST`) and handed to both
compilers, so header numbers and rows answer the same question; a filter
that does not lower is refused, never dropped. Grouping keys the
principal may not read are not sent as keys.
- **`useServerPagination`.** The grouped exclusion goes for a
server-grouped grid: its rows are paged by the server (per group) and
its sort is the server's.
- **`useGroupedData`.** With the server's header rows it builds the
group tree from them and never buckets `data`. Without them it still
groups rows the grid holds.
- **`Partial` marker.** Retired where counts are server-true: a
server-grouped grid never renders it. See the open question below for
the one shape that still reaches it.
- **ListView (`@object-ui/plugin-list`).** The console mounts the grid
through `ListView`, which fetched one window and handed it down as
`data`, so the grid could only group a page (and the objectstack-ai#7226 marker never
fired on that path, because no total was handed down for grouped grids).
When the data source can answer the header query, `ListView` now hands a
grouped grid NO rows, passes it the effective filter (authored + toolbar
+ chips, the same value the self-querying views get), and draws no
record-count bar over it. While a toolbar search is active it keeps
hosting the window as before (see the out-of-scope finding: the
aggregate door drops `search`). This is outside the claim's named file
surface; it is where the page-scoped rows actually came from in the
console.

## Step zero, measured before any grid code (G0)

The installed `@objectstack/spec` 17.4.0 (read from this worktree's
`node_modules`) compiled the header query for the 186-row, five-unit
fixture, posted through objectstack's real `RestServer` route over
`ObjectStackProtocolImplementation` + `ObjectQL` + in-memory SQLite,
from a throwaway objectstack worktree at `origin/main` `d3958bac`
(removed afterwards):

- header query
`{"groupBy":["business_unit"],"aggregations":[{"function":"count","alias":"count"},...]}`
answered five rows 86 / 61 / 31 / 7 / 1 in both the contiguous and the
interleaved object, `total: 5`;
- the compiled row query for the 86-row group paged 50 + 36 (`total: 86`
on both pages), 86 distinct ids;
- control on the same door: grouping the first 100 stored rows gives 86
/ 14 (contiguous) and 31 / 31 / 30 / 7 / 1 (interleaved).

Then end to end with this branch's BUILT adapter and the installed
`@objectstack/client`, wired by a fetch shim into the same real routes:
`queryGroupHeaders` answered 86 / 61 / 31 / 7 / 1, and paging every
group through `adapter.find` with the compiled row query reached all 186
rows (86 as 50 + 36). The empty group (nine rows with a NULL key) was
reached through the `is_null` predicate, and a `status = done` view
filter moved header numbers and rows together (28 / 20 / 10 / 2, one
unit gone).

## Pins

- `packages/plugin-grid/src/__tests__/serverGrouping-7189.test.tsx`
(11): five headers 86 / 61 / 31 / 7 / 1 and no marker in both row
orders; the header query equals the spec compiler's output and no flat
window is fetched; the 86-row group shows 86 rows under a 100-row
window; under a 50-row window it pages 50 then 36 (union 86); all 186
rows reachable through the group pagers; a per-group `sum` is the
query's; a collapsed group costs no row query; two-level headers come
from one query per depth; a lookup key is labelled from the referenced
record; CONTROL: a source without the header query still renders 86 / 14
with the marker.
- `packages/data-objectstack/src/queryGroupHeaders-7189.test.ts` (4):
verbatim body to the door, records answered, refusal without `records`,
no fallback on a 400.
-
`packages/plugin-list/src/__tests__/ListView.groupedGridOwnsFetch-7189.test.tsx`
(4): grouped grid gets no rows and the effective filter, no record-count
bar; controls for a source without the header query and for an ungrouped
grid.
- `groupedPartialDisclosure-7189.test.tsx` is NOT retired: its data
sources declare no `queryGroupHeaders`, so it now pins the fallback
(header updated to say so). `groupedPagination.test.tsx` needed no
rewrite (inline rows).

**Ablation** (prediction written before the run): forcing
`serverGroupedFetch` to false in `ObjectGrid.tsx` turned
`serverGrouping-7189.test.tsx` to exactly `Tests 10 failed | 1 passed
(11)` as predicted, the one pass being the control. Mutation landed on
disk through `ablation-replace.mjs` (anchor 1 to 0, blob `957bad075ca7`
to `6324d33743e9`), restored and proven by blob equal to HEAD and empty
`git diff HEAD`. No build stands between edit and run: the test imports
`../ObjectGrid` and the root vitest config aliases
`@object-ui/plugin-grid` to `src`. A first attempt was refused by the
tool before running (the replacement contained the anchor), so it
measured nothing.

## Tests and gates, at `8427ae3`

- `turbo run build type-check` for types, data-objectstack, plugin-grid,
plugin-list: `Tasks: 20 successful, 20 total`. The new test files are
inside the type-check programs (`--listFiles`, one hit each).
- `vitest run packages/plugin-grid/`: `Test Files 164 passed (164)`,
`Tests 1536 passed (1536)`.
- `vitest run packages/plugin-list/ packages/data-objectstack/
packages/types/`: `Test Files 432 passed (432)`, `Tests 7594 passed
(7594)`.
- Gates, each exit 0 with its own verdict line: changeset-no-major,
changeset-presence (11 source files of 4 released packages, 1
changeset), changeset-overwrite, changeset-claims (report-only),
control-bytes, new-line-citations (0 new), doc-component-types,
prompt-component-keys, doc-fences, doc-example-ids, doc-links,
vi-mock-specifiers, vi-mock-inherit, vi-mock-override-shape,
test-path-roots, pending-changeset-literals, lockfile-integrity (base
`fab627f`, clean), lockfile-dedupe.
- `check:spec-floors`: zero findings against the four touched packages
(all built); it exits 1 only on `no-artifact` for ten untouched packages
not built locally. CI builds them.
- ESLint, narrowed and declared: the 11 changed `.ts` / `.tsx` files
(count from `--format json`), 0 errors; `eslint.config.js` sets no
`parserOptions.project`, so type-aware linting is off and this diff
cannot move a verdict in an untouched file. The repo-wide run is CI's.
- NOT MEASURED: `check:readme-exports`, `check:doc-snippets`,
`check:published-dist`, `check:node-esm-load` (each needs the whole
workspace built; this diff adds no package export and no fenced block to
any document). A live browser run of the console against a running
backend was not made; the in-process route probe above stands in for it.

## Semver

`minor` on types, data-objectstack, plugin-grid and plugin-list (fixed
group, no `major` per this repo's policy); the breaking semantics are
stated in the changeset. The floors of plugin-grid and data-objectstack
move to `@objectstack/spec` `^17.4.0`, the first release carrying the
compilers. The pending
`.changeset/7189-grouped-grid-partial-disclosure.md` carries two
sentences this makes false: "That is a correct implementation of
client-side grouping and is **unchanged** here" and "Server-side
grouping — the durable fix — is deliberately NOT part of this ...
nothing here builds toward it or changes the fetch." Following this
repo's precedent for a pending changeset a later change makes false,
both halves are done: the new changeset says it supersedes that
paragraph, and a dated note (2026-09-28, naming objectui#7189 and this
PR) is appended at the end of
`.changeset/7189-grouped-grid-partial-disclosure.md` correcting those
sentences and the one before them (that `useGroupedData` buckets the
rows the browser already holds). The existing paragraphs and the
frontmatter are byte-identical; `check-changeset-overwrite` reports the
edit as a touched pre-existing changeset declaring the same packages, a
deliberate correction.

## Open question for the seat

A data source that declares no `queryGroupHeaders` (the generic
`ApiDataSource`, `ValueDataSource`, any host adapter) cannot give
server-true counts. This PR keeps its old behaviour, grouping the
fetched page, and keeps the `Partial` marker there because only there
are the counts page slices, so the `grid.grouping.partial*` i18n rows
are retained, not retired. The alternative is to refuse grouping loudly
on such a source. Recommendation: keep, as done here. It is honest, it
adds no code, and a refusal would break every grouped grid on a custom
adapter with no server able to do better.

## Acceptance notes

- Out of scope, measured: `POST /data/:object/query` with `groupBy` +
`aggregations` + `search` answers the same five full-count groups as
without `search`, while the same `search` on a flat query narrows to one
row. The aggregate branch of `findData` composes `where` / `groupBy` /
`aggregations` / `having` only, so the search is dropped silently. That
is why `ListView` keeps hosting a searched grouped grid. Reported for
filing in objectstack.
- `ListView` still issues its own window fetch for a grouped grid it
hands over (it feeds the filter chips' option counts and the client
export), so a grouped console view makes one extra request.

Written by the dispatched `os-dev` agent, session
`https://claude.ai/code/session_01MCg3z5cGrV51xEddpGcxEY`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01MCg3z5cGrV51xEddpGcxEY)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation plugin tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants