Repository navigation
refactor(plugin-grid): move ObjectGrid's grouping and column summaries into sibling hooks (slice 6) - #26574
Merged
Conversation
…s into sibling hooks (slice 6) The grouping (group value formatter, date group faces, server group headers and rows, grouped data) moves verbatim into useObjectGridGrouping, with temporalGroupHeading and its face type. The fan-out query, resolved match total and column summaries move into useObjectGridSummaries. Each hook is called where its block stood, so hook order is unchanged. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE
…pec-owned name (slice 6) check:spec-symbols refuses a local `ObjectFieldLike` because @objectstack/spec/system exports that name. The local type is GroupingFieldDef now; nothing else changes. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE
Contributor
Author
席位核对 · ACCEPT · seat
|
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Part of #25994 (slice 6 of the move-only split; slices 1–5 landed as #26323, #26354, #26364, #26499 and #26537, and the card stays open for the slices listed below).
Clause-②: no
Metadata-protocol: none
What moved
Base
f48aa451(mainwith slice 5).ui/packages/plugin-grid/src/ObjectGrid.tsxis 5639 lines there. This slice moves concerns N, O and P of the seam table in #26364, as re-planned in #26499. They are adjacent and above the first early return. Each block becomes a custom hook called where its lines stood:f48aa451temporalGroupFaces)useObjectGridGroupinginobjectGridGrouping.tsgroups,isGrouped,toggleGroup), the server leaves' rows and the match totalTemporalGroupFaceandtemporalGroupHeading(module level, with their docblocks)objectGridGrouping.tsbulkFanoutParams), the resolved match total, and the column summaries (summaries,hasSummary)useObjectGridSummariesinobjectGridSummaries.tsTemporalGroupFaceis the type N builds its faces with, so it moves with N, andtemporalGroupHeading's docblock is about that type, so the two stay together.temporalGroupHeadinggains theexportkeyword, andObjectGrid.tsximports it back for the one call in the grouped table's band (line 4879 there). #26341, which last edited these two, has landed.Hook inputs are passed explicitly and typed from their source; no context is added and no
anyis introduced:ReturnType<typeof useObjectGridQueryInputs>[name],ReturnType<typeof useObjectGridGroupingDecisions>[name],ReturnType<typeof useObjectGridRowLoad>['invalidationNonce'], and P'sisGroupedasReturnType<typeof useObjectGridGrouping>['isGrouped'].tandtranslateOptionsareReturnType<typeof useGridTranslation>['t']andReturnType<typeof useSafeFieldLabel>['translateOptions'].objectFieldsisRecord<string, any>in the component. The hook types it as what it reads:GridCellFieldLike(the cell face's own input type) plustype?: stringandoptions?: Parameters<translateOptions>[2].dataisunknown[]in the grouping hook andParameters<typeof useScopedColumnSummary>[1]in the summaries hook.objectSchemais{ fields?: Parameters<typeof useScopedColumnSummary>[2] } | null. Setters areReact.Dispatch<React.SetStateAction<…>>of their state's type (unknown[]fordata).The grouping hook returns the 7 names the rest of the component reads, and the summaries hook returns 4. The component destructures them under the same names. No identifier is renamed. Nothing new is exported from
ObjectGrid.tsx, and the package entry is untouched. Seventeen import specifiers move with their only readers (four whole import lines among them).ObjectGrid.tsxgoes from 5639 to 5250 lines. The diff is 965 changed lines.Move-only proof: the multiset of non-blank lines of the base
ObjectGrid.tsxequals the newObjectGrid.tsxplus the two modules. Nothing is missing except the 3 edited import lines, which differ only by the removed specifiers, andfunction temporalGroupHeading(, which now readsexport function temporalGroupHeading(. The only added lines are the module headers and imports, theReturnTypealiases and theGroupingFieldDeftype, the two hook signatures andreturn { … }lists, and inObjectGrid.tsxthe two imports plus the two calls with their two-line comments.Open PRs on
ObjectGrid.tsxNone. I checked all 17 open PRs at the claim (07:55Z): none touches
ObjectGrid.tsxor itsobjectGrid*siblings.Source pins and test edits
None. I matched every string literal of every test that reads
ObjectGrid.tsxagainst the moved lines (the hooks and the two module-level declarations), and the only hits were generic phrases in prose.groupDateHeading-13234.test.tsx, which holds each date heading to the cell under it, is a behavioural test and needs no edit.iconOnlyButtonCensus-12143counts the two icon-only pagers that stay inObjectGrid.tsx.Remaining slices
As re-planned in #26499: 7 — C + D + E (row-height sync, column-state persistence, pull to refresh; re-points
gridNonAuthorKeys'columnStatereads), and 8 — R + U + V (closes the card; re-points the fivegenerateColumnspins).Verification
Run on
39923d86. The head is now67836999, which only renames the grouping hook's local field type fromObjectFieldLiketoGroupingFieldDef: Type Check UI'scheck:spec-symbolsrefused the first name because@objectstack/spec/systemexports it. On67836999I re-rantype-check(exit 0) and all 16check:*steps of the Type Check UI job (check:phantom-depsthroughcheck:i18n-designer-parity, every one exit 0).pnpm --dir ui exec vitest run packages/plugin-grid/ --maxWorkers=2, the whole package suite, under the verification lock: 253 of 253 files, 2256 of 2256 tests. The before reading is the same count on slice 5 (refactor(plugin-grid): move ObjectGrid's row load into a sibling hook (slice 5) #26537, CI green on5345a340).pnpm --filter @object-ui/plugin-grid type-checkexit 0.turbo run build --filter=@object-ui/console: 70 of 70 tasks.pnpm --dir ui run check:doc-example-readersexit 0 (the newly exportedtemporalGroupHeadingis not a shared reader).react-hooks/exhaustive-depsmessages now name the setterssetData,setTotalMatchingandsetGroupedPage, because a setter that arrives as a hook parameter is not known to be stable. Threereact-hooks/set-state-in-effectwarnings and eightreact-hooks/refswarnings ("Cannot access refs during render", onlastFindParamsRef.currentfeedingbulkFanoutParams) are no longer raised, for the same reason: the rules recognise a setter or a ref only whereuseState/useRefdeclares it. Those eleven are not fixed, only out of the rules' sight; the reads are byte-identical.node scripts/pm/dispatch-gates.mjs --commands: 29 derived gates, all exit 0 (thevitest run scripts/gate ran under the lock: 178 files, 5097 tests);--ranreconciles 29 of 29 (0 NOT-MEASURED, 0 UNRUN).Landing
No other open PR touches these files, so this can land as soon as CI is green.
Changeset:
.changeset/25994-objectgrid-grouping-summaries-hooks.md(patch,@object-ui/plugin-grid).🤖 Generated with Claude Code
https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE