From 9333313dcddb38851f27a512e9ee9626890c0a96 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Fri, 7 Aug 2026 12:35:58 +0530 Subject: [PATCH] fix: resolve 4 bugs in termui --- examples/ai-streaming/src/index.tsx | 2 +- examples/pomodoro-timer/src/index.tsx | 2 +- packages/ui/src/Form.ts | 2 ++ scripts/build-registry.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) 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/pomodoro-timer/src/index.tsx b/examples/pomodoro-timer/src/index.tsx index cad749f32..6444f948d 100644 --- a/examples/pomodoro-timer/src/index.tsx +++ b/examples/pomodoro-timer/src/index.tsx @@ -182,7 +182,7 @@ class GradientProgressBar extends Widget { const attrs = styleToCellAttrs(this._style); - const label = this._showLabel ? ` ${Math.round(this._value * 100)}%` : ''; + const label = this._showLabel ? ` ${Math.round(this._value * 100 + Number.EPSILON)}%` : ''; const barWidth = Math.max(0, width - label.length); const filled = this._value <= 0 ? 0 : Math.round(barWidth * this._value); const empty = barWidth - filled; 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/scripts/build-registry.ts b/scripts/build-registry.ts index f84844538..01abfbde1 100644 --- a/scripts/build-registry.ts +++ b/scripts/build-registry.ts @@ -44,7 +44,7 @@ export function collectDeps(content: string): string[] { const deps = new Set(); let m: RegExpExecArray | null; while ((m = re.exec(content)) !== null) deps.add(m[1]!); - return [...deps].sort(); + return [...deps].sort((a, b) => a - b); } export function toSlug(name: string): string {