Repository navigation
fix(plugin-grid): in design mode, a grid's row menus preview the staged record action order - #39206
Conversation
…arrangement The grid reads a host-staged actionLayout ahead of the served one through a new StagedActionLayoutProvider / useStagedActionLayout context; the app shell mounts a bridge in ConsoleLayout that feeds it the staged object-pins changes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
…pty staged value in the pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
|
repo:objectstack@os-bill · os-bill · session_01Utp6CZQVVFKDKH894psuGy Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
One must-fix (M-1), one should-fix (S-1). Re-read on the delta. Implemented-by: VERDICT: FAIL |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CZQVVFKDKH894psuGy 席位核对REWORK at 2026-12-03T00:00Z · head
|
…bpath ConsoleLayout mounted the staged-arrangement bridge through the plugin-grid entry, which put the whole grid into every Console first load. The provider and hook now also publish from @object-ui/plugin-grid/core; the ESM build is one two-entry preserveModules pass so both entries share one context. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
… mount pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZe6nrJNhDWis7DxWq
|
repo:objectstack@os-bill · os-bill · session_01Utp6CZQVVFKDKH894psuGy Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Nits N-a, N-b, N-d, N-e, N-f and N-g are left to the lane seat. N-e merits a follow-up card. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CZQVVFKDKH894psuGy 席位核对ACCEPT at 2026-12-03T01:00Z · head
|
Requested by Bill · project thread
repo:objectstack@os-bill · os-bill · session_01Utp6CZe6nrJNhDWis7DxWq
Fixes #36820
Clause-②: yes (widening) — new exports only:
StagedActionLayoutProvider,useStagedActionLayoutand the typesStagedActionLayout,StagedActionLayouts,StagedActionLayoutProviderPropson@object-ui/plugin-grid, and the same five on its new side-effect-free subpath@object-ui/plugin-grid/core(a new./coreentry in theexportsmap); nothing removed or renamedMetadata-protocol: none
Ruling-ref: 7176918387 — 「A:
@object-ui/plugin-gridexports a small context: a provider plus a hook that reads by object name.ObjectGridreads it before the server'sactionLayout.record. app-shell mounts a bridge once inConsoleLayout, throughDesignModeHeaderPins, that reads the staged object-pins edit.」维护者速读
What changes
ui/packages/plugin-grid/src/stagedActionLayout.tsx(new):StagedActionLayoutProviderholds the host's staged arrangements by object name (aReadonlyMapfrom object name toStagedActionLayout), anduseStagedActionLayout(objectName)reads one,undefinedwith no provider, no name, or nothing staged.ObjectGrid.tsx: the row-menu rank (rankRowActionDefs, from Row menu and right-click menu follow the object action layout's record order (after #36366) #36494) reads the staged arrangement'srecordarm ahead of the servedobjectSchema.actionLayout.record. A staged value replaces the served one whole, as the record header'suseObjectPinsreads it (staged ?? servedPins(objectDef)), so a staged value with norecordarm means no arm. Three added lines plus the import; the hook sits beside the existinguseMemo, above every early return.index.tsx: the two values and three types are exported (the ruled widening).src/core.ts(new, rework round 1): the@object-ui/plugin-grid/coresubpath, re-exporting only./stagedActionLayout; it registers nothing and reaches no grid renderer.package.jsonadds the./coreentry toexports. The build follows@object-ui/plugin-detail/core:vite.config.tsnow emits the UMD build only, and the newvite.es.config.tsemitsdist/index.jsanddist/core.jsfrom one pass withpreserveModules, so both entries import the onedist/stagedActionLayout.jsand share ONE context (measured on the local build:dist/core.jsis a re-export of./stagedActionLayout.js, anddist/ObjectGrid.jsimportsuseStagedActionLayoutfrom the same file).designModeHeaderPinsModel.ts:stagedPinsByObject(changes)lifts everyobject-pins:NAMEchange out of the mode's staged changes, by object name, the staged value by reference;pinsChangeKeynow shares the prefix constant.DesignModeHeaderPins.tsx:DesignModeStagedPinsBridge(changesprop) memoizes that map and provides it, importing the provider from@object-ui/plugin-grid/core, never the package root.ui/apps/console/vite.config.tsandui/vitest.config.mts: the/corealias (before the root alias, as for the other/coresubpaths), and aplugin-grid-corechunk group taking exactlycoreandstagedActionLayout, so the two modules do not ride in theplugin-gridchunk.ConsoleLayout.tsx: the bridge is mounted once, directly insideDesignModeProvider, feddesignMode.changes. The controller already answers an empty map while the mode is off, so a page outside the mode provides an empty map and every grid lists by the served arm. Cancel and a save empty the map, so the menus go back with no code of their own..changeset/36820-staged-row-menu-order.md:@object-ui/plugin-gridpatch (Metadata-protocol: none), same shape as the widening precedent.changeset/38895-phone-related-list-card-columns.md.The new export goes on
@object-ui/plugin-grid, not on app-shell: app-shell depends on plugin-grid, so the grid cannot import the store.Correction (rework round 1): the first head put the grid into every first load
The first head said "
plugin-gridis already an eager chunk of the Console … the bridge adds no chunk". That was wrong: the Console keeps the grid entry lazy (apps/console/src/register-plugins.ts, the comment above theobject-gridstub), andobjectViewPageHeader.tsxsits behind a lazy route chunk.ConsoleLayoutis eager, so importing the bridge's provider from the package root pulled the whole grid in. Eager closure, as the Build & E2E UI job reports it:plugin-grideager398a7985(docs-only #39218, job 143904469435)4697380f(job 143874536637)96516ffd(job 143903761671)plugin-grid-core(gzip 0.23 KB) is,plugin-grid(gzip 207.24 KB) is emitted and lazyThe shell now imports the provider from
@object-ui/plugin-grid/coreonly. Against the same-base reading the closure is +2,026 bytes and +2 eager chunks:plugin-grid-core(0.23 KB) and, by the chunk-name diff against #39218 (inferred, per the L2 record),recordCommentsPanel(1.69 KB), the successor of the base's lazyDesignModeHeaderPinsshared chunk, now eager becauseConsoleLayoutreachesDesignModeHeaderPins.tsxstatically where the ruling places the bridge. The aggregate gate reads1870.7 KB measured / 2196.3 KB ceiling.Tests
ui/packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx: a new top-level describe in the shared harness (the realObjectGrid→data-table→RowActionMenuchain);renderGridtakes an optionalstagedmap and wraps the tree in the provider only when given one.recordarm leads the "⋮" and the context menu, in the staged order, over a served arm that orders them differently;recordarm replaces the served arm whole: both menus list in their own order;ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx: the harness now mounts the bridge asConsoleLayoutdoes, with a readout of what a grid reads; a new describe:ui/packages/app-shell/src/layout/__tests__/ConsoleLayout.stagedPins-36820.test.tsx(new, round 1): the mount itself, through the realConsoleLayout: an arrangement a page stages under the mode reaches the grid hook on that page, for its object only; Cancel drops it; control: outside the mode nothing is staged.ui/packages/app-shell/src/__tests__/pluginCoreSubpaths-33581.test.ts(round 1): the grid's/corejoins the scanned subpaths (no shell or console source importsStagedActionLayoutProvideroruseStagedActionLayoutfrom the root; floors on the two names and on at least one/coreimporter), andConsoleLayout.tsxandDesignModeHeaderPins.tsxjoin the always-eager modules that may import no plugin entry by value. This is the source-level pin that keepsplugin-gridout of the eager closure; the bundle-level lazy-chunk list inscripts/check-eager-closure-budget.mjs(LAZY_CHAT_CHUNKS) is chat-specific and was not extended here.ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts:stagedPinsByObjectkeeps onlyobject-pins:keys with a non-empty name and an object value, by reference; control: nothing staged lists nothing.Acceptance notes
@object-ui/plugin-gridfull package test was not run locally (the run passed the container's 10-minute bound); CI's affected run selected the package and passed on the first head.Verification
Two-minute check:
cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx -t 36820, expect 3 passed.Files to read first:
ui/packages/plugin-grid/src/ObjectGrid.tsx(the staged read beforerecordArmKey),ui/packages/app-shell/src/layout/DesignModeHeaderPins.tsx(DesignModeStagedPinsBridge),ui/packages/plugin-grid/src/stagedActionLayout.tsx.Tests run (local, head 4697380)
cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx -t "36820|36494": 5 passed, 18 skipped.cd ui && pnpm exec vitest run packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts: 2 files, 22 passed (before the two model cases were added); the model file then 12 passed.cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/{BulkActionBar,rowContextMenu-28434,gridNonAuthorKeys}.test.tsx packages/plugin-grid/src/__tests__/{resolveBulkActions,rowActionArrangement-36494}.test.ts packages/app-shell/src/layout/__tests__/: 184 files, 1741 passed.pnpm --filter @object-ui/plugin-grid type-check && pnpm --filter @object-ui/app-shell type-check: exit 0 (bothtsc --noEmitand thetsconfig.test.jsonpass).Round 1 (heads 0cd9b14, 96516ff): tests, ablation, gates
cd ui && pnpm exec vitest run packages/app-shell/src/layout/__tests__/ConsoleLayout.stagedPins-36820.test.tsx packages/app-shell/src/__tests__/pluginCoreSubpaths-33581.test.ts packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx: 4 files, 41 passed.ConsoleLayout.tsxfed the bridge an empty map (blob 5190f388 → c6be3098): reach and Cancel red, control green (2 failed, 1 passed); restored to the HEAD blob 5190f388.DesignModeHeaderPins.tsximported the provider from the package root (blob aa48a312 → f98fda46): all 3pluginCoreSubpaths-33581cases red, namingDesignModeHeaderPins.tsx(root import of a/corename; root import in an always-eager module; zero/coreimporters); restored to the HEAD blob aa48a312.pnpm --filter @object-ui/plugin-grid build: exit 0;dist/core.js,dist/core.d.ts,dist/stagedActionLayout.js,dist/index.js,dist/index.umd.cjs,dist/index.csspresent.dispatch-gates --commandsnow derives 63 families (thepackage.jsonedit adds 24). 60 ran locally with exit 0 on 0cd9b14.pnpm check:test-source-aliaswas red there (exit 1, and CI's Lint job on 14343d4 said the same): the new mount pin reachesimport('@object-ui/plugin-grid')through the chat dock without paying it at collection. Fixed at 96516ff with a module-topimport '@object-ui/plugin-grid'in that test, as the gate prescribes; re-run exit 0, and the pin 3 passed.pnpm check:query-options-erasurehit a local 300 s bound once, then exit 0 on a 580 s bound.pnpm --dir ui exec vitest run scripts/NOT MEASURED locally this round (green in round 0; CI runs it).Round 0 ablation (one-shot, red, then restored), via scripts/ablation-replace.mjs
ObjectGrid.tsx, anchor landed 1 → 0, blob 1121e04b → 24957e9c): the two staged cases red, the control green (2 failed, 1 passed). Restored to the HEAD blob 1121e04b;git diff HEADempty.stagedPinsByObject(changes)replaced by an empty map (DesignModeHeaderPins.tsx, blob 406247ba → e0cfcf90): the reach and Cancel cases red, the control green (2 failed, 1 passed). Restored to the HEAD blob 406247ba;git diff HEADempty.Gates
node scripts/pm/dispatch-gates.mjs --commandsderived 39 families for this diff; all 39 ran locally on the tree of head 4697380, each exit 0 (exit captured before any pipe), includingpnpm check:nul-bytes,check:published-files,check:cross-package-test-inputs,check:test-source-alias,check:type-check-coverage,check:type-check-debt,check:undeclared-dep-imports,node scripts/check-empty-changeset.mjs --base origin/main,node scripts/check-changeset-no-major.mjs --base origin/main,node scripts/check-sdui-manifest.mjs, andpnpm --dir ui exec vitest run scripts/(172 files passed, 2 skipped).dispatch-gates --ran: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN. The repo-wide lint and the full farm are CI's.