Skip to content

Commit 96635f5

Browse files
refactor(app-shell): move ObjectView's view-options family into objectViewOptions.ts (slice 2) (#26233)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9VtKf3F9dzJPJM4RRtABaEc)_ Part of #25992 (slice 2 of the move-only split; slice 1 landed as #26152, and the card stays open for any later slice). Clause-②: no Metadata-protocol: none ## What moved Base `d00215f6` (slice 1 merged). This slice moves the view-options family and the view-patch dispatcher, verbatim, out of `ui/packages/app-shell/src/views/ObjectView.tsx` into a new sibling module `ui/packages/app-shell/src/views/objectViewOptions.ts`: - `timelineViewOptions`, `calendarViewOptions`, `ganttViewOptions`, `galleryViewOptions`, `kanbanViewOptions` (with the shared docblocks above them) - `storedLegacyOptions` - `isSameOptionsValue` (was file-local; it gains the `export` keyword because the component still calls it, and `ObjectView.tsx` does NOT re-export it, so no new name is published from there) - `dispatchViewPatches` `ObjectView.tsx` imports all eight back and re-exports the seven names it exported before, from the same path. The package entry is untouched. `detectStatusField` is imported by the new module instead of `ObjectView.tsx` (its only reader moved). `ObjectView.tsx` goes from 3689 to 3254 lines. Move-only proof: the multiset of non-blank lines of the base `ObjectView.tsx` equals new `ObjectView.tsx` plus `objectViewOptions.ts`, after normalising the one added `export` keyword. Nothing is missing; the only added lines are the new module's header comment, the import and re-export blocks, and their one-line comment. ## Test edits (all forced by the move, as the claim allows) 1. `ObjectView.calendarBinding-7029.test.tsx`, the "no invented calendar field name survives in the source" scan 2. `ObjectView.galleryBinding-7547.test.tsx`, the "no invented gallery cover name survives in the source" scan 3. `ObjectView.ganttBinding-7070.test.tsx`, the "no invented gantt date name survives in the source" scan 4. `ObjectView.titleFieldConvergence.test.tsx`, the "the seven seams share ONE expression shape" scan Each `readFileSync` of `ObjectView.tsx` now reads `ObjectView.tsx` and `objectViewOptions.ts` and joins them. Reading both, not only the new module, keeps every scan over exactly the lines it read before: the titleFieldConvergence count ("exactly six") spans four seams that moved and two (map, tree) that stay in the component, and the calendar/gantt/gallery tripwires keep covering the component's own relay. No assertion changed. 5. `writeRefusalCensus-11583.test.ts`: the `LEDGER` row for `dispatchViewPatches` (callee `updateView`, kind `relays`) is keyed `file: 'objectViewOptions.ts'` instead of `'ObjectView.tsx'`. The `handleSetDefaultView` row that calls it stays on `ObjectView.tsx`. No other test file changed. ## Verification See the os-dev-report comment on the card for the full readings. In short: every test file under `ui/packages/app-shell/src/views/` plus the 7 source-reading tests outside it passed (1160 files); app-shell `type-check`; eslint on the 7 touched files with 0 errors; the 35 derived dispatch gates; a Console build after merging the latest main. ## Acceptance notes - Some moved prose still says "below" or "above" about the relay in `ObjectView.tsx` (for example the `storedLegacyOptions` docblock's "The relay below"). It is kept verbatim because the slice is move-only; the relay is now in the sibling file. - `ObjectView.unboundAdapterCall.test.ts` still scans only `ObjectView.tsx` for a detached adapter write. `dispatchViewPatches` itself calls through the object, and the census row above still pins it. Changeset: `.changeset/25992-objectview-options-split.md` (patch, `@object-ui/app-shell`). --- _Generated by [Claude Code](https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent b5d137a commit 96635f5

8 files changed

Lines changed: 521 additions & 474 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
refactor(app-shell): the Console `ObjectView`'s view-options family moves into a sibling module
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The per-kind `options` blocks `views/ObjectView.tsx` hands `ListView` (`timelineViewOptions`, `calendarViewOptions`, `ganttViewOptions`, `galleryViewOptions`, `kanbanViewOptions`), `storedLegacyOptions`, the by-value options comparison and `dispatchViewPatches` move verbatim into `objectViewOptions.ts` beside it. No logic, name or rendered output changes. `ObjectView.tsx` re-exports every name it exported before, and the package entry is unchanged.
11+
12+
What to do: nothing.

‎ui/packages/app-shell/src/views/ObjectView.calendarBinding-7029.test.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ describe('calendarViewOptions — the object page forwards, it does not invent (
106106
});
107107

