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:
2026-08-29 21:08:25 +01:00
co-authored by Claude Opus 5
parent 063d2c4a88
commit f61653f7af
4 changed files with 329 additions and 7 deletions
+9 -7
View File
@@ -164,18 +164,20 @@ export const SECTIONS: Section[] = [
has chosen and put in an order, which is a decision worth keeping once rather than remaking on
every page that wants it.
`requires: 'root'` and not `'connection'`. A gallery is made of originals on this disk, so it is
reachable as soon as there is a root location — the same reasoning that unlocked Media, and for
the same reason: gating it behind a site connection it does not use was the bug that made the
distinction necessary.
`requires: 'connection'`, unlike Media beside it, and the difference is real rather than a
copy-paste. Media is a file browser over a folder on this disk and needs nothing else. A gallery
is a ROW in the site's database — reading or writing one goes through the site's admin API, so
this section is useless without the development server answering, and opening it there would be
a screen where every action fails.
*/
key: 'galleries',
label: 'Galleries',
icon: Images,
hint: 'Named sets of media, reusable across the site',
path: null,
built: false,
requires: 'root',
// `/fofos-admin/galleries` — it reads the site's own admin API, unlike Media beside it.
path: '/fofos-admin/galleries',
built: true,
requires: 'connection',
pinned: true,
},
{