diff options
| author | Adam Malczewski <[email protected]> | 2026-06-07 01:04:01 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-07 01:04:01 +0900 |
| commit | c0fa581c8ac563c916948f44596ef361817dc580 (patch) | |
| tree | 87cff17051cd4263a6b67a28ecf6e16fb1e138db /src/features/chat/ui/ChatView.svelte | |
| parent | cce2380c116b9052f3839a0bc3f2bc4191f9afbd (diff) | |
| download | dispatch-web-c0fa581c8ac563c916948f44596ef361817dc580.tar.gz dispatch-web-c0fa581c8ac563c916948f44596ef361817dc580.zip | |
fix(chat): keep thinking <details> open while streaming
ChatView keyed the transcript each-block by object identity, but core/chunks
returns new RenderedChunk objects per delta, so Svelte recreated each
<article>/<details> every frame — an opened Thinking element snapped shut on
the next token. Key by stable identity instead (c${seq} for committed, p${i}
for append-only provisional) so streaming reuses the DOM. Adds a regression
test that the <details> stays open across a streaming update.
Verified: svelte-check 0/0, vitest 222, biome clean, build ok.
Diffstat (limited to 'src/features/chat/ui/ChatView.svelte')
| -rw-r--r-- | src/features/chat/ui/ChatView.svelte | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/features/chat/ui/ChatView.svelte b/src/features/chat/ui/ChatView.svelte index a7c39cc..ce66798 100644 --- a/src/features/chat/ui/ChatView.svelte +++ b/src/features/chat/ui/ChatView.svelte @@ -5,7 +5,7 @@ </script> <div class="chat-transcript" role="log" aria-live="polite"> - {#each chunks as rendered (rendered)} + {#each chunks as rendered, i (rendered.seq != null ? `c${rendered.seq}` : `p${i}`)} <article class="message message--{rendered.role}" class:message--provisional={rendered.provisional} |
