`1 | [1 | 1]`, and the brackets are a real container this time. Nesting them as a GROUP was the first attempt and looked identical — a horizontal group inside a horizontal group renders three columns, because that is what it is. All it bought was which divider moved what, which is invisible until you drag one. So the pair is a panel whose component hosts its own WorkspaceView, the way DashboardPreview does. It has its own chrome, its own divider and its own persisted sizes, and the root layout has two children rather than three: the shape on screen is now the shape in the file. `useAuthoredLayout` rather than `useDashboardState`, and its own key beside the root's. The structure is the author's and comes from source every render; only sizes are the user's. Sharing one key would have the inner and outer trees persisting over each other's sizes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
59 lines
2.0 KiB
TypeScript
59 lines
2.0 KiB
TypeScript
import type { AppRegistryMeta } from 'officerdev';
|
|
import { Columns2, List, PanelRight, SlidersHorizontal } from 'lucide-react';
|
|
import { NavPanel } from './NavPanel';
|
|
import { DetailPanel } from './DetailPanel';
|
|
import { DetailHeader } from './DetailHeader';
|
|
import { EditorPanel } from './EditorPanel';
|
|
import { WorkPanel } from './WorkPanel';
|
|
|
|
/**
|
|
* Three panels: a nav, whatever it selects, and where an editor opens.
|
|
*
|
|
* They are SIBLINGS that never speak to each other — the nav writes `?section=` and the detail panel
|
|
* reads it. That is `docs/navigation-audit.md`'s rule, and it is what makes every section linkable and
|
|
* survive a reload.
|
|
*
|
|
* `availableOnPanel: false` — these belong to this plugin's screen, not to the generic panel picker.
|
|
* A "Fofos sections" panel offered on somebody's dashboard would render a nav with nothing beside it.
|
|
*/
|
|
export const appRegistryMetas: AppRegistryMeta[] = [
|
|
{
|
|
key: 'fofos-admin-nav',
|
|
name: 'Sections',
|
|
icon: List,
|
|
component: NavPanel,
|
|
availableOnPanel: false,
|
|
},
|
|
{
|
|
key: 'fofos-admin-detail',
|
|
name: 'Detail',
|
|
icon: PanelRight,
|
|
component: DetailPanel,
|
|
// The chrome header says which SECTION is open rather than the word "Detail" — see DetailHeader for
|
|
// why that replaced a second header row inside the panel.
|
|
header: DetailHeader,
|
|
availableOnPanel: false,
|
|
},
|
|
{
|
|
/*
|
|
The container the root layout points at: a workspace holding the preview and its editor.
|
|
|
|
Registered like any other panel because the outer WorkspaceView resolves by appType, and listed in
|
|
the root's allow-list. The two it contains stay registered too — the INNER workspace resolves them
|
|
the same way.
|
|
*/
|
|
key: 'fofos-admin-work',
|
|
name: 'Work',
|
|
icon: Columns2,
|
|
component: WorkPanel,
|
|
availableOnPanel: false,
|
|
},
|
|
{
|
|
key: 'fofos-admin-editor',
|
|
name: 'Editor',
|
|
icon: SlidersHorizontal,
|
|
component: EditorPanel,
|
|
availableOnPanel: false,
|
|
},
|
|
];
|