Skip to content

refactor(plugin-grid): move ObjectGrid's column generator, column post-processing and Actions column into sibling modules (slice 8) - #26806

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-70tavg
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-70tavg

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #25994 (slice 8, the last slice of the move-only split: regions R, U and V. Slices 1 to 7 have landed; this one closes the card.)

Clause-②: no
Metadata-protocol: none

维护者速读

What changes

Base 7bdff7ec (origin/main). ui/packages/plugin-grid/src/ObjectGrid.tsx is 5160 lines there. This slice moves regions R, U and V of the seam table in #26364 (re-planned in #26499), the last three blocks the card names, verbatim into three new sibling modules:

# Concern New home Inputs Returns
R generateColumns, the useCallback that turns the authored columns, or the object's fields, into column drafts (base lines 1221 to 2098) hook useObjectGridGenerateColumns in objectGridGenerateColumns.tsx 18: schema, dataSource, data, dataConfig, hasInlineData, objectName, objectSchema, objectFields, objectTypesPending, schemaFields, schemaColumns, perms, navigation, executeAction, predicateScope, resolveFieldLabel, translateOptions, uiLanguage generateColumns
U Column post-processing: field-type enrichment, the fold onto the declared column type, the user's persisted widths and order (base lines 2377 to 2557) function resolveObjectGridPersistedColumns in objectGridPersistedColumns.ts generateColumns, objectFields, objectName, perms, objectTypesPending, columnState persistedColumns
V The Actions column, its NON-AUTHOR SURFACE comment on maxInlineRowActions, and the pinned column sets (base lines 2559 to 2719) function resolveObjectGridActionsColumn in objectGridActionsColumn.tsx 22, from schema to t (listed in the module signature) columnsWithActions, hasActions, hasPinnedColumns, hasUserPinnedColumns, pinnedLeftCols, pinnedRightCols, unpinnedCols, rightPinnedClasses, rightPinnedCellClasses, userLeftPinnedCount
  • R is a hook and keeps its useCallback with the same dependency array, called where the callback stood, so the component's hook order does not change. U and V stand below the component's early returns, so they are plain functions, as on slices 5 to 7.
  • Inputs are typed from their source: ReturnType of the hook or helper that produces them (usePermissions, useNavigationOverlay, useAction, usePredicateScope, useSafeFieldLabel, useGridTranslation, useObjectGridQueryInputs, useObjectGridColumnState, useCapabilityGate, useRecordCrudVerdicts, resolveLegacyRowActions, resolveRowCrudAffordances), ObjectGridComponentProps for the host callbacks, and React's Dispatch of SetStateAction for setRefreshKey. No context.
  • Each module returns only the names the rest of the component reads.
  • Imports: the specifiers whose only readers moved leave ObjectGrid.tsx and appear in the module that reads them; two whole imports (applyRelationalMeta, resolvesToDataColumn) move. The export and export type re-exports at the top of ObjectGrid.tsx are untouched, so the package entry and every exported name are unchanged.
  • ObjectGrid.tsx goes from 5160 to 3962 lines. The diff is 2674 changed lines in 10 files.

Move-only proof. The multiset of non-blank lines of the base ObjectGrid.tsx equals the new ObjectGrid.tsx plus the three modules, except for 10 lines, all of them edited import lines in ObjectGrid.tsx that lost specifiers. Every added line is a module header or docblock, an import, a signature or parameter type, a return { … } list, or in ObjectGrid.tsx one of the three new imports and three calls with their comments.

The split, slices 1 to 8. Line counts of ObjectGrid.tsx on main after each merge:

Slice PR Moved New sibling modules Lines after
(start) 7689
1 #26323 module-level helpers, types and constants objectGridColumns.ts, objectGridDefaults.ts, objectGridLinkCell.tsx, objectGridQuery.ts, objectGridRowVersion.ts, objectGridTranslations.ts 6781
2 #26354 host-facing props types and FooterSummaryReport objectGridProps.ts 6637
3 #26364 authored-input diagnostics (seam table) objectGridDiagnostics.ts 6571
4 #26499 query inputs and grouping decisions (re-plan) objectGridQueryInputs.ts, objectGridGroupingDecisions.ts 6307
5 #26537 row load objectGridRowLoad.ts 5639
6 #26574 grouping and column summaries objectGridGrouping.ts, objectGridSummaries.ts 5250
7 #26773 row-height sync, column state, mobile affordances objectGridRowHeight.ts, objectGridColumnState.ts, objectGridMobile.ts 5160
8 this PR column generator, column post-processing, Actions column objectGridGenerateColumns.tsx, objectGridPersistedColumns.ts, objectGridActionsColumn.tsx 3962

Final count: ObjectGrid.tsx is 3962 lines, down from 7689 (48% smaller), with 19 sibling modules beside it. What remains is the component itself (state, the remaining handlers, the render) and the re-exports.

Open PRs on these files. Of the 26 open PRs, one touches ObjectGrid.tsx: #26804 (opened after this slice's claim), with hunks at the components import, the useOverlayAnchor call and the record-overlay props, none of them inside R, U or V. git merge-tree of this head with #26804's head merges with no conflict. No open PR touches the five test files or the three new modules.

