feat(ui): Phase 26 — customer SPA island integration (hero:theme + hero:route postMessage + X-Forwarded-Prefix) #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The customer-facing SPA (
_ui_wasm) is currently designed for two delivery modes:_appDioxus desktop binary_ui --dist <path>direct browser accessMissing: integration with Hero OS shell as an archipelago island. Per
web_embed+hero_ui_routesskills, every UI mounted inhero_osmust:hero:themepostMessage protocol — receive theme changes from shellhero:routepostMessage protocol — push nav state into host window's floating header (breadcrumbs + actions + deep-link URL)X-Forwarded-Prefixheader for base-path routing (hero_routermounts services at/hero_assistance/...)What
A. postMessage protocols
hero:themereceiver — listen for{type: "hero:theme", theme: "dark"|"light"}messages from parent; updatedata-bs-themehero:routesender — on every nav change, post{type: "hero:route", route: {...}, breadcrumbs: [...], actions: [...]}to parentPer
web_embedskill drop-in helperhero-window-route.js.B. X-Forwarded-Prefix base-path
_uiAxum readsX-Forwarded-Prefixfrom request headers; threadsBASE_PATHinto SPA via<meta name="base-path">tag. SPA reads BASE_PATH and uses it for all/rpc,/events, asset URLs.Per
hero_web_prefixskill.C. Archipelago slot — D-23
Pick one:
room,call,voice,collab) — recommended; hero_assistance is support communicationwhiteboard,slides,inspector)Rationale in D-23. Register in external
hero_archipelagosrepo: new island spec referencing the WASM dist URL via hero_router.D. Conditional chrome
When
?embedded=1or running inside iframe (detectwindow.parent !== window), suppress:Keep visible: tab strip, ticket list, composer, presence sidebar.
Acceptance
hero:themepostMessage updates SPA theme without page reloadhero:routepostMessage fires on every nav change with current route + breadcrumbsX-Forwarded-Prefix: /hero_assistancecauses SPA to use prefixed URLs for all requestslhumina_code/hero_archipelagosFiles to touch
crates/hero_assistance_ui_wasm/src/lib.rs— postMessage send/receivecrates/hero_assistance_ui_wasm/src/components/— conditional chrome renderingcrates/hero_assistance_ui/src/main.rs— X-Forwarded-Prefix handling, BASE_PATH meta tag injectiondecisions/D-23-archipelago-slot.mdlhumina_code/hero_archipelagos— new island specOut of scope
References
web_embedhero_ui_routeshero_web_prefixlhumina_code/hero_archipelagosrepo island spec formatlhumina_code/hero_osshell (consumes islands)