From 2709f0e30c4401ca65fbc63276f6075b66e9547f Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:03:36 -0700 Subject: [PATCH 01/13] slash commands now blue and verticaly align --- src/asciiArt.ts | 102 +++++++++++++++++++------------------- src/slashCommands.ts | 12 ++--- src/ui/IntroMessage.tsx | 18 ++++--- src/ui/SlashCommandUI.tsx | 14 ++++-- 4 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/asciiArt.ts b/src/asciiArt.ts index 772772d49..a7fbaa3fe 100644 --- a/src/asciiArt.ts +++ b/src/asciiArt.ts @@ -2,7 +2,7 @@ import chalk from "chalk"; import { getVersion } from "./version.js"; -const b = chalk.bold.magenta; +const b = chalk.bold.blue; const d = chalk.dim; export const CONTINUE_ASCII_ART = ` @@ -20,55 +20,55 @@ ${b("\\___/")}${d("\\____")}${b("/_/|_/")}${d(" /_/ /___/_/|_/\\____/___/")} // `; export const CONTINUE_LOGO_ASCII_ART = ` - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@ - @@@@@@@@@@@@ @@@@@@@@@@@@ - @@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@@ - @@@@@@@@@@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @ - @@@@@@@@@@@@ @@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@ @@@@ - @@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@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@@@@@@@ @@@@@@@@@@@ + @@@@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@ @@@@@@@@@@@@ @@@@@@@@@ + @@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@ @@@@@@@@@@@ @@@@@@ + @@@@@@@@@@@@ @@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@ @@@@ + @@@@@@@@@@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @ + @@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@ + @@@@@@@@@@@@ @@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ `; diff --git a/src/slashCommands.ts b/src/slashCommands.ts index e86b45b8f..ce8261c63 100644 --- a/src/slashCommands.ts +++ b/src/slashCommands.ts @@ -1,5 +1,4 @@ import { type AssistantConfig } from "@continuedev/sdk"; -import chalk from "chalk"; import { isAuthenticated, @@ -77,11 +76,12 @@ type CommandHandler = ( async function handleHelp(args: string[], assistant: AssistantConfig) { const allCommands = getAllSlashCommands(assistant); const helpMessage = [ - chalk.cyan("Slash commands:"), - ...allCommands.map( - (cmd) => - `- ${chalk.white(`/${cmd.name}:`)} ${chalk.gray(cmd.description)}`, - ), + "Slash commands:", + ...allCommands + .map( + (cmd) => + `- /${cmd.name}: ${cmd.description}`, + ), ].join("\n"); posthogService.capture("useSlashCommand", { name: "help" }); return { output: helpMessage }; diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index 5e7a10e49..ef1e892c2 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -41,8 +41,8 @@ const IntroMessage: React.FC = ({ return ( {/* Agent name */} - - Agent: {config.name} + + Agent: {config.name} {/* Model */} @@ -64,12 +64,14 @@ const IntroMessage: React.FC = ({ {/* Slash commands */} Slash commands: - {allCommands.map((command, index) => ( - - - /{command.name}:{" "} - {command.description} - - ))} + {allCommands + .sort((a, b) => a.name.localeCompare(b.name)) + .map((command, index) => ( + + - /{command.name}:{" "} + {command.description} + + ))} {/* MCP prompts */} {mcpPrompts.map((prompt, index) => ( diff --git a/src/ui/SlashCommandUI.tsx b/src/ui/SlashCommandUI.tsx index ad0cbb8d2..0c8c4f3b3 100644 --- a/src/ui/SlashCommandUI.tsx +++ b/src/ui/SlashCommandUI.tsx @@ -45,6 +45,9 @@ const SlashCommandUI: React.FC = ({ return a.name.localeCompare(b.name); }); + + // Find the longest command name for alignment + const maxCommandLength = Math.max(...filteredCommands.map(cmd => cmd.name.length)); if (filteredCommands.length === 0) { return ( @@ -58,12 +61,15 @@ const SlashCommandUI: React.FC = ({ {filteredCommands.map((command, index) => { const isSelected = index === selectedIndex; + const paddedCommandName = `/${command.name}`.padEnd(maxCommandLength + 1); + return ( - - {" "} - /{command.name} - - {command.description} + + {" "}{paddedCommandName} + + {" "}{command.description} + ); From 12a1d9ff2dfe35fb488310a2b2f90de5d1d93e56 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:03:56 -0700 Subject: [PATCH 02/13] remove slash commands from intro --- src/ui/IntroMessage.tsx | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index ef1e892c2..9d70f3140 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -62,26 +62,18 @@ const IntroMessage: React.FC = ({ - {/* Slash commands */} - Slash commands: - {allCommands - .sort((a, b) => a.name.localeCompare(b.name)) - .map((command, index) => ( - - - /{command.name}:{" "} - {command.description} - - ))} - {/* MCP prompts */} - {mcpPrompts.map((prompt, index) => ( - - - /{prompt.name}:{" "} - {prompt.description} - - ))} - - + {mcpPrompts.length > 0 && ( + <> + {mcpPrompts.map((prompt, index) => ( + + - /{prompt.name}:{" "} + {prompt.description} + + ))} + + + )} {/* Rules */} {allRules.length > 0 && ( From 83d89fa135da6294013e4ff4f8f23b9814df5625 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:04:11 -0700 Subject: [PATCH 03/13] change ascii art to block characters, with gradient --- package-lock.json | 36 ++++++++++++++++++++++++++++++++++++ package.json | 1 + src/asciiArt.ts | 21 ++++++++------------- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index d275e2c9f..05b96b8ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "express": "^5.1.0", "glob": "^11.0.3", "gpt-tokenizer": "^3.0.1", + "gradient-string": "^3.0.0", "ignore-walk": "^7.0.0", "ink": "^6.0.1", "jszip": "^3.10.1", @@ -5957,6 +5958,12 @@ "@types/node": "*" } }, + "node_modules/@types/tinycolor2": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.6.tgz", + "integrity": "sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==", + "license": "MIT" + }, "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", @@ -10322,6 +10329,19 @@ "dev": true, "license": "ISC" }, + "node_modules/gradient-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gradient-string/-/gradient-string-3.0.0.tgz", + "integrity": "sha512-frdKI4Qi8Ihp4C6wZNB565de/THpIaw3DjP5ku87M+N9rNSGmPTjfkq61SdRXB7eCaL8O1hkKDvf6CDMtOzIAg==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "tinygradient": "^1.1.5" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -18113,6 +18133,12 @@ "dev": true, "license": "MIT" }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "license": "MIT" + }, "node_modules/tinyexec": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", @@ -18165,6 +18191,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/tinygradient": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/tinygradient/-/tinygradient-1.1.5.tgz", + "integrity": "sha512-8nIfc2vgQ4TeLnk2lFj4tRLvvJwEfQuabdsmvDdQPT0xlk9TaNtpGd6nNRxXoK6vQhN6RSzj+Cnp5tTQmpxmbw==", + "license": "MIT", + "dependencies": { + "@types/tinycolor2": "^1.4.0", + "tinycolor2": "^1.0.0" + } + }, "node_modules/tinypool": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", diff --git a/package.json b/package.json index f4e77a052..b25d19c1b 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "express": "^5.1.0", "glob": "^11.0.3", "gpt-tokenizer": "^3.0.1", + "gradient-string": "^3.0.0", "ignore-walk": "^7.0.0", "ink": "^6.0.1", "jszip": "^3.10.1", diff --git a/src/asciiArt.ts b/src/asciiArt.ts index a7fbaa3fe..38260c2fa 100644 --- a/src/asciiArt.ts +++ b/src/asciiArt.ts @@ -1,23 +1,18 @@ import chalk from "chalk"; +import { mind } from "gradient-string"; import { getVersion } from "./version.js"; -const b = chalk.bold.blue; const d = chalk.dim; export const CONTINUE_ASCII_ART = ` - ${b("_____")}${d("____ ")}${b("_ __")}${d("___________ ____ ______")} - ${b("/ ___/")}${d(" __ \\")}${b("/ |/ /")}${d("_ __/ _/ |/ / / / / __/")} -${b("/ /__")}${d("/ /_/ ")}${b("/ /")}${d(" / / _/ // / /_/ / _/ ")} -${b("\\___/")}${d("\\____")}${b("/_/|_/")}${d(" /_/ /___/_/|_/\\____/___/")} - - ${d("v" + getVersion())}`; -// export const CONTINUE_ASCII_ART = ` -// _________ _ _____________ ____ ______ -// / ___/ __ \\/ |/ /_ __/ _/ |/ / / / / __/ -// / /__/ /_/ / / / / _/ // / /_/ / _/ -// \\___/\\____/_/|_/ /_/ /___/_/|_/\\____/___/ -// `; +${mind.multiline(` ██████╗ ██████╗ ███╗ ██╗████████╗██╗███╗ ██╗██╗ ██╗███████╗ +██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝██║████╗ ██║██║ ██║██╔════╝ +██║ ██║ ██║██╔██╗ ██║ ██║ ██║██╔██╗ ██║██║ ██║█████╗ +██║ ██║ ██║██║╚██╗██║ ██║ ██║██║╚██╗██║██║ ██║██╔══╝ +╚██████╗╚██████╔╝██║ ╚████║ ██║ ██║██║ ╚████║╚██████╔╝███████╗ + ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝`)} + ${d("v" + getVersion())}`; export const CONTINUE_LOGO_ASCII_ART = ` @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ From 10803dfbaaadc96f4dae67b29281236cf7528071 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:04:44 -0700 Subject: [PATCH 04/13] sort slash commands --- src/slashCommands.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slashCommands.ts b/src/slashCommands.ts index ce8261c63..063645f16 100644 --- a/src/slashCommands.ts +++ b/src/slashCommands.ts @@ -1,4 +1,5 @@ import { type AssistantConfig } from "@continuedev/sdk"; +import chalk from "chalk"; import { isAuthenticated, @@ -78,9 +79,10 @@ async function handleHelp(args: string[], assistant: AssistantConfig) { const helpMessage = [ "Slash commands:", ...allCommands + .sort((a, b) => a.name.localeCompare(b.name)) .map( (cmd) => - `- /${cmd.name}: ${cmd.description}`, + `- ${chalk.white(`/${cmd.name}:`)} ${chalk.gray(cmd.description)}`, ), ].join("\n"); posthogService.capture("useSlashCommand", { name: "help" }); From d6a0bee9b696bd094863f284796570766bcbfb89 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 00:26:13 -0700 Subject: [PATCH 05/13] style input box --- src/ui/IntroMessage.tsx | 5 ++--- src/ui/UserInput.tsx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index 9d70f3140..ff59f06d6 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -42,18 +42,17 @@ const IntroMessage: React.FC = ({ {/* Agent name */} - Agent: {config.name} + Agent: {config.name} {/* Model */} - Model: {model.name.split("/").pop()} + Model: {model.name.split("/").pop()} {/* Model capability warning */} {!modelCapable && ( <> - diff --git a/src/ui/UserInput.tsx b/src/ui/UserInput.tsx index ff7d5ad29..2fe18e016 100644 --- a/src/ui/UserInput.tsx +++ b/src/ui/UserInput.tsx @@ -469,10 +469,10 @@ const UserInput: React.FC = ({ return ( <> {(inputMode || isWaitingForResponse) && ( - ▋{placeholderText} + ▋{placeholderText} )} {!inputMode && !isWaitingForResponse && ( - {placeholderText} + {placeholderText} )} ); From 6a3a25038af4bb2b06a9b0bdeb3687b4a56df0c4 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 01:45:55 -0700 Subject: [PATCH 06/13] add padding to ascii --- src/asciiArt.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/asciiArt.ts b/src/asciiArt.ts index 38260c2fa..0afb4c041 100644 --- a/src/asciiArt.ts +++ b/src/asciiArt.ts @@ -6,13 +6,13 @@ import { getVersion } from "./version.js"; const d = chalk.dim; export const CONTINUE_ASCII_ART = ` -${mind.multiline(` ██████╗ ██████╗ ███╗ ██╗████████╗██╗███╗ ██╗██╗ ██╗███████╗ -██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝██║████╗ ██║██║ ██║██╔════╝ -██║ ██║ ██║██╔██╗ ██║ ██║ ██║██╔██╗ ██║██║ ██║█████╗ -██║ ██║ ██║██║╚██╗██║ ██║ ██║██║╚██╗██║██║ ██║██╔══╝ -╚██████╗╚██████╔╝██║ ╚████║ ██║ ██║██║ ╚████║╚██████╔╝███████╗ - ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝`)} - ${d("v" + getVersion())}`; +${mind.multiline(` ██████╗ ██████╗ ███╗ ██╗████████╗██╗███╗ ██╗██╗ ██╗███████╗ + ██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝██║████╗ ██║██║ ██║██╔════╝ + ██║ ██║ ██║██╔██╗ ██║ ██║ ██║██╔██╗ ██║██║ ██║█████╗ + ██║ ██║ ██║██║╚██╗██║ ██║ ██║██║╚██╗██║██║ ██║██╔══╝ + ╚██████╗╚██████╔╝██║ ╚████║ ██║ ██║██║ ╚████║╚██████╔╝███████╗ + ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝`)} + ${d("v" + getVersion())}`; export const CONTINUE_LOGO_ASCII_ART = ` @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ From 98fd9492be9f29da64c03de36981a3750d0afda7 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 02:02:26 -0700 Subject: [PATCH 07/13] lint format --- src/ui/Selector.tsx | 38 +++++++++++++++++++++----------------- src/ui/SlashCommandUI.tsx | 14 ++++++++++---- src/ui/TUIChat.tsx | 2 +- src/ui/UserInput.tsx | 8 ++++++-- 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/src/ui/Selector.tsx b/src/ui/Selector.tsx index ba82abce1..17ab203e7 100644 --- a/src/ui/Selector.tsx +++ b/src/ui/Selector.tsx @@ -70,7 +70,10 @@ export function Selector({ {title} - {loadingMessage} + + + {loadingMessage} + ); } @@ -94,22 +97,23 @@ export function Selector({ ); } - const defaultRenderOption = ( - option: T, - isSelected: boolean, - isCurrent: boolean, - ) => ( - - {isSelected ? "> " : " "} - {option.name} - {option.displaySuffix || ""} - {isCurrent ? " (current)" : ""} - - ); + // Transform options for ink-ui Select + const selectOptions = options.map((option) => { + const displayName = option.name + (option.displaySuffix || ""); + + return { + label: displayName, + value: option.id, + }; + }); + + // Handle selection change from ink-ui Select + const handleChange = (value: string) => { + const selectedOption = options.find((option) => option.id === value); + if (selectedOption) { + onSelect(selectedOption); + } + }; return ( = ({ }); // Find the longest command name for alignment - const maxCommandLength = Math.max(...filteredCommands.map(cmd => cmd.name.length)); + const maxCommandLength = Math.max( + ...filteredCommands.map((cmd) => cmd.name.length), + ); if (filteredCommands.length === 0) { return ( @@ -61,14 +63,18 @@ const SlashCommandUI: React.FC = ({ {filteredCommands.map((command, index) => { const isSelected = index === selectedIndex; - const paddedCommandName = `/${command.name}`.padEnd(maxCommandLength + 1); + const paddedCommandName = `/${command.name}`.padEnd( + maxCommandLength + 1, + ); return ( - {" "}{paddedCommandName} + {" "} + {paddedCommandName} - {" "}{command.description} + {" "} + {command.description} diff --git a/src/ui/TUIChat.tsx b/src/ui/TUIChat.tsx index 8539f8db6..c29bd9346 100644 --- a/src/ui/TUIChat.tsx +++ b/src/ui/TUIChat.tsx @@ -211,7 +211,7 @@ const BottomStatusBar: React.FC = ({ closeCurrentScreen, }) => ( - + {currentMode === "normal" && ( <> diff --git a/src/ui/UserInput.tsx b/src/ui/UserInput.tsx index 2fe18e016..142838020 100644 --- a/src/ui/UserInput.tsx +++ b/src/ui/UserInput.tsx @@ -469,10 +469,14 @@ const UserInput: React.FC = ({ return ( <> {(inputMode || isWaitingForResponse) && ( - ▋{placeholderText} + + ▋{placeholderText} + )} {!inputMode && !isWaitingForResponse && ( - {placeholderText} + + {placeholderText} + )} ); From d0ee5a0cebf3b6fcec95fe87d727ec3f3db84b98 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 02:19:45 -0700 Subject: [PATCH 08/13] update wording and spacing --- src/ui/FileSearchUI.tsx | 2 +- src/ui/IntroMessage.tsx | 6 ++++-- src/ui/ModelCapabilityWarning.tsx | 8 +++----- src/ui/Selector.tsx | 2 +- src/ui/SlashCommandUI.tsx | 2 +- src/ui/components/MemoizedMessage.tsx | 11 ++++++----- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/ui/FileSearchUI.tsx b/src/ui/FileSearchUI.tsx index e9d63e595..48d10d07d 100644 --- a/src/ui/FileSearchUI.tsx +++ b/src/ui/FileSearchUI.tsx @@ -251,7 +251,7 @@ const FileSearchUI: React.FC = ({ - Use ↑/↓ to navigate, Enter to select, Tab to complete + ↑/↓ to navigate, Enter to select, Tab to complete diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index ff59f06d6..b918b80e2 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -50,16 +50,18 @@ const IntroMessage: React.FC = ({ Model: {model.name.split("/").pop()} + + {/* Model capability warning */} {!modelCapable && ( <> + )} - {/* MCP prompts */} {mcpPrompts.length > 0 && ( @@ -90,7 +92,7 @@ const IntroMessage: React.FC = ({ {/* MCP Servers */} {config.mcpServers?.length && ( <> - MCP Servers: + MCP Servers: {config.mcpServers.map((server: any, index: number) => ( - {server?.name} diff --git a/src/ui/ModelCapabilityWarning.tsx b/src/ui/ModelCapabilityWarning.tsx index e74c0384f..d87ba12fc 100644 --- a/src/ui/ModelCapabilityWarning.tsx +++ b/src/ui/ModelCapabilityWarning.tsx @@ -9,12 +9,10 @@ const ModelCapabilityWarning: React.FC = ({ modelName, }) => { return ( - + - ⚠️ - - Model Capability Warning - + ⚠️ + Model Capability Warning The model "{modelName}" is not recommended for use with cn due to diff --git a/src/ui/Selector.tsx b/src/ui/Selector.tsx index 17ab203e7..ce5bc3afa 100644 --- a/src/ui/Selector.tsx +++ b/src/ui/Selector.tsx @@ -138,7 +138,7 @@ export function Selector({ - Use ↑/↓ to navigate, Enter to select, Escape to cancel + ↑/↓ to navigate, Enter to select, Escape to cancel diff --git a/src/ui/SlashCommandUI.tsx b/src/ui/SlashCommandUI.tsx index 2c92887c5..456f8dc11 100644 --- a/src/ui/SlashCommandUI.tsx +++ b/src/ui/SlashCommandUI.tsx @@ -83,7 +83,7 @@ const SlashCommandUI: React.FC = ({ - Use ↑/↓ to navigate, Enter to select, Tab to complete + ↑/↓ to navigate, Enter to select, Tab to complete diff --git a/src/ui/components/MemoizedMessage.tsx b/src/ui/components/MemoizedMessage.tsx index 35e94cda6..d54fb5f1e 100644 --- a/src/ui/components/MemoizedMessage.tsx +++ b/src/ui/components/MemoizedMessage.tsx @@ -19,7 +19,7 @@ export const MemoizedMessage = memo( switch (message.messageType) { case "tool-start": return ( - + ○ {message.content} ); @@ -29,7 +29,7 @@ export const MemoizedMessage = memo( message.toolResult?.startsWith("Permission denied") || message.toolResult?.startsWith("Error"); return ( - + ● {message.content} @@ -45,7 +45,7 @@ export const MemoizedMessage = memo( case "tool-error": return ( - + ✗{" "} @@ -55,7 +55,7 @@ export const MemoizedMessage = memo( default: return ( - + {message.content} @@ -69,6 +69,7 @@ export const MemoizedMessage = memo( return ( ( } return ( - + ● {isUser ? ( From 9ab88cdf989512795a6545def783fc0268355114 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:57:43 -0700 Subject: [PATCH 09/13] formatting --- src/ui/IntroMessage.tsx | 8 +++++--- src/ui/ModelCapabilityWarning.tsx | 6 ++++-- src/ui/SlashCommandUI.tsx | 8 ++++---- src/ui/components/MemoizedMessage.tsx | 7 ++++++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index b918b80e2..607f74c80 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -47,7 +47,8 @@ const IntroMessage: React.FC = ({ {/* Model */} - Model: {model.name.split("/").pop()} + Model:{" "} + {model.name.split("/").pop()} @@ -62,7 +63,6 @@ const IntroMessage: React.FC = ({ )} - {/* MCP prompts */} {mcpPrompts.length > 0 && ( <> @@ -92,7 +92,9 @@ const IntroMessage: React.FC = ({ {/* MCP Servers */} {config.mcpServers?.length && ( <> - MCP Servers: + + MCP Servers: + {config.mcpServers.map((server: any, index: number) => ( - {server?.name} diff --git a/src/ui/ModelCapabilityWarning.tsx b/src/ui/ModelCapabilityWarning.tsx index d87ba12fc..5b9831286 100644 --- a/src/ui/ModelCapabilityWarning.tsx +++ b/src/ui/ModelCapabilityWarning.tsx @@ -11,8 +11,10 @@ const ModelCapabilityWarning: React.FC = ({ return ( - ⚠️ - Model Capability Warning + + {/* spaces in brackets to prevent prettier from fixing to 1 space */} + ⚠️{" "}Model Capability Warning + The model "{modelName}" is not recommended for use with cn due to diff --git a/src/ui/SlashCommandUI.tsx b/src/ui/SlashCommandUI.tsx index 456f8dc11..b4852933f 100644 --- a/src/ui/SlashCommandUI.tsx +++ b/src/ui/SlashCommandUI.tsx @@ -46,10 +46,6 @@ const SlashCommandUI: React.FC = ({ return a.name.localeCompare(b.name); }); - // Find the longest command name for alignment - const maxCommandLength = Math.max( - ...filteredCommands.map((cmd) => cmd.name.length), - ); if (filteredCommands.length === 0) { return ( @@ -63,6 +59,10 @@ const SlashCommandUI: React.FC = ({ {filteredCommands.map((command, index) => { const isSelected = index === selectedIndex; + // Find the longest command name to vertically align command descriptions + const maxCommandLength = Math.max( + ...filteredCommands.map((cmd) => cmd.name.length), + ); const paddedCommandName = `/${command.name}`.padEnd( maxCommandLength + 1, ); diff --git a/src/ui/components/MemoizedMessage.tsx b/src/ui/components/MemoizedMessage.tsx index d54fb5f1e..0e254f23a 100644 --- a/src/ui/components/MemoizedMessage.tsx +++ b/src/ui/components/MemoizedMessage.tsx @@ -29,7 +29,12 @@ export const MemoizedMessage = memo( message.toolResult?.startsWith("Permission denied") || message.toolResult?.startsWith("Error"); return ( - + ● {message.content} From 10b144f8326298b18032f15c06353222373c9ccc Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 12:22:40 -0700 Subject: [PATCH 10/13] remove unused import --- src/ui/IntroMessage.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index 607f74c80..9ca54e468 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -3,7 +3,6 @@ import { Box, Text } from "ink"; import React from "react"; import { parseArgs } from "../args.js"; -import { getAllSlashCommands } from "../commands/commands.js"; import { MCPService } from "../mcp.js"; import { isModelCapable } from "../utils/modelCapability.js"; @@ -22,8 +21,6 @@ const IntroMessage: React.FC = ({ }) => { const mcpPrompts = mcpService.getPrompts() ?? []; - // Get all slash commands from central definition - const allCommands = getAllSlashCommands(config); // Show all rules in a single section const args = parseArgs(); From 7947934cdf28c1851c9585d63e3416ef923a2be8 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 13:00:21 -0700 Subject: [PATCH 11/13] green isCurrent, not inverse --- src/ui/Selector.tsx | 72 ++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/src/ui/Selector.tsx b/src/ui/Selector.tsx index ce5bc3afa..32ad6d991 100644 --- a/src/ui/Selector.tsx +++ b/src/ui/Selector.tsx @@ -7,6 +7,14 @@ export interface SelectorOption { displaySuffix?: string; } +const boxStyles: React.ComponentProps = { + flexDirection: "column", + paddingX: 2, + paddingY: 1, + borderStyle: "round", + borderColor: "blue", +}; + interface SelectorProps { title: string; options: T[]; @@ -52,21 +60,17 @@ export function Selector({ return; } + // loop back to the first option after the last option, and vice versa if (key.upArrow) { - onNavigate(Math.max(0, selectedIndex - 1)); + onNavigate(selectedIndex === 0 ? options.length - 1 : selectedIndex - 1); } else if (key.downArrow) { - onNavigate(Math.min(options.length - 1, selectedIndex + 1)); + onNavigate(selectedIndex === options.length - 1 ? 0 : selectedIndex + 1); } }); if (loading) { return ( - + {title} @@ -80,12 +84,7 @@ export function Selector({ if (error) { return ( - + Error @@ -97,31 +96,30 @@ export function Selector({ ); } - // Transform options for ink-ui Select - const selectOptions = options.map((option) => { - const displayName = option.name + (option.displaySuffix || ""); - - return { - label: displayName, - value: option.id, - }; - }); - - // Handle selection change from ink-ui Select - const handleChange = (value: string) => { - const selectedOption = options.find((option) => option.id === value); - if (selectedOption) { - onSelect(selectedOption); - } - }; + const defaultRenderOption = ( + option: T, + isSelected: boolean, + isCurrent: boolean, + ) => ( + <> + + {isSelected ? "→ " : " "} + {option.name} + {option.displaySuffix || ""} + + {isCurrent && ( + + {" ✔"} + + )} + + ); return ( - + {title} From 77c28553fee08700c766e6f49740d8b4b87ed3b7 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 13:19:04 -0700 Subject: [PATCH 12/13] formatting --- src/ui/IntroMessage.tsx | 1 - src/ui/Selector.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/IntroMessage.tsx b/src/ui/IntroMessage.tsx index 9ca54e468..6458c4a90 100644 --- a/src/ui/IntroMessage.tsx +++ b/src/ui/IntroMessage.tsx @@ -21,7 +21,6 @@ const IntroMessage: React.FC = ({ }) => { const mcpPrompts = mcpService.getPrompts() ?? []; - // Show all rules in a single section const args = parseArgs(); const commandLineRules = args.rules || []; diff --git a/src/ui/Selector.tsx b/src/ui/Selector.tsx index 32ad6d991..6d00660f0 100644 --- a/src/ui/Selector.tsx +++ b/src/ui/Selector.tsx @@ -103,7 +103,7 @@ export function Selector({ ) => ( <> {isSelected ? "→ " : " "} From e77562e03980fa7863121d011ebef8add06878fc Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 14 Aug 2025 13:39:19 -0700 Subject: [PATCH 13/13] fix tests --- src/ui/__tests__/TUIChat.fileSearch.test.tsx | 14 ++++++------ src/ui/__tests__/TUIChat.remote.test.tsx | 20 ++++++++--------- src/ui/__tests__/TUIChat.toolDisplay.test.tsx | 22 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/ui/__tests__/TUIChat.fileSearch.test.tsx b/src/ui/__tests__/TUIChat.fileSearch.test.tsx index 5ab4672e1..ce8e7ca20 100644 --- a/src/ui/__tests__/TUIChat.fileSearch.test.tsx +++ b/src/ui/__tests__/TUIChat.fileSearch.test.tsx @@ -19,7 +19,7 @@ describe("TUIChat - @ File Search Tests", () => { // The @ might be in the input line or in a file search UI const hasAtSymbol = frame.includes("@") || frame.includes("◉ @"); expect(hasAtSymbol).toBe(true); - + // Mode-specific UI if (mode === 'remote') { expect(frame).toContain("Remote Mode"); @@ -42,12 +42,12 @@ describe("TUIChat - @ File Search Tests", () => { // Should show the typed text expect(frame).toContain("@READ"); - + // Navigation hints only show in local mode if (mode === 'local') { - expect(frame).toContain("Use ↑/↓ to navigate"); + expect(frame).toContain("↑/↓ to navigate"); } - + // Mode-specific checks if (mode === 'remote') { expect(frame).toContain("Remote Mode"); @@ -70,7 +70,7 @@ describe("TUIChat - @ File Search Tests", () => { // Should handle multiple @ without crashing expect(frame).toBeDefined(); expect(frame).toContain("@@test"); - + // Mode-specific UI elements if (mode === 'remote') { expect(frame).toContain("Remote Mode"); @@ -93,10 +93,10 @@ describe("TUIChat - @ File Search Tests", () => { // Should not crash and show something expect(frame).toBeDefined(); expect(frame.length).toBeGreaterThan(0); - + // Navigation hints only show in local mode if (mode === 'local') { - expect(frame).toContain("Use ↑/↓ to navigate"); + expect(frame).toContain("↑/↓ to navigate"); } }); }); \ No newline at end of file diff --git a/src/ui/__tests__/TUIChat.remote.test.tsx b/src/ui/__tests__/TUIChat.remote.test.tsx index a279c084b..887baa2c6 100644 --- a/src/ui/__tests__/TUIChat.remote.test.tsx +++ b/src/ui/__tests__/TUIChat.remote.test.tsx @@ -23,7 +23,7 @@ describe("TUIChat - Remote Server Tests", () => { ); const frame = lastFrame(); - + expect(frame).toBeDefined(); expect(frame).toContain("Remote Mode"); expect(frame).toContain("Ask anything"); @@ -34,7 +34,7 @@ describe("TUIChat - Remote Server Tests", () => { ); const frame = lastFrame(); - + // Should show remote mode in the UI expect(frame).toContain("◉ Remote Mode"); }); @@ -44,10 +44,10 @@ describe("TUIChat - Remote Server Tests", () => { ); const frame = lastFrame(); - + // Should not show loading services message expect(frame).not.toContain("Loading services"); - + // Should go directly to chat UI expect(frame).toContain("Ask anything"); }); @@ -57,7 +57,7 @@ describe("TUIChat - Remote Server Tests", () => { ); const frame = lastFrame(); - + // Should still work with different URLs expect(frame).toBeDefined(); expect(frame).toContain("Remote Mode"); @@ -78,19 +78,19 @@ describe("TUIChat - Remote Server Tests", () => { await new Promise((resolve) => setTimeout(resolve, 200)); const frame = lastFrame(); - + // Should show slash character at minimum expect(frame).toContain("/"); - + // The slash command menu might show /exit or navigation instructions // Different timing might show different states const hasSlashCommandUI = frame ? ( - frame.includes("/exit") || - frame.includes("Use ↑/↓ to navigate") || + frame.includes("/exit") || + frame.includes("↑/↓ to navigate") || frame.includes("◉ /") || frame.includes("/ for slash commands") // Placeholder text is also valid ) : false; - + expect(hasSlashCommandUI).toBe(true); }); }); \ No newline at end of file diff --git a/src/ui/__tests__/TUIChat.toolDisplay.test.tsx b/src/ui/__tests__/TUIChat.toolDisplay.test.tsx index d4e691939..5ed176eca 100644 --- a/src/ui/__tests__/TUIChat.toolDisplay.test.tsx +++ b/src/ui/__tests__/TUIChat.toolDisplay.test.tsx @@ -23,7 +23,7 @@ describe("TUIChat - Tool Display Tests", () => { ); const frame = lastFrame(); - + expect(frame).toBeDefined(); expect(frame).toContain("Ask anything"); }); @@ -33,7 +33,7 @@ describe("TUIChat - Tool Display Tests", () => { ); const frame = lastFrame(); - + // Should render normally even without tools expect(frame).toBeDefined(); expect(frame).toContain("Remote Mode"); @@ -46,11 +46,11 @@ describe("TUIChat - Tool Display Tests", () => { // Type a message that might trigger tool use stdin.write("Use a tool to help me"); - + await new Promise((resolve) => setTimeout(resolve, 50)); - + const frame = lastFrame(); - + // UI should remain stable expect(frame).toBeDefined(); if (frame) { @@ -68,24 +68,24 @@ describe("TUIChat - Tool Display Tests", () => { // Type / to see commands stdin.write("/"); - + // Wait longer for slash command menu await new Promise((resolve) => setTimeout(resolve, 200)); - + const frame = lastFrame(); - + // Should show slash command character expect(frame).toContain("/"); - + // The slash command menu might show different UI states // On Windows, the timing might be different const hasSlashCommandIndicator = frame ? ( - frame.includes("Use ↑/↓ to navigate") || + frame.includes("↑/↓ to navigate") || frame.includes("/exit") || frame.includes("◉ /") || frame.includes("/ for slash commands") ) : false; - + expect(hasSlashCommandIndicator).toBe(true); }); }); \ No newline at end of file