Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

M5: Web App Integration (litmus-fgts)

StatusDone · archived
TypeTask
Prioritynormal
Parent(litmus-k2id)
Blocked byM1: Screenshot Data Model (litmus-b10b), M4: Cloudflare R2 Storage Setup (litmus-j0d6)

Add ManifestState + ActiveProvider to state.rs. Fetch manifest.json on app mount. Add ScreenshotView component with lazy loading and simulated-scene fallback. Add provider selector pill bar to ThemeDetail. Integrate into theme_detail, scene_across, compare pages.

Summary of Changes

state.rs: Added ActiveProvider (slug string, default ‘simulated’) and ManifestState (Option) global state types.

main.rs: Added context providers for ActiveProvider + ManifestState. Added manifest fetch on app mount using eval JS + spawn; populates ManifestState when manifest.json is available at MANIFEST_URL.

screenshot_view.rs (new):

  • ScreenshotSceneView component: renders real screenshot <img> from CDN URL when available, with simulated SceneView as fallback on load error or when no screenshot exists
  • ProviderSelector component: pill buttons showing ‘Simulated’ + any providers with screenshots for the current theme (hidden when only Simulated is available)
  • scene_id_to_fixture_id(): maps simulated scene IDs to fixture IDs (neovim → None, deferred)

pages/theme_detail.rs: Added ProviderSelector bar above scenes; conditionally uses ScreenshotSceneView when provider != ‘simulated’ and a fixture mapping exists.

assets/style.css: Added CSS for .screenshot-block, .screenshot-img, .screenshot-fallback, .provider-selector, .provider-pills, .provider-pill, .provider-pill-active.

Cargo.toml (litmus-web): Added serde_json dependency for manifest deserialization.