From fd565a6555e8bc9f37f21cf9d900523ef3be531b Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Fri, 12 Jun 2026 00:22:42 +0900 Subject: feat(workspace,smart-scroll): per-conversation cwd + LSP view; smart auto-scroll MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit workspace (transport-contract@0.5.0): a cwd field in the Model sidebar view (GET/PUT /conversations/:id/cwd) + a new 'Language Servers' view (GET /conversations/:id/lsp) with per-server connected/starting/error badges, spinner, error text, and refresh. Store-owned reactive cwd, re-seeded on focus change; works for DRAFTS too (targets the draft's client-minted id, which survives promotion, so turn 1 runs in the chosen cwd). Network seam normalizes the untyped LSP body. smart-scroll: pure stick-to-bottom reducer + injected controller shell (scroll/scrollend + a ResizeObserver on the content so the view follows async height changes — markdown/highlight, images, collapses, viewport reflow), plus a floating scroll-to-bottom button. FIX: restore the transcript scrollbar — the refactor moved overflow-y-auto to an inner child, so the flex-1 container needed min-h-0 to constrain instead of growing to content. harness: vitest-setup polyfills Element.scrollTo + ResizeObserver (jsdom implements neither), fixing App component tests. docs: backend-handoff pruned (CR-3 resolved/removed); added cwd/LSP verification courier (backend confirmed all 6 asks ✅); removed the resolved cache-warming-timer courier. Verified: svelte-check 0 errors, biome clean, 523 tests pass, vite build OK. --- src/features/workspace/ui/CwdField.svelte | 96 +++++++++++++++++++ src/features/workspace/ui/LspStatusView.svelte | 127 +++++++++++++++++++++++++ 2 files changed, 223 insertions(+) create mode 100644 src/features/workspace/ui/CwdField.svelte create mode 100644 src/features/workspace/ui/LspStatusView.svelte (limited to 'src/features/workspace/ui') diff --git a/src/features/workspace/ui/CwdField.svelte b/src/features/workspace/ui/CwdField.svelte new file mode 100644 index 0000000..bd8b870 --- /dev/null +++ b/src/features/workspace/ui/CwdField.svelte @@ -0,0 +1,96 @@ + + +
+ Working directory +
+ { + if (e.key === "Enter") handleSave(); + }} + aria-label="Working directory" + /> + +
+ {#if !canEdit} +

Start or open a conversation to set its working directory.

+ {:else if error} +

{error}

+ {:else if justSaved && !dirty} +

Saved.

+ {:else} +

Defaults each turn's cwd; drives the language servers below.

+ {/if} +
diff --git a/src/features/workspace/ui/LspStatusView.svelte b/src/features/workspace/ui/LspStatusView.svelte new file mode 100644 index 0000000..77603a1 --- /dev/null +++ b/src/features/workspace/ui/LspStatusView.svelte @@ -0,0 +1,127 @@ + + +
+
+ + {#if loading} + Resolving… + {:else if hasLoaded && loadedCwd !== null} + {summary} + {:else} + Language servers + {/if} + + +
+ + {#if !canView} +

Open or start a conversation to see its language servers.

+ {:else if error} +

{error}

+ {:else if hasLoaded && loadedCwd === null} +

+ Set a working directory in the Model panel to enable language servers. +

+ {:else if hasLoaded && servers.length === 0 && !loading} +

No language servers configured for this directory.

+ {:else} + + {/if} +
-- cgit v1.2.3