Wires VITE_LUMOTIA_QUIETWARE=1 to set <html data-design="quietware"> via a $effect in src/routes/+layout.svelte. Without the flag the runtime app behaves exactly as v0.2; with the flag the v0.3 token overrides in src/design-system/v0.3-quietware-tokens.css activate. Hot-reload safety: if the env var is unset between dev rebuilds, the attribute is cleared so devs do not see a stuck quietware surface. Activation paths: VITE_LUMOTIA_QUIETWARE=1 npm run dev (development) VITE_LUMOTIA_QUIETWARE=1 npm run build (production) Or manually via dev tools: <html data-design="quietware"> Combine with data-theme="light" (existing v0.2 theme wiring) and data-contrast="high" (existing v0.2 contrast wiring) to reach the light and high-contrast quietware modes. Smallest possible PR. No new dependencies. No bundle-size impact in the off path. No component changes. Plan doc updated to mark Phase 2 as landed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
53 lines
2.0 KiB
Svelte
53 lines
2.0 KiB
Svelte
<script lang="ts">
|
|
// @ts-nocheck
|
|
// v0.2 Phase 6 — thin composition. The three split-out shells own
|
|
// their respective responsibilities; this file just decides whether
|
|
// to render the chrome (main window) or pass children straight
|
|
// through (secondary windows like /float, /viewer, /preview, which
|
|
// also have their own +layout@.svelte to break out of this layout).
|
|
import "../app.css";
|
|
import { page as sveltePage } from "$app/stores";
|
|
import AppRuntime from "$lib/shell/AppRuntime.svelte";
|
|
import AppChrome from "$lib/shell/AppChrome.svelte";
|
|
import AppOverlays from "$lib/shell/AppOverlays.svelte";
|
|
|
|
let { children } = $props();
|
|
|
|
// Defensive: secondary windows use +layout@.svelte to escape this
|
|
// root layout, but if any /float, /viewer, /preview load ever
|
|
// reaches here we still drop the chrome.
|
|
let isSecondaryWindow = $derived(
|
|
$sveltePage.url.pathname.startsWith("/float") ||
|
|
$sveltePage.url.pathname.startsWith("/viewer") ||
|
|
$sveltePage.url.pathname.startsWith("/preview")
|
|
);
|
|
|
|
// v0.3 Tactile Quietware activation. When VITE_LUMOTIA_QUIETWARE=1
|
|
// is set at build time, mark <html data-design="quietware"> so the
|
|
// v0.3 token overrides in src/design-system/v0.3-quietware-tokens.css
|
|
// become active. Without the flag the app behaves exactly as v0.2.
|
|
// Combine with data-theme="light" and data-contrast="high" (already
|
|
// wired elsewhere) for the light and high-contrast modes.
|
|
$effect(() => {
|
|
if (typeof document === "undefined") return;
|
|
if (import.meta.env.VITE_LUMOTIA_QUIETWARE === "1") {
|
|
document.documentElement.dataset.design = "quietware";
|
|
} else if (document.documentElement.dataset.design === "quietware") {
|
|
// Hot-reload safety: env var unset between dev rebuilds.
|
|
delete document.documentElement.dataset.design;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<AppRuntime />
|
|
|
|
{#if isSecondaryWindow}
|
|
{@render children()}
|
|
{:else}
|
|
<AppChrome>
|
|
{@render children()}
|
|
</AppChrome>
|
|
{/if}
|
|
|
|
<AppOverlays />
|