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/examples/widget-gallery/src/index.ts b/examples/widget-gallery/src/index.ts index 57b141244..ec688a7fc 100644 --- a/examples/widget-gallery/src/index.ts +++ b/examples/widget-gallery/src/index.ts @@ -129,7 +129,7 @@ class WidgetGalleryApp extends Widget { } // Tab switching: 1-6 - const num = parseInt(event.key); + const num = parseInt(event.key, 10); if (num >= 1 && num <= 6) { this._switchTab(num - 1); return true; diff --git a/packages/ui/src/TreeSelect.ts b/packages/ui/src/TreeSelect.ts index 652ede256..2c3a59a97 100644 --- a/packages/ui/src/TreeSelect.ts +++ b/packages/ui/src/TreeSelect.ts @@ -182,7 +182,7 @@ function _pathsEqual(a: number[], b: number[]): boolean { function _valuesEqual(a: string[], b: string[]): boolean { if (a.length !== b.length) return false; - const sortedA = [...a].sort(); + const sortedA = [...a].sort((a, b) => a - b); const sortedB = [...b].sort(); for (let i = 0; i < sortedA.length; i++) { if (sortedA[i] !== sortedB[i]) return false;