The spacing and free-text editors rendered below the preview, so they took their height from the thing being edited: choosing a spacing shrank the page you were choosing it for, and on a laptop two dropdowns cost a third of the frame. They are a third panel now, to the right of the preview. The workspace already knows how to size and move panels; a drawer was a second, worse layout system living inside one of them. The panel holds nothing. Whichever panel owns a selection BUILDS the editor and announces it through a `useGlobal` slot — the two are siblings and neither may own the other, and a provider around both would mean something above them knowing they exist. The slot carries the ELEMENT, not a description of one. A descriptor plus a switch would move every editor's loading, saving and cancelling into a panel that would have to learn what a section is — a second place that understands the page builder, kept in step by hand. SaveTarget makes the same trade for the same reason. The hazard is real and worth naming: an element captures the props it was built with, so the announcing effect must depend on everything the editor DISPLAYS. The save handlers sit in refs so they cannot drag that list wider — depending on them would re-announce on every keystroke, and omitting them without refs would announce a stale one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import type { AppRegistryMeta } from 'officerdev';
|
|
import { List, PanelRight, SlidersHorizontal } from 'lucide-react';
|
|
import { NavPanel } from './NavPanel';
|
|
import { DetailPanel } from './DetailPanel';
|
|
import { DetailHeader } from './DetailHeader';
|
|
import { EditorPanel } from './EditorPanel';
|
|
|
|
/**
|
|
* 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,
|
|
},
|
|
{
|
|
key: 'fofos-admin-editor',
|
|
name: 'Editor',
|
|
icon: SlidersHorizontal,
|
|
component: EditorPanel,
|
|
availableOnPanel: false,
|
|
},
|
|
];
|