From 59eb8b75b0b043f6168cf62d4287aefa83f4057d Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Sun, 3 May 2026 18:35:51 +0300 Subject: [PATCH] Move shared shell chrome into bridge Keep the page chrome sync helpers in shell-bridge.js so React and legacy routing share one implementation. This preserves the sidebar breadcrumb and discover download bar behavior without shadowing the legacy shell helpers in init.js. --- webui/README.md | 6 ++-- webui/index.html | 2 +- webui/static/init.js | 66 ------------------------------------ webui/static/shell-bridge.js | 23 +++++++++++-- 4 files changed, 25 insertions(+), 72 deletions(-) diff --git a/webui/README.md b/webui/README.md index ea6b1005..d32587c2 100644 --- a/webui/README.md +++ b/webui/README.md @@ -29,12 +29,12 @@ flowchart LR - `webui/static/init.js` - boots the legacy shell - selects the active profile - - handles the old page activation flow + - handles the legacy page loading flow - `webui/static/shell-bridge.js` - owns the browser-side bridge object - exposes `window.SoulSyncWebShellBridge` - - syncs page chrome between legacy and React + - owns the shared page chrome and route handoff helpers - `webui/src/app/main.tsx` - mounts the React app @@ -50,7 +50,7 @@ The current order in `index.html` matters: 1. legacy shell scripts load first 2. `init.js` sets up the shell runtime -3. `shell-bridge.js` publishes the shell bridge after those helpers exist +3. `shell-bridge.js` publishes the bridge and shared chrome helpers after the shell state exists 4. the Vite React app is injected through `{{ vite_assets('body') }}` and boots as a module after parsing That order avoids load-time references to missing globals and keeps the React side able to react to bridge readiness events. The React entry can start fetching early, but the shell bridge and legacy globals are already available by the time the React runtime starts acting on them. diff --git a/webui/index.html b/webui/index.html index c65152b2..59f23372 100644 --- a/webui/index.html +++ b/webui/index.html @@ -234,7 +234,7 @@