Files
atelier/web/panels.ts
T
pastilhas 2726541ede providers is a panel, not a section in officer's settings
`IntegrationsSettings/index.tsx` has carried the rule since email was extracted
on 2026-08-18: a plugin contributes panels, not settings sections. the
extraction brief said the opposite and the brief was wrong.

settings living in the platform mean this plugin is not self-contained — it
cannot be configured on an older platform, and uninstalling would leave a dead
"Atelier" section in the settings screen for someone to delete by hand.

so: a fourth panel, `atelier-providers`, and the default layout stacks it under
Collections in the right column. smallest and last because it is configured once
and then ignored — but it has to be REACHABLE, which is the whole point.

Generate's empty state pointed at "Settings → Integrations → Atelier". it now
points at the Providers panel, which is where the key actually goes.
2026-08-20 17:58:38 +00:00

24 lines
1.6 KiB
TypeScript

import type { AppRegistryMeta } from 'officerdev';
import { Sparkles, GalleryHorizontalEnd, FolderOpen, KeyRound } from 'lucide-react';
import { Generate } from './Generate/Generate';
import { Gallery } from './Gallery/Gallery';
import { Collections } from './Collections/Collections';
import { Providers } from './Providers';
// No component re-exports. `panels.ts` declares PANELS — the shell mounts them by key and there is no
// way to export a component from a plugin.
//
// The three coordinate through the URL and one refresh channel, never through props: Gallery reads
// `?selected=<id>` for its lightbox, Collections reads `?collection=<id>` for its detail view — two
// different param names on purpose, since both panels render on the same route at once and would
// otherwise fight over one param. Generate bumps `useAtelierRefresh` (officerdev/src/channels.ts) when
// a job finishes; Gallery subscribes to it. See plugins/atelier/PLUGIN.md.
export const appRegistryMetas: AppRegistryMeta[] = [
{ key: 'atelier-generate', name: 'Generate', icon: Sparkles, component: Generate, availableOnPanel: false },
{ key: 'atelier-gallery', name: 'Gallery', icon: GalleryHorizontalEnd, component: Gallery, availableOnPanel: false },
{ key: 'atelier-collections', name: 'Collections', icon: FolderOpen, component: Collections, availableOnPanel: false },
// Providers is a panel and not a section in Officer's settings — see Providers.tsx. A plugin that
// cannot be configured without the platform shipping its settings screen is not self-contained.
{ key: 'atelier-providers', name: 'Providers', icon: KeyRound, component: Providers, availableOnPanel: false },
];