OS Startup Flow
This document explains how the Próx OS Shell boots in the browser: appearance, loading overlay, session gates, workspace hydration, and the first apps users see
This document explains how the Próx OS Shell boots in the browser: appearance, loading overlay, session gates, workspace hydration, and the first apps users see.
Entry And Providers
apps/os-shell/src/index.tsxcallsapplyBootShellAppearance()beforecreateRootso gradient tokens are available immediately.enableReactScanIfRequested()may attach React Scan in development when the feature flag is enabled.AppProviderswires i18n, TanStack Query, and shell settings.RouterProvidermounts the shell router (apps/os-shell/src/router.tsx).
Boot Appearance
| Stage | Source | Behavior |
|---|---|---|
| First visit | Design tokens (:root in @prox-os/design-tokens) | Default Quiet mist gradient (--os-desktop-background) |
| Return visit | prox-os.os.desktop-background in localStorage | Same key used by Display options; applied via data-os-background on <html> |
| Theme | prox-os.os.theme + prefers-color-scheme | Sets data-os-theme for light/dark gradient pairs |
applyBootShellAppearance (apps/os-shell/src/browser-local/applyBootShellAppearance.ts) reads stored values synchronously. useApplyShellSettings keeps the document element in sync after React mounts.
The global loading overlay (ShellLoadingScreen) uses var(--os-desktop-background) so it matches the desktop scene instead of a flat page color.
Remote profile sync for appearance is not wired yet; future API work should reuse the same keys and broadcast a settings-changed event.
Loading Overlay
useBootingState(apps/os-shell/src/shell/state/useShellEnvironment.ts) holdsisBootingfor ~820ms on first mount.DesktopSystemOverlayLayerrendersShellLoadingScreenwhileisBootingis true.- Copy defaults to Starting Próx OS with a lightweight shell/registry/workspace subtitle.
This overlay is intentionally short: it covers registry and workspace setup, not remote data fetching.
Session And Welcome
After boot:
- Signed-in gate — local
prox-os.os.signed-in(see session overlays) decides whether login UI appears. - Hola — when signed in and welcome state is open,
useDesktopShellControlleropens the Hola app (/app-os/hola) after workspace bounds are ready. - Desktop — registry-driven folders and dock become interactive; window layouts hydrate from
prox-os.os.window-sizes.
Website mode (/app/*/website) skips Hola auto-open and uses different navigation guards. True fullscreen app Spaces use /spaces/:spaceId and fall back to the default desktop after refresh if the in-memory Space no longer exists.
Registry And Apps
apps/os-shell/src/apps/registry.tscomposes iframe templates,@prox-os/os-appsmanifests, and shell-only local modules.- Only registered manifests can open windows; App Store rows with
runtimeAppIdmust match a registry entry. - Lazy loading: local renderers in
localAppComponents.tsx; iframes load on demand per window.
Boot Sequence (ASCII)
index.tsx
└─ applyBootShellAppearance() # gradient + theme from localStorage
└─ React root
└─ AppProviders / Router
└─ DesktopShell
├─ isBooting → ShellLoadingScreen (gradient background)
├─ session.loginOpen → login overlay
├─ workspaceReady → hydrate window layouts
└─ welcomeOpen → open Hola (/app-os/hola)Related Docs
docs/ai/context-pack.md— agent routing indexdocs/architecture/app-registry.md— manifest and route groupsdocs/architecture/state-model.md— shell vs app statedocs/architecture/window-manager.md— window lifecycle
Agent Checklist
When changing startup behavior, update this file and verify:
- Boot loading uses
--os-desktop-background, not--os-color-desktopalone. - New localStorage keys are listed in
proxOsLocalStorageKeys.ts. - Hola, login, and website-mode guards stay consistent in
useDesktopShellController.