Skip to content

Commit ed7146b

Browse files
committed
refactor(app-shell): move ObjectView's renderListView into a sibling hook
Move-only split of ObjectViewInner: renderListView, the column-declaration flags and the held list identity refs only it reads, and the lazy ObjectChart it mounts go to useObjectViewListRenderer in objectViewListRenderer.tsx, called where renderListView stood. Six source-scan tests read the new file (path or file-list changes only). Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8cac64f commit ed7146b

9 files changed

Lines changed: 975 additions & 831 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 `renderListView` moves into a sibling hook
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`renderListView`, the callback the plugin `ObjectView` calls to draw a view through `ListView` (and a chart view through `ObjectChart`), moves verbatim out of `ObjectViewInner` in `views/ObjectView.tsx` into `useObjectViewListRenderer` in `objectViewListRenderer.tsx`. The column-declaration flags and the held list identity refs that only it reads move with it. The component passes every input in and reads the returned callback. No logic, name or rendered output changes, and the package entry is unchanged.
11+
12+
What to do: nothing.

‎ui/packages/app-shell/src/views/ObjectView.overlayPatchOnly.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ describe('objectui#5233 — what must NOT be narrowed', () => {
308308
*/
309309
describe('objectui#12504 census — the toolbar-to-view write family is retired', () => {
310310
const here = path.dirname(fileURLToPath(import.meta.url));
311-
const objectViewCode = stripComments(readFileSync(path.join(here, 'ObjectView.tsx'), 'utf8'));
311+
const objectViewCode = stripComments(['ObjectView.tsx', 'objectViewListRenderer.tsx'].map((file) => readFileSync(path.join(here, file), 'utf8')).join('\n'));
312312
const dataSourceCode = stripComments(
313313
readFileSync(path.join(here, '..', '..', '..', 'types', 'src', 'data.ts'), 'utf8'),
314314
);

‎ui/packages/app-shell/src/views/ObjectView.relayRungCensus-7559.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const sourceOf = (fromRoot: string, fromPackage: string): string => {
131131
return readFileSync(path, 'utf8');
132132
};
133133

134-
const RELAY_SOURCE = sourceOf('packages/app-shell/src/views/ObjectView.tsx', 'src/views/ObjectView.tsx');
134+
const RELAY_SOURCE = sourceOf('packages/app-shell/src/views/objectViewListRenderer.tsx', 'src/views/objectViewListRenderer.tsx');
135135
const UPSTREAM_SOURCE = sourceOf('packages/plugin-view/src/ObjectView.tsx', '../plugin-view/src/ObjectView.tsx');
136136
const TYPES_SOURCE = sourceOf('packages/types/src/objectql.ts', '../types/src/objectql.ts');
137137
const LIST_VIEW_SOURCE = sourceOf('packages/plugin-list/src/ListView.tsx', '../plugin-list/src/ListView.tsx');
@@ -225,7 +225,7 @@ const collectLiteral = (literal: ts.ObjectLiteralExpression, prefix: string, out
225225
};
226226

227227
const relayLiteral = ((): ts.ObjectLiteralExpression => {
228-
const sf = parse('ObjectView.tsx', RELAY_SOURCE);
228+
const sf = parse('objectViewListRenderer.tsx', RELAY_SOURCE);
229229
let found: ts.ObjectLiteralExpression | null = null;
230230
const visit = (node: ts.Node): void => {
231231
if (
@@ -244,7 +244,7 @@ const relayLiteral = ((): ts.ObjectLiteralExpression => {
244244
if (!found) {
245245
throw new Error(
246246
'objectui#7559 census cannot find the relay literal `const fullSchema = { … }` in\n'
247-
+ 'app-shell/src/views/ObjectView.tsx. The census anchors on that name. If the literal was\n'
247+
+ 'app-shell/src/views/objectViewListRenderer.tsx. The census anchors on that name. If the literal was\n'
248248
+ 'renamed or moved, re-point this anchor — ⛔ do not delete the census, which is the only\n'
249249
+ 'thing standing between a dropped rung and silence (objectui#7199, #7218, #7516).',
250250
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ describe('ObjectView view-config `titleField` — the middle rung is gone (objec
314314
describe('the seven seams share ONE expression shape (objectui#6557)', () => {
315315
// This face spans `ObjectView.tsx` and the view-options family it imports
316316
// from `objectViewOptions.ts` (objectstack#25992 slice 2), so the scan reads both.
317-
const SOURCE = ['ObjectView.tsx', 'objectViewOptions.ts']
317+
const SOURCE = ['ObjectView.tsx', 'objectViewOptions.ts', 'objectViewListRenderer.tsx']
318318
.map((file) => readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), file), 'utf8'))
319319
.join('\n');
320320

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

Lines changed: 40 additions & 823 deletions
Large diffs are not rendered by default.

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

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

‎ui/packages/app-shell/src/views/view-filter-fold.ratchet.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const here = path.dirname(fileURLToPath(import.meta.url));
4343
const objectViewPath = path.join(here, 'ObjectView.tsx');
4444
const widgetsPath = path.join(here, 'metadata-admin/widgets.tsx');
4545

46-
const objectViewSrc = readFileSync(objectViewPath, 'utf8');
46+
const objectViewSrc = [objectViewPath, path.join(here, 'objectViewListRenderer.tsx')].map((file) => readFileSync(file, 'utf8')).join('\n');
4747
const widgetsSrc = readFileSync(widgetsPath, 'utf8');
4848

4949
/**

‎ui/packages/types/src/__tests__/object-view-unmirrored-keys-7779.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ describe('objectui#7924 — the unread members, in the FOUR buckets the ruling w
20502050
*/
20512051

20522052
const LISTVIEW = 'packages/plugin-list/src/ListView.tsx';
2053-
const APP_SHELL_OBJECT_VIEW = 'packages/app-shell/src/views/ObjectView.tsx';
2053+
const APP_SHELL_OBJECT_VIEW = 'packages/app-shell/src/views/objectViewListRenderer.tsx';
20542054

20552055
/** A named view's one required member; every literal below is a delta on it. */
20562056
const BASE_VIEW = { label: 'All' } as const;

‎ui/packages/types/src/__tests__/tree-view-config-readers-8253.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const read = (rel: string) => readFileSync(join(REPO_ROOT, rel), 'utf8');
7777
const RESOLVER = 'packages/plugin-tree/src/ObjectTree.tsx';
7878
const VIEW_BRANCH = 'packages/plugin-view/src/ObjectView.tsx';
7979
const LIST_BRANCH = 'packages/plugin-list/src/ListView.tsx';
80-
const CONSOLE_COMPOSITION = 'packages/app-shell/src/views/ObjectView.tsx';
80+
const CONSOLE_COMPOSITION = 'packages/app-shell/src/views/objectViewListRenderer.tsx';
8181

8282
/**
8383
* The declared keys, as a value — `it.each` needs one, and a failure named

0 commit comments

Comments
 (0)