.prettierrc.json was missing "semi": false, so prettier wanted to add semicolons to a codebase written without them (763 semicolon-free statements vs. 150 with, in hand-written .ts; zero hand-written .svelte files use them at all). That's why prettier --check failed on 249 files — not because the code was unformatted, but because the config didn't match the actual house style. Added "semi": false; left printWidth/etc as configured (printWidth barely moves the failure count: 218/213/212 files at 100/120/140). Ran `prettier --write .` with the corrected config. Verified semantics-preserving before and after: - eslint: 142 problems both before and after, byte-identical - build passes, 38/38 tests pass - token-stream diff (whitespace/semicolons/quotes normalized) on all 218 changed files: only 52 had any remaining token change, all either trailing-comma removal (matching trailingComma: "none") or import/ ternary reflow — no semantic changes - live smoke test: Knowledge, Tasks, Fleet map, and a chat window (AgentTrace, markdown, Scope graph, activity rail) all render correctly, no console errors Most of the diff is shadcn/ui vendor files (lib/components/ui/) moving from the CLI's own style (double quotes, tabs, semicolons) to house style; re-running `shadcn-svelte add` on a component will need a follow-up format pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.5 KiB
Svelte
38 lines
1.5 KiB
Svelte
<script lang="ts">
|
|
// Renders an App's lazily-loaded component (AppDef.component is a
|
|
// dynamic-import loader, not the component itself). Shows the shared
|
|
// spinner while the chunk fetches; Vite's module cache makes repeat
|
|
// opens resolve from cache on the next microtask, so the spinner is
|
|
// one-tick at most after first load. Used by both WindowLayer
|
|
// (windowed apps) and DockedLayer (docked apps) so the loading state
|
|
// is uniform across app kinds.
|
|
import type { Component } from 'svelte'
|
|
import { untrack } from 'svelte'
|
|
import Spinner from '../Spinner.svelte'
|
|
|
|
let { load }: { load: () => Promise<{ default: Component }> } = $props()
|
|
|
|
// Created once per mount, not per render. `load` is the app's stable
|
|
// registry loader (app.component — defined once in the APPS array, never
|
|
// reassigned), so reading it at init is correct; untrack tells Svelte the
|
|
// one-shot read is intentional and silences the state_referenced_locally
|
|
// lint. Without pinning, {#await} would re-subscribe to a fresh Promise on
|
|
// every reactive re-evaluation of load() and loop.
|
|
const promise = untrack(() => load())
|
|
</script>
|
|
|
|
{#await promise}
|
|
<div class="flex h-full min-h-0 items-center justify-center text-muted-foreground">
|
|
<Spinner class="size-5" />
|
|
</div>
|
|
{:then mod}
|
|
{@const C = mod.default}
|
|
<C />
|
|
{:catch error}
|
|
<div
|
|
class="flex h-full min-h-0 items-center justify-center p-4 text-center text-sm text-destructive"
|
|
>
|
|
Failed to load app: {(error as Error).message}
|
|
</div>
|
|
{/await}
|