Why

The card's ruling, verbatim: 「大文件互踩: 立重构卡把 ObjectView 和 ObjectGrid 拆成小模块。这个可以立卡」. One move-only slice per PR, per the card's ask 1 to 5; this is the last slice named in hand-off 6438136564 and dispatch order 6446731987, so the PR closes the card.

Tests

Five test edits, path-only, forced by the move. Each joins the moved file to the source it already read; no assertion, pattern or count changed.

  • ui/packages/plugin-grid/src/__tests__/columnReadBoundary-6458.test.ts: gridSource reads objectGridGenerateColumns.tsx and ObjectGrid.tsx joined, in that order. The ListColumn branch of generateColumns() that the scan bounds moved with R, and the order keeps the (schema as any).hideRowHeightToggle control after the region end.
  • ui/packages/plugin-grid/src/__tests__/cellRendererResolutionBoundary-8920.test.ts: the "ObjectGrid.tsx makes no direct resolver call" case reads ObjectGrid.tsx and objectGridGenerateColumns.tsx joined, because the call sites it guards moved with R.
  • ui/packages/plugin-grid/src/__tests__/relationalMetaCopySet.derivation.test.ts: the LIT CONTROL's wholeFile reads both files joined, because most fieldMeta reads moved with R. The renderCellEditor: seam stays in ObjectGrid.tsx, so the zero it asserts is unchanged.
  • ui/packages/plugin-grid/src/__tests__/gridNonAuthorKeys.test.tsx: the control case also reads objectGridActionsColumn.tsx, because the NON-AUTHOR SURFACE comment on maxInlineRowActions moved with V.
  • ui/packages/core/src/utils/__tests__/column-identity.ratchet.test.ts: the CONVERGED entry follows columnIdentity( from plugin-grid/src/ObjectGrid.tsx to plugin-grid/src/objectGridGenerateColumns.tsx.

percent-storage-callers-11475 needs no edit: formatPercent stays in the mobile card in ObjectGrid.tsx, and none of the moved lines call it. I matched every string literal of every tracked test and script against the lines that left ObjectGrid.tsx; the other hits were generic words or behavioural tests, and all of them ran green below.

Acceptance notes

  • Some parameter types are any, copied from the component's own declarations: data is an any-typed array and objectSchema is any in the component's useState calls, and objectFields is declared in the component as a record of any or undefined. The new parameters spell those same types, which is the 6 new no-explicit-any warnings. Narrowing them would go beyond a move.
  • eslint on the four files: 0 errors; warnings 179 before, 185 after (the 6 above). Unlike the earlier hook slices, no React lint finding is hidden this time: the exhaustive-deps finding on generateColumns (missing navigation and schema.showColumnTypeIcons) is raised in the new module exactly as before, and the other findings are the same at shifted lines.
  • R's module is .tsx and V's is .tsx because they hold JSX; U's is .ts. The claim said objectGrid*.ts.
  • Moved comments that point "below" or "above" are kept verbatim. Most remain true inside the module; renderCellEditor "(below)" in objectGridPersistedColumns.ts now lives in ObjectGrid.tsx.
  • objectGridActionsColumn.tsx imports ObjectGridComponentProps from ./ObjectGrid as a type only, so no runtime cycle is added.

Verification

Run on head ab6ff716:

  • pnpm --dir ui exec vitest run packages/plugin-grid/ --maxWorkers=2 under the verification lock: 253 of 253 files, 2256 of 2256 tests after the move. Before: the same command on base 7bdff7ec (a separate worktree, deps built): 253 of 253 files, 2256 of 2256 tests.
  • The 109 test files outside plugin-grid that read source trees (every ui test that reads files and names plugin-grid or walks the package roots, including column-identity.ratchet, percent-storage-callers-11475, affordanceGrantMap-12082, catalog-gallery-render and registry-inputs-spec-parity): 109 of 109 files, 3413 of 3413 tests.
  • pnpm --filter @object-ui/plugin-grid type-check exit 0, after turbo run build --filter='@object-ui/plugin-grid^...'.
  • The Type Check UI job's 17 check:* steps plus type-check:coverage: all exit 0 (check:spec-symbols and check:doc-example-readers included; no new local type shares a spec name, and no single-return wrapper is exported). pnpm check:changeset-fixed exit 0.
  • pnpm --dir ui run check:new-line-citations (report-only, exit 0) reports 1 new citation: apps/console/src/dev/DevRowActions.tsx:51 in objectGridActionsColumn.tsx. It is not new prose; the comment moved verbatim with V, and the gate counts it because it changed files. It is kept as it was, since rewording it would not be move-only.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 35 derived commands, all exit 0. pnpm --dir ui exec vitest run scripts/ under the lock: 178 passed and 2 skipped files, 5065 passed and 2 skipped tests. Its first run hit a 15-second timeout in one check-i18n-dead-keys real-tree case while the gate list ran beside it; the rerun alone was green. --ran reconciles 35 of 35 (0 NOT-MEASURED, 0 UNRUN); the Type Check UI commands above are recorded as outside the derivation.

Changeset: .changeset/25994-objectgrid-columns-modules.md (patch, @object-ui/plugin-grid).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; eslint on the touched files reports 0 errors.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec not touched.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the maintainer quick-read section and the quoted ruling are Chinese by rule).

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbXqCPeUA7ztE9YWKwP


