Skip to content

feat: add hosted mode support for Spoolman shell embedding#26

Open
akira69 wants to merge 4 commits into
Disane87:mainfrom
akira69:feat/spoolman-hosted-mode
Open

feat: add hosted mode support for Spoolman shell embedding#26
akira69 wants to merge 4 commits into
Disane87:mainfrom
akira69:feat/spoolman-hosted-mode

Conversation

@akira69

@akira69 akira69 commented Mar 24, 2026

Copy link
Copy Markdown

Summary

Adds a focused hosted-mode path so spoolman-filament-swatch can run cleanly inside the Spoolman Applications Framework as a same-origin embedded app while preserving standalone mode.

This branch is intended to pair with the hosted-shell work happening in akira69/Spoolman_Labels on feat/hosted-applications-framework-workspace.

What Changed

  • add hosted-mode route defaults so embedded launches land on /app/swatch
  • add hosted-mode title/branding support so the app reads as Filament Swatch when embedded
  • strip standalone-only manifest/search/canonical links from hosted builds
  • accept host-provided theme state and mirror the parent shell instead of exposing a separate theme selector
  • treat hosted config as authoritative for backend/API access
  • allow hosted mode to load Spoolman data correctly from root or subpath deployments
  • fix stale spoolmanUrl on first render: useSpoolmanUrl is a module-level singleton evaluated before bootstrap() resolves — rehydrateFromHostedConfig() corrects it after the async hosted config is fetched, before any connection check fires
  • deduplicate HostedConfig/HostedWindow types: export from useHostedMode.ts; main.ts imports rather than re-declaring them

Hosted Runtime Behavior

When launched by a host shell, the app now:

  • reads a small hosted config payload from the parent runtime
  • uses host-provided Spoolman base-path context
  • follows the parent dark/light mode
  • hides the standalone theme switch
  • skips standalone landing-path assumptions
  • preserves standalone behavior when no hosted config is present

Verification

Verified locally against a same-origin Spoolman host shell on 2026-03-23:

  • hosted app launched under /app-host/spoolman-filament-swatch/
  • embedded route defaulted into the swatch UI
  • embedded title rendered as Filament Swatch
  • app-local theme selector was removed in hosted mode
  • parent Spoolman dark mode propagated into the hosted app
  • hosted app loaded seeded filament/spool data through the parent Spoolman instance

Notes

  • This PR intentionally keeps the changes narrow and host-oriented.
  • It does not vendor Spoolman-specific code into the app beyond the small hosted contract path.
  • The search-bar visibility fix on narrow widths is a separate concern tracked in PR fix: keep search visible on narrow widths #27.
  • A remaining follow-up outside this repo is cleaning up the parent shell's nested-route service worker 404 in the browser console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant