Skip to content

Commit 2ddafe8

Browse files
committed
Cloud chat: show the typing dots until the first token (match local UX)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b552384 commit 2ddafe8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

vortelio/internal/server/ui.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4601,6 +4601,8 @@ <h3 style="margin:0">☁️ Add cloud model</h3>
46014601
});
46024602
if (!r.ok) { const d = await r.json().catch(()=>({})); throw new Error(d.error || 'HTTP ' + r.status); }
46034603
const tn = document.createElement('div'); tn.style.width = '100%'; content.appendChild(tn);
4604+
// Drop the "typing" dots as soon as the first byte arrives (same UX as local).
4605+
const _killPulse = () => { const p = content.querySelector('.dot-pulse'); if (p) p.remove(); };
46044606
const reader = r.body.getReader(); const dec = new TextDecoder(); let buf = ''; let fullText = '';
46054607
outer: while (true) {
46064608
const {done, value} = await reader.read(); if (done) break;
@@ -4611,6 +4613,7 @@ <h3 style="margin:0">☁️ Add cloud model</h3>
46114613
const raw = line.slice(6).trim();
46124614
if (raw === '[DONE]') break outer;
46134615
let ev; try { ev = JSON.parse(raw); } catch(_) { continue; }
4616+
_killPulse();
46144617
if (ev.error) throw new Error(ev.error);
46154618
if (ev.event) {
46164619
const data = ev.data || {};
@@ -4665,7 +4668,7 @@ <h3 style="margin:0">☁️ Add cloud model</h3>
46654668
// Cloud assistant: stream from the provider and finish here.
46664669
if (selectedModelIsCloud) {
46674670
try {
4668-
pulse.remove();
4671+
// Keep the typing dots until the first token (streamCloudInto removes them).
46694672
const full = await streamCloudInto(selectedCloudProvider, selectedCloudModel, chatHistory.slice(), content, canvas, signal);
46704673
chatHistory.push({role:'assistant', content: full || '(empty response)'});
46714674
autoSaveCurrentChat();

0 commit comments

Comments
 (0)