Generated by Claude Code

…t-processing and Actions column into sibling modules

Slice 8 of the move-only ObjectGrid split: regions R, U and V move verbatim
into useObjectGridGenerateColumns, resolveObjectGridPersistedColumns and
resolveObjectGridActionsColumn, called where the lines stood. Five source
pins re-point their path to the new modules.

Claude-Session: https://claude.ai/code/session_01JQwxbXqCPeUA7ztE9YWKwP
Co-authored-by: Claude <noreply@anthropic.com>
…ectGrid.tsx no longer reads

Claude-Session: https://claude.ai/code/session_01JQwxbXqCPeUA7ztE9YWKwP
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling labels Oct 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

维护者速读

  • 改了什么:ObjectGrid.tsx 最后三段代码(列生成 generateColumns、列后处理与持久化宽度/顺序、操作列与固定列集合)原样搬进三个同目录模块(objectGridGenerateColumns.tsx、objectGridPersistedColumns.ts、objectGridActionsColumn.tsx),组件在原位置按原顺序调用。
  • 为什么改:执行维护者「大文件互踩: 立重构卡把 ObjectView 和 ObjectGrid 拆成小模块。这个可以立卡」,第 8 片也是最后一片;文件 7689 → 3962 行,共 19 个同目录模块,本 PR 关闭 [maintainer] refactor(ui): split ObjectGrid.tsx (7641 lines) into smaller modules, one move-only slice per PR, so concurrent ui cards stop colliding in it #25994。
  • 风险与回滚:纯搬移,无逻辑、命名、渲染变化,hook 顺序不变;直接 revert 即可。
  • 先看:objectGridGenerateColumns.tsx(唯一含 hook 的新模块,useCallback 依赖原样)。
  • 两分钟验证:plugin-grid 测试套 253 文件 / 2256 用例前后一致;109 个外部读取方 3413/3413。
  • 需要你做的:无,席位落地。
  • 席位意见:席位独立复算搬移证明:基点删除的 953 条非空行全部出现在三个新模块里,唯一差异是 import 行随搬移拆分。

席位核对

ACCEPT · seat domain:ui#1 · session_01JQwxbZeBv2y91towxasSUT · head ab6ff716 · 2026-10-27T17:07Z

  1. Shape: move-only slice 8 (regions R, U, V) of [maintainer] refactor(ui): split ObjectGrid.tsx (7641 lines) into smaller modules, one move-only slice per PR, so concurrent ui cards stop colliding in it #25994, Fixes #25994; 10 files, +1435/−1239 (2674 changed lines, under the 3000-line threshold); three new sibling modules called where their blocks stood; five pins re-pointed path-only (they now read ObjectGrid.tsx together with the module that holds their lines); patch changeset in the root .changeset/.
  2. Premise measured: the seat recomputed the move proof on 7bdff7ec...ab6ff716: of the 953 distinct non-blank lines removed from ObjectGrid.tsx, every one is present in the three new modules except 10 import lines, which ObjectGrid.tsx re-adds narrowed (the moved code imports what it uses). Lines added to ObjectGrid.tsx are only those imports, the three calls and their pointer comments. Only useObjectGridGenerateColumns holds a hook (useCallback), and it is called at the old site, so the hook order is unchanged.
  3. Gates / check-runs: On head ab6ff716, 43 success · 9 skipped · 0 failed · 0 pending; mergeable_state: clean. Dev's local run: dispatch-gates 35/35 exit 0, --ran 0 NOT-MEASURED; 17 Type Check UI check:* steps and coverage exit 0.
  4. Accepted deviations: six any-typed params in the new modules are copied from the component's own declarations (lint/types: 14,366 no-explicit-any warnings can never red CI — make it an error on packages/types/src, delete the vestigial (schema as any) reads, and type ComponentRendererProps with unknown #25918 carries any); one moved comment counts as a new line citation (report-only). feat(spec,ui)!: a record opens one way per object — navigation.mode keeps drawer (the default), page, new_window and none; modal, split and popover are retired; the split pane becomes a reader preference #26804 also edits ObjectGrid.tsx, outside R/U/V; the dev's git merge-tree merges clean.
  5. Out of scope: none filed. Skills-docs: none — move-only, no metadata-protocol change.
  6. Landing: not Tier H (no governed path); the seat readies and arms auto-merge. The merge closes [maintainer] refactor(ui): split ObjectGrid.tsx (7641 lines) into smaller modules, one move-only slice per PR, so concurrent ui cards stop colliding in it #25994.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 27, 2026 17:09
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 27, 2026 17:09
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit f79ec28 Oct 27, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-70tavg branch October 27, 2026 17:57
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/xl tests tooling

Projects

None yet

2 participants