Galleries: a panel, and Create Gallery in the file browser
The section reads the site's own admin API, so it requires a CONNECTION where Media beside it requires only a root. The difference is real rather than copy-paste: Media is a file browser over a folder on this disk, while a gallery is a row in the site's database — opening it without the site answering would be a screen where every action fails. The context action hands its selection over in the URL and sends you to the panel rather than opening a dialog of its own. Naming a gallery, seeing the slug it will get and watching the items land belongs on the screen that owns galleries, not in a modal over a file browser that would then have to explain where the result went. It offers itself only inside originals/, because a gallery item is a path relative to that folder and an entry that appears everywhere while working in one place is worse than one that appears where it works. The test is on the PATH, not on which panel is open — the same browser is mounted in several places and only the path says where it is pointed. A mixed selection is refused. A folder among files is either a mistake or a request to recurse, and neither is something to guess from a right-click. The handoff is consumed once and stripped from the URL. Left there, a refresh would create the gallery again, which somebody discovers as four copies. Nothing is written until Create: the folder's name is a suggestion in the field, not a decision already taken. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { DEFAULT_SECTION, isSectionKey, sectionFor, sectionOpen, type SectionKey
|
||||
import { AdministrationPanel } from './AdministrationPanel';
|
||||
import { MediaPanel } from './MediaPanel';
|
||||
import { HomePanel } from './sections/HomePanel';
|
||||
import { GalleriesPanel } from './sections/GalleriesPanel';
|
||||
import { MessagesPanel } from './MessagesPanel';
|
||||
import { PlannedSection } from './PlannedSection';
|
||||
import { useReady } from './useReady';
|
||||
@@ -40,6 +41,7 @@ import { useReady } from './useReady';
|
||||
*/
|
||||
const PANELS: Partial<Record<SectionKey, () => React.JSX.Element>> = {
|
||||
home: HomePanel,
|
||||
galleries: GalleriesPanel,
|
||||
messages: MessagesPanel,
|
||||
administration: AdministrationPanel,
|
||||
media: MediaPanel,
|
||||
|
||||
Reference in New Issue
Block a user