Skip to content

feat(gui): Svelte theme, CLI health, error boundary + dialogs (#220) - #228

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/svelte-chrome
Jun 27, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/svelte-chrome

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #220. The last feature slice before cutover — migrates theme switching, CLI/sidecar health, the error boundary, and the dialogs to Svelte. (Toasts already shipped in #217.) Part of epic #214 (strangler-on-main: React still ships; Svelte stays behind the dev-only entry and out of vite build — unchanged at 595.75 kB).

What changed

  • Theme — state/theme.svelte.ts runes store (preference dark / light / null=system, persisted to localStorage, OS preference via matchMedia). App.svelte applies data-theme to the document root via an $effect; a View → Cycle Theme menu item rotates dark → light → system.
  • CLI/sidecar health — state/cli-health.svelte.ts (invokes check_cli_health, validates with CliHealthResponseSchema, polls every 30 s, cleans up on unmount). The status bar now shows the real CLI status + coloured dot; a CliHealthWarning banner appears when the backend is unavailable, with a CLI-unavailable details dialog (retry + troubleshooting).
  • Dialogs — ui/Dialog.svelte primitive (fixed overlay, click-outside + Escape close, reusing the global dialog-* CSS — no portal needed). About and Diagnostics dialogs wired into the Help menu via uiState.activeDialog.
  • Error boundary — <svelte:boundary> wraps the shell with a fallback (error details + reload), replacing the React class ErrorBoundary.

Deliberate scope cuts (not regressions)

  • The Export-confirmation dialog isn't ported — Svelte export goes straight to the save dialog (the validation-preview step was a UX nicety).
  • The StreamTab keyboard-shortcuts help modal isn't ported (low-value help overlay).
  • The CLI-unavailable dialog's advanced diagnostics (get_cli_diagnostics: resource/bundled paths + copy-to-clipboard) isn't ported — the Help → Diagnostics dialog already surfaces CLI health, version and the error message, which covers the common case. (Can be restored later if support needs the resource-path detail.)

Verification

  • Local gate green: tsc, svelte-check (0/0 — the Dialog overlay a11y warning resolved with role="presentation"), 749 vitest tests (+11: theme cycle/persistence/restore, cli-health ready/unavailable/throw, About close via ×+Escape, the warning banner show + details dialog), coverage 79.0/70.1/77.3/81.3 (> 60/50/65/60), stylelint, lint:css:vars, vite build, bundle budget.
  • Production bundle unchanged at 595.75 kB (theme / cli-health / dialogs out of the rollup input).
  • Verified in-browser: the CLI-unavailable banner + red status-bar dot appear (no Tauri backend), the About dialog renders and closes, the Help/View menu items work.
  • Adversarially reviewed before commit.

Notes for reviewers

Closes #220. Part of #214.

Closes #220 — the last feature slice before cutover. Part of epic #214,
strangler-on-main: React still ships; Svelte stays behind the dev-only entry and
out of the bundle (unchanged at 595.75 kB).

- state/theme.svelte.ts: dark/light/system preference (localStorage + matchMedia);
  App applies data-theme via $effect; View > Cycle Theme menu item.
- state/cli-health.svelte.ts: check_cli_health invoke + schema validation + 30s
  polling; real status-bar status/dot; CliHealthWarning banner + CLI-unavailable
  details dialog.
- ui/Dialog.svelte primitive (fixed overlay, click-outside + Escape, reuses the
  global dialog CSS); About + Diagnostics dialogs wired into the Help menu.
- Error boundary via <svelte:boundary> wrapping the whole shell (incl. toasts +
  dialogs) with a reload fallback.

Deliberate cuts (documented in the PR): Export-confirmation dialog, the streaming
keyboard-shortcuts modal, and the CLI advanced-diagnostics (get_cli_diagnostics)
view — Help > Diagnostics covers CLI health/version/error.

751 tests (theme cycle/persistence, cli-health ready/unavailable/throw/bad-schema,
dialog ×/Escape/backdrop close, the unavailable banner + details). Adversarially
reviewed (error-boundary scope tightened, Diagnostics rows restored).

Closes #220. Refs #214
@CameronBrooks11 CameronBrooks11 added the gui Pull requests that update GUI components label Jun 27, 2026
@CameronBrooks11
CameronBrooks11 merged commit 5565a7a into main Jun 27, 2026
18 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/svelte-chrome branch June 27, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gui Pull requests that update GUI components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate dialogs, toasts, chrome & theme to Svelte

1 participant