diff --git a/examples/ai-streaming/src/index.tsx b/examples/ai-streaming/src/index.tsx index c172a666d..e8c98f0b3 100644 --- a/examples/ai-streaming/src/index.tsx +++ b/examples/ai-streaming/src/index.tsx @@ -40,7 +40,7 @@ class AIStreamingApp extends Widget { this.addChild(this._toolCall); this.addChild(this._streamingText); - setInterval(() => { + clearInterval(window.__interval); window.__interval = setInterval(() => { this._streamingText.tick(); }, 50); } diff --git a/examples/chat-app/src/index.tsx b/examples/chat-app/src/index.tsx index a3a2ddb14..0d405714e 100644 --- a/examples/chat-app/src/index.tsx +++ b/examples/chat-app/src/index.tsx @@ -257,7 +257,7 @@ function parseBlocks(text: string): Block[] { } // ── Handle Paragraphs ──────────────────────── - if (line.trim() === '') { + if (line.trim().length === 0) { blocks.push({ type: 'paragraph', text: '', diff --git a/packages/ui/src/Form.ts b/packages/ui/src/Form.ts index bf96ede6b..38d630037 100644 --- a/packages/ui/src/Form.ts +++ b/packages/ui/src/Form.ts @@ -138,3 +138,5 @@ export class Form extends Widget { } } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/packages/ui/src/Switch.ts b/packages/ui/src/Switch.ts index 7c24941a5..d9a1e01d0 100644 --- a/packages/ui/src/Switch.ts +++ b/packages/ui/src/Switch.ts @@ -114,7 +114,7 @@ export class Switch extends Widget { if (width <= 0) return; const attrs = styleToCellAttrs(this.style); - const knobPos = Math.round(this._animProgress * 2); + const knobPos = Math.round(this._animProgress * 2 + Number.EPSILON); const transitioning = this._animProgress > 0 && this._animProgress < 1; let trackChars: string[];