the media folder lives in ?media=, not in the route

`urlPath` sent the whole app to /files the moment anybody opened a folder — it owns
the pathname, which is right for the Files screen and wrong for a panel. it uses the
platform's new `pathParam` instead, which names a search param and leaves the route
alone.

`?media=` rather than `?path=`: this screen already carries `?section=` and may one
day carry a second browser. a param named after what it addresses cannot collide
with one named after a concept.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-29 09:01:41 +01:00
co-authored by Claude Opus 5
parent 3dd4dd6592
commit 21935cbc27
2 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ import type { PluginManifest } from '@@/plugins/manifest';
*/ */
export const manifest: PluginManifest = { export const manifest: PluginManifest = {
publisher: 'officerdev', publisher: 'officerdev',
version: '2026.08.29.23', version: '2026.08.29.24',
platform: '>=1.0.0', platform: '>=1.0.0',
label: 'Fofos', label: 'Fofos',
+10 -6
View File
@@ -91,14 +91,18 @@ export const MediaPanel = () => {
`rootLabel` so the breadcrumb reads "Media" rather than "originals": the folder's name on disk is `rootLabel` so the breadcrumb reads "Media" rather than "originals": the folder's name on disk is
an implementation detail of how this plugin lays out a root, and the section is called Media. an implementation detail of how this plugin lays out a root, and the section is called Media.
`urlPath` puts the current folder in `?path=`, so a reload lands where you were and a link can be `pathParam` keeps the folder in `?media=`, so a reload lands where you were and the link can be sent
sent to somebody. it is opt-in in the platform because a screen with TWO browsers would have them to somebody. NOT `urlPath`, which was the first attempt and was wrong: that one owns the URL's
fighting over one parameter — this screen has one, so it is safe here and not in general. PATHNAME and navigates to /files, so opening a folder here took the whole app to the Files screen.
`panelId` stays as well: it remembers the folder for a panel that is re-opened rather than reloaded, `?media=` rather than `?path=` because this screen already carries `?section=` and may one day carry
which the URL cannot cover. another browser; a param named after what it addresses cannot collide with one named after a
concept.
`panelId` stays alongside: the URL covers a reload or a shared link, panelId covers a panel
re-opened later, which the URL cannot.
*/ */
return <FileBrowserApp basePath={base} rootLabel="Media" urlPath panelId="fofos-admin-media" />; return <FileBrowserApp basePath={base} rootLabel="Media" pathParam="media" panelId="fofos-admin-media" />;
}; };
const Notice = ({ icon: Icon, children }: { icon: typeof FolderOpen; children: React.ReactNode }) => ( const Notice = ({ icon: Icon, children }: { icon: typeof FolderOpen; children: React.ReactNode }) => (