Four panels became three, and the arrangement carries the change: everything that organises or configures is stacked in one narrow column, and the whole of the rest is one surface for looking at images. Collections is a LIST, not a grid of covers — it sits in a narrow column beside the gallery, where two cards per row meant four collections visible. A row is a name, a count, and rename/delete on hover. Create is a dialog rather than an always-present input, and a filter field replaces it in that space, since finding one is the frequent act and making one is not. Selecting a collection now shows it in the GALLERY. It used to replace the list inside its own panel, which meant the selector disappeared the moment it was used, and both panels kept their own copy of one collection's images and disagreed after any edit. `?collection=` is read by the gallery now; the collections hook stopped fetching detail entirely. Deleting asks the question that cannot be undone: keep the images, or delete them too. That needed a server route — DELETE /collections/:id?images=delete — which reads the members BEFORE the collection goes, since deleting it takes the memberships with it. Unchecked by default: the recoverable answer is the one you get by pressing Enter without reading. Providers stopped being a panel. It was a card per provider, each with a key field and three buttons, filling a quarter of the screen for something set once — it is a dropdown at the top of Generate now, listing "adapter · model" with a delete on each, and adding one opens a dialog. The form and the dropdown share one provider list (useProviders); they were two fetches, so adding a provider left the form showing the old models until a reload.
24 lines
1.6 KiB
TypeScript
24 lines
1.6 KiB
TypeScript
import type { AppRegistryMeta } from 'officerdev';
|
|
import { Sparkles, GalleryHorizontalEnd, FolderOpen } from 'lucide-react';
|
|
import { Generate } from './Generate/Generate';
|
|
import { Gallery } from './Gallery/Gallery';
|
|
import { Collections } from './Collections/Collections';
|
|
|
|
// 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 AND `?collection=<id>` for which images it is showing — the second
|
|
// used to belong to the Collections panel, which rendered the detail inside the narrow list it was
|
|
// selected from. Generate bumps `useAtelierRefresh` (officerdev/src/channels.ts) when a job finishes;
|
|
// Gallery subscribes. See plugins/atelier/PLUGIN.md.
|
|
//
|
|
// `atelier-providers` was a fourth panel and is gone: providers are a dropdown at the top of Generate.
|
|
// Removing a panel key rewrites saved layouts that name it — see dashboards/queries.ts — which the
|
|
// install flow already handles by clearing this plugin's screen rows on install.
|
|
export const appRegistryMetas: AppRegistryMeta[] = [
|
|
{ key: 'atelier-collections', name: 'Collections', icon: FolderOpen, component: Collections, availableOnPanel: false },
|
|
{ key: 'atelier-generate', name: 'Generate', icon: Sparkles, component: Generate, availableOnPanel: false },
|
|
{ key: 'atelier-gallery', name: 'Gallery', icon: GalleryHorizontalEnd, component: Gallery, availableOnPanel: false },
|
|
];
|