sections are paths, not a query string

The admin declares its routes in the manifest, so /fofos-admin/layout/header and
/fofos-admin/pages/home are real URLs. One reader takes the two segments after
the mount; links carry no query string at all, so nothing leaks between
sections.

What stays in the query is how you are looking — device, tab, view — rather than
at what.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-01 04:57:29 +01:00
co-authored by Claude Opus 5
parent 4d7162363b
commit a7fc07c52f
7 changed files with 141 additions and 68 deletions
+5 -3
View File
@@ -1,4 +1,5 @@
import { Images } from 'lucide-react';
import { href } from './routes';
import type { FileAction } from 'officerdev';
/**
@@ -81,11 +82,12 @@ export const fileActions: FileAction[] = [
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.
*/
const params = new URLSearchParams(window.location.search);
params.set('section', 'galleries');
// The section is a PATH now, so this names it rather than editing the current query. `create` and
// `from` stay in the query: they are a one-shot handover, not where you are.
const params = new URLSearchParams();
params.set('create', entries.length === 1 && entries[0]!.type === 'directory' ? entries[0]!.name : '');
params.set('from', paths.join('\n'));
window.history.pushState({}, '', `${window.location.pathname}?${params.toString()}`);
window.history.pushState({}, '', `${href('galleries')}?${params.toString()}`);
// The router listens for this; pushState alone does not notify it.
window.dispatchEvent(new PopStateEvent('popstate'));
},