From 98be0f94355a0d1ac16fdfd6e79c0667cd33249b Mon Sep 17 00:00:00 2001 From: Andre Merzky Date: Mon, 24 Aug 2026 17:00:53 +0200 Subject: [PATCH] explorer: plugin pages are addressable (#plugin//) A plugin page could only be reached by clicking through the tree; an external page (the DT dashboard's pool titles, for one) had nothing to link to. The hash now deep-links: applied after connect (auto-connect covers the served-from-broker case), applied again on hashchange, and kept in step by showPluginPage via replaceState so the address bar always names the open page. Co-Authored-By: Claude Opus 5 (1M context) --- src/radical/orbit/data/orbit_explorer.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/radical/orbit/data/orbit_explorer.html b/src/radical/orbit/data/orbit_explorer.html index 580423c..72b5e5b 100644 --- a/src/radical/orbit/data/orbit_explorer.html +++ b/src/radical/orbit/data/orbit_explorer.html @@ -2045,6 +2045,9 @@

${escHtml(ui.title)} — ${endpointName} // Open SSE event stream for push notifications setupEventSource(); + + // a #plugin// deep link can now be honoured + applyDeepLink(); } catch (e) { setConnectionStatus('disconnected'); @@ -2603,7 +2606,25 @@

${escHtml(ui.title)} — ${endpointName} if (entry && page && entry.module.onShow) { entry.module.onShow(page, entry.api); } + + // the page is addressable: keep the URL in step (replaceState does + // not retrigger the hashchange listener) + history.replaceState(null, '', + `#plugin/${encodeURIComponent(endpointName)}` + + `/${encodeURIComponent(pluginName)}`); + } + + // ── URL deep links ─────────────────────────────────────────── + // #plugin// opens that plugin's page once the + // Explorer is connected; external pages (the DT dashboard's pool + // titles, say) can link straight to a plugin this way. + function applyDeepLink() { + const m = location.hash.match(/^#plugin\/([^/]+)\/([^/]+)$/); + if (m && isConnected) { + showPluginPage(decodeURIComponent(m[1]), decodeURIComponent(m[2])); + } } + window.addEventListener('hashchange', applyDeepLink); // ───────────────────────────────────────────────────────────── // SSE Notification handler