Repository navigation
Commit 7158025
refactor(plugin-grid): move ObjectGrid's module-level helpers into sibling modules (slice 1) (#26323)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi94Cr2fbhp665MVvsYFfqYFe)_
Part of #25994 (slice 1 of the move-only split; the card stays open for
the later slices).
Clause-②: no
Metadata-protocol: none
## What moved
Base `69aa630b`. This slice moves module-level helpers, types and
constants, verbatim, out of `ui/packages/plugin-grid/src/ObjectGrid.tsx`
into six sibling modules:
- `objectGridQuery.ts`: `AuthoredGridFilters`, `HeldGridFilters`,
`resolveGridFilters`, `useResolvedGridFilters`, `findParamsSignature`
- `objectGridColumns.ts`: `CHIP_FIELD_TYPES`, `isChipFieldType`,
`resolveColumnLabel`, `normalizeColumns`, and the column emit types with
their docblocks (`RetiredListColumnKey`, `ObjectGridColumnHolds`,
`ObjectGridRetiredOptionsTombstone`, `ObjectGridColumnDraft`,
`ObjectGridColumn`)
- `objectGridLinkCell.tsx`: `LINK_CELL_CLASS`, `LINK_CELL_CLASS_WRAP`,
`rowRecordId`, `LinkCell`, `recordPointerFace`
- `objectGridTranslations.ts`: `GRID_DEFAULT_TRANSLATIONS`,
`useGridTranslation`
- `objectGridDefaults.ts`: `RowHeightMode`, `resolveRowHeightMode`,
`readSpecDisplayPageSize`, `DEFAULT_DISPLAY_PAGE_SIZE`,
`DEFAULT_FETCH_BATCH_SIZE`, `DEFAULT_SELECTION_TYPE`,
`readAuthoredPageSize`, `isUsablePageSize`, `resolvePageSize`,
`describeNonPositivePageSize`, `NO_GROUPING_REFUSAL`
- `objectGridRowVersion.ts`: `OCC_TOKEN_FIELD`, `rowVersionOf`,
`WrittenRowVersion`, `rowVersionToSend`, `RowConflictChoice`,
`BatchSaveOutcome`
898 lines move. `ObjectGrid.tsx` goes from 7689 to 6781 lines. Names the
component still reads gain the `export` keyword in their new module.
`ObjectGrid.tsx` imports them back and re-exports the four column emit
types it exported before (`RetiredListColumnKey`,
`ObjectGridColumnHolds`, `ObjectGridColumnDraft`, `ObjectGridColumn`),
so every name it exported is still importable from the same path. The
package entry (`index.tsx`) is untouched. The import specifiers whose
only readers moved now live in the new modules. No identifier is
renamed, no logic or DOM changes, and no new name is exported from
`ObjectGrid.tsx`.
Move-only proof: the multiset of non-blank lines of the base
`ObjectGrid.tsx` equals the new `ObjectGrid.tsx` plus the six modules
(each module's header comment dropped, added `export` keywords
normalised). Nothing is missing. The only other lines are import lines
and the one type re-export line.
## What stays in `ObjectGrid.tsx` on purpose
- The group-heading date region (`TemporalGroupFace`,
`temporalGroupHeading`): #25884 is editing it.
- `parseSchemaSort` (and its sibling `toOrderByClause`):
`gridArrayArmOrderby-8973.test.tsx` reads `ObjectGrid.tsx` and asserts
`export function parseSchemaSort` is in it.
- The public props types, `ObjectGridComponentProps` among them:
`bulkExecutorDataSourceFace-9722.test.ts` asserts `export interface
ObjectGridComponentProps` is in the file.
- The schema-slot types (`RemoveIndexSignature`,
`DeclaredDataTableSchema`, `ObjectGridDataTableSchemaHolds`,
`ObjectGridDataTableSchema`): `cellClassNameCensusProse-6921.test.ts`
reads the census prose in their docblock from `ObjectGrid.tsx`.
- The relational-copy-set docblock and `FooterSummaryReport`.
- `getDataConfig`, kept file-local as on `main` (commit 2978029).
Exported from a module, it becomes a shared reader for
`check:doc-example-readers`, which then flags core's `record-source.ts`
`@example`.
Re-pointing those scans would be a test-logic edit, which this card does
not allow without the seat's word, so this slice leaves them where they
are.
## Test edits
None.
## Verification
Run on head `fe3087e5`, before the merge of `main`:
- `pnpm --dir ui exec vitest run packages/plugin-grid/ --maxWorkers=2`,
the whole package suite: 251 of 251 files and 2247 of 2247 tests passed
on the base files, and the same 251 / 2247 passed after the move.
- 52 test files outside plugin-grid that read sources (every test naming
plugin-grid that scans source, every test spelling `ObjectGrid.tsx`,
plus `raw-key-call-sites-3546` and `defaults-maps-mirror-en-pack`): 52
of 52 files, 2257 of 2257 tests passed.
- `pnpm --filter @object-ui/plugin-grid type-check` exit 0; `tsc
--listFiles` includes all seven files.
- eslint on the seven files: 0 errors.
- `node scripts/gen-sdui-manifest-node.mjs`: the manifest is
byte-identical (sha256 `1f6e1ccb…`); only
`scripts/sdui-manifest.sources/plugin-grid.json` is re-recorded (38 to
44 sources).
- `node scripts/pm/dispatch-gates.mjs --commands`: 41 derived gates, all
exit 0; `--ran` reconciles 41 of 41.
After merging `main` (`f00cbe36`, 11 commits, none in `ObjectGrid.tsx`):
`check-sdui-manifest` is green and the Console builds. The full readings
are in the os-dev-report comment on the card.
## Acceptance notes
- Some moved prose still says "below" or "above", or "this file", about
code that stays in `ObjectGrid.tsx` (for example the column emit
docblock's "`generateColumns()` below"). It is kept verbatim because the
slice is move-only.
- `objectGridLinkCell.tsx` exports `rowRecordId` and `recordPointerFace`
beside the `LinkCell` component, so eslint's
`react-refresh/only-export-components` warns twice there. It is a
warning, not an error.
## Landing
This enqueues only after #25884 merges. Expect a merge of `main` and a
re-record of `plugin-grid.json` before it lands. Changed lines are about
2,000, under the 3,000 line limit.
Changeset: `.changeset/25994-objectgrid-helpers-split.md` (patch,
`@object-ui/plugin-grid`).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Bdrd2yH4eqnz2QobtN3haE)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b9cd980 commit 7158025
9 files changed
Lines changed: 993 additions & 922 deletions
File tree
- .changeset
- scripts/sdui-manifest.sources
- ui/packages/plugin-grid/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
0 commit comments