Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/25992-objectview-options-split.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@object-ui/app-shell': patch
---

refactor(app-shell): the Console `ObjectView`'s view-options family moves into a sibling module

Clause-②: no
Metadata-protocol: none

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.

What to do: nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ describe('calendarViewOptions — the object page forwards, it does not invent (
});

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

/**
* Executable lines only. The prose above this file's own seams names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ describe('galleryViewOptions — the object page forwards, it does not invent (o
});

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

/**
* Executable lines only. The prose above this file's own seams names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ describe('ganttViewOptions — the object page forwards, it does not invent (obj
});

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

/**
* Executable lines only. The prose above this file's own seams names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,11 @@ describe('ObjectView view-config `titleField` — the middle rung is gone (objec
});

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

/** Every `titleField:` / `labelField:` assignment in the file. */
const seamLines = SOURCE.split('\n').filter((l) => /^\s*(titleField|labelField):/.test(l));
Expand Down
479 changes: 22 additions & 457 deletions ui/packages/app-shell/src/views/ObjectView.tsx

Large diffs are not rendered by default.

466 changes: 466 additions & 0 deletions ui/packages/app-shell/src/views/objectViewOptions.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const LEDGER: Row[] = [
reason: '"Save as view": the refusal is a toast with the door\'s message, and the dialog stays open (objectui#11578).',
},
{
file: 'ObjectView.tsx', symbol: 'dispatchViewPatches', callee: 'updateView', calls: 1,
file: 'objectViewOptions.ts', symbol: 'dispatchViewPatches', callee: 'updateView', calls: 1,
kind: 'relays',
reason: 'Issues one `updateView` per patch and hands every promise back; set-as-default and reorder await them and answer for the refusal.',
},
Expand Down
Loading