Repository navigation
refactor(plugin-grid): move ObjectGrid's authored-input diagnostics into a sibling hook (slice 3) - #26364
Conversation
…FooterSummaryReport into sibling modules (slice 2) Move-only: ObjectGridColumnState, ObjectGridFooterSummary and ObjectGridExternalPaginationProps go verbatim to objectGridProps.ts, and the renderless FooterSummaryReport to objectGridFooterSummaryReport.tsx. ObjectGrid.tsx imports them back and re-exports the three types, so its exported names and the package entry do not move. Also corrects slice 1's changeset: getDataConfig (the record-source ladder) stayed in ObjectGrid.tsx, so it is no longer listed as moved. Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com>
… 2 move Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com>
…in slice 2's note Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com>
…nto a sibling hook (slice 3) Move-only: the three console.warn effects for unreadable columns, unusable bulkActionDefs members and a non-positive page size move verbatim into useObjectGridDiagnostics(schema) in objectGridDiagnostics.ts. ObjectGrid calls the hook where the effects stood, so hook order does not change. Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com>
… 3 move Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com> # Conflicts: # scripts/sdui-manifest.sources/plugin-grid.json # ui/packages/plugin-grid/src/ObjectGrid.tsx
Claude-Session: https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE Co-authored-by: Claude <noreply@anthropic.com> # Conflicts: # scripts/sdui-manifest.sources/plugin-grid.json
|
Test UI (4/16) red on The only failure is Generated by Claude Code |
席位核对 · ACCEPT · seat
|
Requested by Steve · project thread
Part of #25994 (slice 3 of the move-only split, the first slice inside the
ObjectGridcomponent body; slices 1 and 2 landed as #26323 and #26354, and the card stays open for the slices listed below).Clause-②: no
Metadata-protocol: none
What moved
Base
222755eb(slice 2 merged).ui/packages/plugin-grid/src/ObjectGrid.tsxis 6637 lines there: imports and re-exports, the module-level code that tests pin in place, and theObjectGridcomponent from line 673 to the end.This slice moves concern Q of the seam table below, verbatim, into a custom hook
useObjectGridDiagnosticsin a new sibling moduleui/packages/plugin-grid/src/objectGridDiagnostics.ts. Q is the three authored-input diagnostics, each auseEffectwith oneconsole.warn, with their whole comment blocks:columnsentry the renderer cannot read (objectui#5349), throughdescribeUnresolvedColumns;bulkActionDefsmember (objectui#8730), throughdescribeUnusableBulkActionDefs;pagination.pageSizeor flatpageSizethat is not a positive integer (objectui#9853), throughdescribeNonPositivePageSize.Q reads only
schemaand declares nothing any other region reads, so the hook takesschema: ObjectGridSchemaand nothing else. It declares no state, adds no context and returns nothing.ObjectGridcallsuseObjectGridDiagnostics(schema)at the exact place the moved lines stood (after the column summaries, beforegenerateColumns), so the order of the component's hooks does not change. The threedescribe*import specifiers move with their only readers. No identifier is renamed. Nothing new is exported fromObjectGrid.tsx, and the package entry is untouched.ObjectGrid.tsxgoes from 6637 to 6563 lines.Move-only proof: the multiset of non-blank lines of the base
ObjectGrid.tsxequals the newObjectGrid.tsxplusobjectGridDiagnostics.ts. Nothing is missing. The only added lines are the new module's header comment, its five imports, the hook's docblock, signature and closing brace, and inObjectGrid.tsxthe new import plus the call with its two-line comment. The three edited import lines differ only by the removed specifiers.Kept away from #26341 (#25884): its
ObjectGrid.tsxedits aretemporalGroupHeadingand the seven column-cell call sites insidegenerateColumns(region R). This slice touches neither, and its only hunk in the component body ends abovegenerateColumns.Test edits
None. No test reads the moved lines as source: I checked every test that reads
ObjectGrid.tsx(the nine inplugin-grid/src/__tests__and the fourteen elsewhere that key a census row by that path), and none namesdescribeUnresolvedColumns,describeUnusableBulkActionDefs,describeNonPositivePageSizeor the three diagnostic slices. The behavioural tests that spy onconsole.warnrender the realObjectGrid, so they cover the hook.Seam table of the
ObjectGridcomponent (measured on222755eb)Lines are in the base file. "Reads" names inputs from other regions; the props and
schemaare left out. "Read by" names the regions that use what a region declares. A region after the first early return (line 3758) cannot become a hook, because a hook may not run after a conditional return; it can become a plain function or a sub-component with explicit props.data,loading,objectSchema,refreshKey,selectedRows,rowConflict, … and setterscolumnStorageKey,columnState,saveColumnStategridNonAuthorKeysreads theNON-AUTHOR SURFACE — columnStateblock here)pullRef,isRefreshing,pullDistancedataConfig,hasInlineData,externalManualPagination,objectName,objectFieldsbase-bind-declaredkeys thebindread to this file)perms,operations,canEdit,canDelete,resolvedRowActionDefs,recordVerdict, …NON-AUTHOR SURFACE — rowActionDefsblock)groupingProjectionKey,predicateProjectionKey,carriesConcurrencyToken,rowColorFieldschemaFilter,headerSort,searchTerm,querySearchTerm,serverPage,searchFieldsKeyserverGroupedFetch,groupingNeedsHeaderQuery,groupingNeedsWholeRows,fetchWindow,groupRowQueryinvalidationNonce(the effect sets B's state)findParamssyncnavigation,executeAction,getRowClassName,mayInvokeRowAction,getRowStyleNON-AUTHOR SURFACE — onNavigateblock and theonNavigate: onNavigate ?? schema.onNavigateread)groupValueFormatter,temporalGroupFacestemporalGroupHeading, which N calls)groups,isGrouped,toggleGroup,groupHeaders,serverGroupTotalbulkFanoutParams,summaries,hasSummaryschemaonly)generateColumnsgenerateColumnscolumnReadBoundary-6458,relationalMetaCopySet,cellRendererResolutionBoundary-8920,percent-storage-callers-11475,column-identity.ratchet)handleExportexportableFormats,handleExportObjectGrid.exportOptionsKeysreads theschema.exportOptionsreads here)columns,persistedColumnscolumnsWithActions, pinned column setsNON-AUTHOR SURFACE — maxInlineRowActions)orderedColumns,manualPaginationOn,manualSearchOn,effectiveFrozenColumnsbulkActionDefs,selectionMode,dispatchBulkAction,handleBulkDialogClose, …defaultRowSave,defaultBatchSave,settleRowConflictaffordanceGrantMap-12082keysObjectGrid > writeRowGuardedandObjectGrid > resolveRowConflictto this file)pageSize,manualPage,manualSort,manualOnSortChange,manualSearchdataTableSchema, grouped table schematableColumns,dataTableSchema,buildGroupedTableSchemarecordOverlayShellProps,renderRecordDetailclickableNonControlCensus-13461keys its clickabledivto this file)gridToolbarsummaryFooter,groupedPager,gridContenticonOnlyButtonCensus-12143counts two icon-only pagers in this file)renderedGridContentbulkDialog,rowConflictDialogRemaining slices (one PR each; the last closes the card)
findParamssync into a sibling hook.ObjectGrid.exportOptionsKeys; this slice needs that test to read the new module too.ObjectGrid.tsx.gridNonAuthorKeys,affordanceGrantMap-12082); moving them needs those rows re-keyed to the new file, which is more than the import-path edits the card allows. If the seat does not grant that, they stay inObjectGrid.tsxas the component's core.generateColumnsand the column pipeline into the table schema, after fix(fields,plugin-grid): a grid date column reads in one absolute face #26341 lands. Five source-reading tests pin R, so this slice needs the same allowance as slice 11, or these regions stay and slice 11 or 10 closes the card.A, B, F and M stay in the component in every plan: they are the shared state most other concerns read. Each later slice re-measures the line spans and the source-scan pins at its claim, because the file moves daily.
Verification
Run on head
fb3f7f50:pnpm --dir ui exec vitest run packages/plugin-grid/ --maxWorkers=2, the whole package suite, under the verification lock: 251 of 251 files and 2247 of 2247 tests passed after the move. The before reading is the same suite on slice 2's tested tree (the package tree ofmain222755eb): 251 of 251 files, 2247 of 2247 tests, locally and in CI on refactor(plugin-grid): move ObjectGrid's host-facing props types and FooterSummaryReport into sibling modules (slice 2) #26354.pnpm --filter @object-ui/plugin-grid type-checkexit 0.objectGridDiagnostics.tsdraws no warning at all, so the hook's dependency arrays raise noreact-hooks/exhaustive-depsfinding.pnpm --dir ui run check:doc-example-readersexit 0.node scripts/gen-sdui-manifest-node.mjs: the manifest is byte-identical (sha2561f6e1ccb…). Onlyscripts/sdui-manifest.sources/plugin-grid.jsonis re-recorded.node scripts/check-sdui-manifest.mjsexit 0.node scripts/pm/dispatch-gates.mjs --commands: 41 derived gates, all exit 0;--ranreconciles 41 of 41 (0 NOT-MEASURED, 0 UNRUN).Acceptance notes
resolvesToDataColumnabove" and "the export format warning below", about code that stays inObjectGrid.tsx. They are kept verbatim because the slice is move-only.Landing
On the plugin-grid line this goes after #26358 and #26341, so it stays a draft. Expect a merge of
mainand a re-record ofplugin-grid.jsonbefore it lands.Changeset:
.changeset/25994-objectgrid-diagnostics-hook.md(patch,@object-ui/plugin-grid).🤖 Generated with Claude Code
https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE