From eaa8077c8991972e1af03284556601b9cb2bac58 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 22 Aug 2025 12:26:42 -0700 Subject: [PATCH] fix: UI improvements --- extensions/cli/package-lock.json | 1 + extensions/cli/src/asciiArt.test.ts | 11 ++++++----- extensions/cli/src/asciiArt.ts | 16 +++++++++++++--- .../cli/src/ui/components/MemoizedMessage.tsx | 5 +++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index 1a667013a..19e1f2762 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -276,6 +276,7 @@ "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.14", "@types/json-schema": "^7.0.15", + "@types/node": "^24.3.0", "cross-env": "^7.0.3", "semantic-release": "^24.2.7", "ts-jest": "^29.2.3", diff --git a/extensions/cli/src/asciiArt.test.ts b/extensions/cli/src/asciiArt.test.ts index 9f97137d3..fe1878834 100644 --- a/extensions/cli/src/asciiArt.test.ts +++ b/extensions/cli/src/asciiArt.test.ts @@ -27,26 +27,27 @@ describe("asciiArt", () => { expect(result).toBe(CONTINUE_ASCII_ART); }); - it("should return simple text version when terminal is too narrow", () => { + it("should return CN ASCII art version when terminal is too narrow", () => { // Set process.stdout.columns to simulate narrow terminal process.stdout.columns = 60; const result = getDisplayableAsciiArt(); - expect(result).toContain("CONTINUE"); - // expect(result).toContain("v0.0.0-dev"); + expect(result).toContain("██████╗"); + expect(result).toContain("(alpha)"); expect(result).not.toBe(CONTINUE_ASCII_ART); // Should be much shorter than the full ASCII art expect(result.length).toBeLessThan(CONTINUE_ASCII_ART.length / 2); }); - it("should return simple text version when terminal is below threshold", () => { + it("should return CN ASCII art version when terminal is below threshold", () => { // Test the edge case at exactly 74 columns (below our threshold of 75) process.stdout.columns = 74; const result = getDisplayableAsciiArt(); - expect(result).toContain("CONTINUE"); + expect(result).toContain("██████╗"); + expect(result).toContain("(alpha)"); expect(result).not.toBe(CONTINUE_ASCII_ART); }); diff --git a/extensions/cli/src/asciiArt.ts b/extensions/cli/src/asciiArt.ts index 39d365388..c65f877da 100644 --- a/extensions/cli/src/asciiArt.ts +++ b/extensions/cli/src/asciiArt.ts @@ -12,7 +12,17 @@ ${mind.multiline(` ██████╗ ██████╗ ███╗ ██║ ██║ ██║██║╚██╗██║ ██║ ██║██║╚██╗██║██║ ██║██╔══╝ ╚██████╗╚██████╔╝██║ ╚████║ ██║ ██║██║ ╚████║╚██████╔╝███████╗ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝`)} - ${d("v" + getVersion())}`; + ${d("v" + getVersion() + " (alpha)")}`; + +// ASCII art for just "CN" (first two letters) +const CN_ASCII_ART = ` +${mind.multiline(` ██████╗███╗ ██╗ + ██╔════╝████╗ ██║ + ██║ ██╔██╗ ██║ + ██║ ██║╚██╗██║ + ╚██████╗██║ ╚████║ + ╚═════╝╚═╝ ╚═══╝`)} + ${d("v" + getVersion() + " (alpha)")}`; // Minimum terminal width required to display ASCII art properly const MIN_WIDTH_FOR_ASCII_ART = 75; @@ -28,8 +38,8 @@ export function getDisplayableAsciiArt(): string { return CONTINUE_ASCII_ART; } - // If terminal is too narrow, just show a simple version - return `\n${chalk.bold.blue("CONTINUE")} ${d("v" + getVersion())}\n`; + // If terminal is too narrow, show just "CN" ASCII art + return CN_ASCII_ART; } export const CONTINUE_LOGO_ASCII_ART = ` diff --git a/extensions/cli/src/ui/components/MemoizedMessage.tsx b/extensions/cli/src/ui/components/MemoizedMessage.tsx index 0e254f23a..8708afd88 100644 --- a/extensions/cli/src/ui/components/MemoizedMessage.tsx +++ b/extensions/cli/src/ui/components/MemoizedMessage.tsx @@ -20,7 +20,8 @@ export const MemoizedMessage = memo( case "tool-start": return ( - ○ {message.content} + {/* TODO: Change back to empty circle (○) with white color once we want to differentiate in-progress vs completed tool calls */} + ● {message.content} ); @@ -87,7 +88,7 @@ export const MemoizedMessage = memo( return ( - ● + ● {isUser ? ( {message.content}