108108
describe('no invented calendar field name survives in the source (objectui#7029)', () => {
109-
const SOURCE = readFileSync(
110-
path.join(path.dirname(fileURLToPath(import.meta.url)), 'ObjectView.tsx'),
111-
'utf8',
112-
);
109+
// This face spans `ObjectView.tsx` and the view-options family it imports
110+
// from `objectViewOptions.ts` (objectstack#25992 slice 2), so the scan reads both.
111+
const SOURCE = ['ObjectView.tsx', 'objectViewOptions.ts']
112+
.map((file) => readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), file), 'utf8'))
113+
.join('\n');
113114

114115
/**
115116
* Executable lines only. The prose above this file's own seams names

‎ui/packages/app-shell/src/views/ObjectView.galleryBinding-7547.test.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ describe('galleryViewOptions — the object page forwards, it does not invent (o
152152
});
153153

154154
describe('no invented gallery cover name survives in the source (objectui#7547)', () => {
155-
const SOURCE = readFileSync(
156-
path.join(path.dirname(fileURLToPath(import.meta.url)), 'ObjectView.tsx'),
157-
'utf8',
158-
);
155+
// This face spans `ObjectView.tsx` and the view-options family it imports
156+
// from `objectViewOptions.ts` (objectstack#25992 slice 2), so the scan reads both.
157+
const SOURCE = ['ObjectView.tsx', 'objectViewOptions.ts']
158+
.map((file) => readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), file), 'utf8'))
159+
.join('\n');
159160

160161
/**
161162
* Executable lines only. The prose above this file's own seams names

‎ui/packages/app-shell/src/views/ObjectView.ganttBinding-7070.test.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ describe('ganttViewOptions — the object page forwards, it does not invent (obj
116116
});
117117

118118
describe('no invented gantt date name survives in the source (objectui#7070)', () => {
119-
const SOURCE = readFileSync(
120-
path.join(path.dirname(fileURLToPath(import.meta.url)), 'ObjectView.tsx'),
121-
'utf8',
122-
);
119+
// This face spans `ObjectView.tsx` and the view-options family it imports
120+
// from `objectViewOptions.ts` (objectstack#25992 slice 2), so the scan reads both.
121+
const SOURCE = ['ObjectView.tsx', 'objectViewOptions.ts']
122+
.map((file) => readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), file), 'utf8'))
123+
.join('\n');
123124

124125
/**
125126
* Executable lines only. The prose above this file's own seams names

‎ui/packages/app-shell/src/views/ObjectView.titleFieldConvergence.test.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,11 @@ describe('ObjectView view-config `titleField` — the middle rung is gone (objec
312312
});
313313

314314
describe('the seven seams share ONE expression shape (objectui#6557)', () => {
315-
const SOURCE = readFileSync(
316-
path.join(path.dirname(fileURLToPath(import.meta.url)), 'ObjectView.tsx'),
317-
'utf8',
318-
);
315+
// This face spans `ObjectView.tsx` and the view-options family it imports
316+
// from `objectViewOptions.ts` (objectstack#25992 slice 2), so the scan reads both.
317+
const SOURCE = ['ObjectView.tsx', 'objectViewOptions.ts']
318+
.map((file) => readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), file), 'utf8'))
319+
.join('\n');
319320

320321
/** Every `titleField:` / `labelField:` assignment in the file. */
321322
const seamLines = SOURCE.split('\n').filter((l) => /^\s*(titleField|labelField):/.test(l));

‎ui/packages/app-shell/src/views/ObjectView.tsx‎

Lines changed: 22 additions & 457 deletions
Large diffs are not rendered by default.

‎ui/packages/app-shell/src/views/objectViewOptions.ts‎

Lines changed: 466 additions & 0 deletions
Large diffs are not rendered by default.

‎ui/packages/app-shell/src/views/writeRefusalCensus-11583.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const LEDGER: Row[] = [
8383
reason: '"Save as view": the refusal is a toast with the door\'s message, and the dialog stays open (objectui#11578).',
8484
},
8585
{
86-
file: 'ObjectView.tsx', symbol: 'dispatchViewPatches', callee: 'updateView', calls: 1,
86+
file: 'objectViewOptions.ts', symbol: 'dispatchViewPatches', callee: 'updateView', calls: 1,
8787
kind: 'relays',
8888
reason: 'Issues one `updateView` per patch and hands every promise back; set-as-default and reorder await them and answer for the refusal.',
8989
},

0 commit comments

Comments
 (0)