Repository navigation
feat(gui): Svelte theme, CLI health, error boundary + dialogs (#220) - #228
Merged
Merged
Conversation
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
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofvite build— unchanged at 595.75 kB).What changed
state/theme.svelte.tsrunes store (preference dark / light /null=system, persisted to localStorage, OS preference viamatchMedia).App.svelteappliesdata-themeto the document root via an$effect; a View → Cycle Theme menu item rotates dark → light → system.state/cli-health.svelte.ts(invokescheck_cli_health, validates withCliHealthResponseSchema, polls every 30 s, cleans up on unmount). The status bar now shows the real CLI status + coloured dot; aCliHealthWarningbanner appears when the backend is unavailable, with a CLI-unavailable details dialog (retry + troubleshooting).ui/Dialog.svelteprimitive (fixed overlay, click-outside + Escape close, reusing the globaldialog-*CSS — no portal needed). About and Diagnostics dialogs wired into the Help menu viauiState.activeDialog.<svelte:boundary>wraps the shell with a fallback (error details + reload), replacing the React classErrorBoundary.Deliberate scope cuts (not regressions)
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
tsc,svelte-check(0/0 — the Dialog overlay a11y warning resolved withrole="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.Notes for reviewers
Closes #220. Part of #214.