Merge pull request #213 from continuedev/tingwai/con-3452-ui-touchup

UI improvements
This commit is contained in:
Nate Sesti 2025-08-14 20:35:12 -07:00 • committed by GitHub
commit fa6c67c2b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 224 additions and 173 deletions

36
package-lock.json generated
View file

@ -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",

View file

@ -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",

View file

@ -1,74 +1,69 @@
import chalk from "chalk";
import { mind } from "gradient-string";
import { getVersion } from "./version.js";
const b = chalk.bold.magenta;
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 = `
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@@
@@@@@@@@@@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @
@@@@@@@@@@@@ @@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@ @@@@
@@@@@@@@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@ @@@@@@@@@@@ @@@@@@@
@@@@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@ @@@@@@@@@@@@ @@@@@@@@@
@@@@@@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@@@@@@@@@ @@@@@@ @@@@@@@@@@@ @@@@
@@@@@@@@@@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @
@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
`;

View file

@ -77,11 +77,13 @@ 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
.sort((a, b) => a.name.localeCompare(b.name))
.map(
(cmd) =>
`- ${chalk.white(`/${cmd.name}:`)} ${chalk.gray(cmd.description)}`,
),
].join("\n");
posthogService.capture("useSlashCommand", { name: "help" });
return { output: helpMessage };

View file

@ -251,7 +251,7 @@ const FileSearchUI: React.FC<FileSearchUIProps> = ({
<Box marginTop={1}>
<Text color="gray" dimColor>
Use ↑/↓ to navigate, Enter to select, Tab to complete
↑/↓ to navigate, Enter to select, Tab to complete
</Text>
</Box>
</Box>

View file

@ -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,9 +21,6 @@ const IntroMessage: React.FC<IntroMessageProps> = ({
}) => {
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();
const commandLineRules = args.rules || [];
@ -41,45 +37,40 @@ const IntroMessage: React.FC<IntroMessageProps> = ({
return (
<Box flexDirection="column" paddingX={1} paddingY={1}>
{/* Agent name */}
<Text bold color="yellow">
Agent: {config.name}
<Text color="blue">
<Text bold>Agent:</Text> <Text color="white">{config.name}</Text>
</Text>
{/* Model */}
<Text color="blue">
Model: <Text color="white">{model.name.split("/").pop()}</Text>
<Text bold>Model:</Text>{" "}
<Text color="white">{model.name.split("/").pop()}</Text>
</Text>
<Text> </Text>
{/* Model capability warning */}
{!modelCapable && (
<>
<Text> </Text>
<ModelCapabilityWarning
modelName={model.name.split("/").pop() || model.name}
/>
<Text> </Text>
</>
)}
<Text> </Text>
{/* Slash commands */}
<Text color="blue">Slash commands:</Text>
{allCommands.map((command, index) => (
<Text key={index}>
- <Text color="white">/{command.name}</Text>:{" "}
<Text color="gray">{command.description}</Text>
</Text>
))}
{/* MCP prompts */}
{mcpPrompts.map((prompt, index) => (
<Text key={`mcp-${index}`}>
- <Text color="white">/{prompt.name}</Text>:{" "}
<Text color="gray">{prompt.description}</Text>
</Text>
))}
<Text> </Text>
{mcpPrompts.length > 0 && (
<>
{mcpPrompts.map((prompt, index) => (
<Text key={`mcp-${index}`}>
- <Text color="white">/{prompt.name}</Text>:{" "}
<Text color="gray">{prompt.description}</Text>
</Text>
))}
<Text> </Text>
</>
)}
{/* Rules */}
{allRules.length > 0 && (
@ -97,7 +88,9 @@ const IntroMessage: React.FC<IntroMessageProps> = ({
{/* MCP Servers */}
{config.mcpServers?.length && (
<>
<Text color="blue">MCP Servers:</Text>
<Text bold color="blue">
MCP Servers:
</Text>
{config.mcpServers.map((server: any, index: number) => (
<Text key={index}>
- <Text color="white">{server?.name}</Text>

View file

@ -9,11 +9,11 @@ const ModelCapabilityWarning: React.FC<ModelCapabilityWarningProps> = ({
modelName,
}) => {
return (
<Box flexDirection="column" paddingX={1}>
<Box flexDirection="column" paddingX={0}>
<Box flexDirection="row" alignItems="center">
<Text color="yellow">⚠️ </Text>
<Text color="yellow" bold>
Model Capability Warning
<Text bold color="white">
{/* spaces in brackets to prevent prettier from fixing to 1 space */}
⚠️{" "}Model Capability Warning
</Text>
</Box>
<Text color="gray">

View file

@ -7,6 +7,14 @@ export interface SelectorOption {
displaySuffix?: string;
}
const boxStyles: React.ComponentProps<typeof Box> = {
flexDirection: "column",
paddingX: 2,
paddingY: 1,
borderStyle: "round",
borderColor: "blue",
};
interface SelectorProps<T extends SelectorOption> {
title: string;
options: T[];
@ -52,37 +60,31 @@ export function Selector<T extends SelectorOption>({
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 (
<Box
flexDirection="column"
padding={1}
borderStyle="round"
borderColor="blue"
>
<Box {...boxStyles}>
<Text color="blue" bold>
{title}
</Text>
<Text color="gray">{loadingMessage}</Text>
<Text> </Text>
<Text italic color="gray">
{loadingMessage}
</Text>
</Box>
);
}
if (error) {
return (
<Box
flexDirection="column"
padding={1}
borderStyle="round"
borderColor="red"
>
<Box {...boxStyles}>
<Text color="red" bold>
Error
</Text>
@ -99,25 +101,25 @@ export function Selector<T extends SelectorOption>({
isSelected: boolean,
isCurrent: boolean,
) => (
<Text
color={isSelected ? "blue" : "white"}
bold={isSelected}
inverse={isSelected}
>
{isSelected ? "> " : " "}
{option.name}
{option.displaySuffix || ""}
{isCurrent ? " (current)" : ""}
</Text>
<>
<Text
color={isSelected ? "blue" : isCurrent ? "green" : "white"}
bold={isSelected}
>
{isSelected ? "→ " : " "}
{option.name}
{option.displaySuffix || ""}
</Text>
{isCurrent && (
<Text bold color="green">
{" ✔"}
</Text>
)}
</>
);
return (
<Box
flexDirection="column"
padding={1}
borderStyle="round"
borderColor="blue"
>
<Box {...boxStyles}>
<Text color="blue" bold>
{title}
</Text>
@ -134,7 +136,7 @@ export function Selector<T extends SelectorOption>({
</Box>
<Box marginTop={1}>
<Text color="gray" dimColor>
Use ↑/↓ to navigate, Enter to select, Escape to cancel
↑/↓ to navigate, Enter to select, Escape to cancel
</Text>
</Box>
</Box>

View file

@ -45,6 +45,7 @@ const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
return a.name.localeCompare(b.name);
});
if (filteredCommands.length === 0) {
return (
<Box paddingX={1} marginX={1} marginBottom={1}>
@ -58,12 +59,23 @@ const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
{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,
);
return (
<Box key={command.name}>
<Text color="white" bold={isSelected}>
<Text color={isSelected ? "blue" : "white"} bold={isSelected}>
{" "}
<Text color="green">/{command.name}</Text>
<Text color="gray"> - {command.description}</Text>
{paddedCommandName}
<Text color={isSelected ? "blue" : "gray"}>
{" "}
{command.description}
</Text>
</Text>
</Box>
);
@ -71,7 +83,7 @@ const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
<Box marginTop={1}>
<Text color="gray" dimColor>
Use ↑/↓ to navigate, Enter to select, Tab to complete
↑/↓ to navigate, Enter to select, Tab to complete
</Text>
</Box>
</Box>

View file

@ -211,7 +211,7 @@ const BottomStatusBar: React.FC<BottomStatusBarProps> = ({
closeCurrentScreen,
}) => (
<Box flexDirection="row" justifyContent="space-between" alignItems="center">
<Box flexDirection="row" alignItems="center">
<Box marginLeft={2} flexDirection="row" alignItems="center">
{currentMode === "normal" && (
<>
<Text color="dim" wrap="truncate-start">

View file

@ -487,10 +487,14 @@ const UserInput: React.FC<UserInputProps> = ({
return (
<>
{(inputMode || isWaitingForResponse) && (
<Text color="gray">▋{placeholderText}</Text>
<Text italic color="gray">
▋{placeholderText}
</Text>
)}
{!inputMode && !isWaitingForResponse && (
<Text color="gray">{placeholderText}</Text>
<Text italic color="gray">
{placeholderText}
</Text>
)}
</>
);

View file

@ -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");
}
});
});

View file

@ -23,7 +23,7 @@ describe("TUIChat - Remote Server Tests", () => {
<AppRoot remoteUrl="http://localhost:3000" />
);
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", () => {
<AppRoot remoteUrl="http://localhost:3000" />
);
const frame = lastFrame();
// Should show remote mode in the UI
expect(frame).toContain("◉ Remote Mode");
});
@ -44,10 +44,10 @@ describe("TUIChat - Remote Server Tests", () => {
<AppRoot remoteUrl="http://localhost:3000" />
);
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", () => {
<AppRoot remoteUrl="https://api.example.com:8080" />
);
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);
});
});

View file

@ -23,7 +23,7 @@ describe("TUIChat - Tool Display Tests", () => {
<AppRoot remoteUrl="http://localhost:3000" />
);
const frame = lastFrame();
expect(frame).toBeDefined();
expect(frame).toContain("Ask anything");
});
@ -33,7 +33,7 @@ describe("TUIChat - Tool Display Tests", () => {
<AppRoot remoteUrl="http://localhost:3000" />
);
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);
});
});

View file

@ -19,7 +19,7 @@ export const MemoizedMessage = memo<MemoizedMessageProps>(
switch (message.messageType) {
case "tool-start":
return (
<Box key={index} marginBottom={1}>
<Box key={index} marginLeft={1} marginBottom={1}>
<Text color="white">○ {message.content}</Text>
</Box>
);
@ -29,7 +29,12 @@ export const MemoizedMessage = memo<MemoizedMessageProps>(
message.toolResult?.startsWith("Permission denied") ||
message.toolResult?.startsWith("Error");
return (
<Box key={index} marginBottom={1} flexDirection="column">
<Box
key={index}
marginLeft={1}
marginBottom={1}
flexDirection="column"
>
<Box>
<Text color={isFailure ? "red" : "green"}>●</Text>
<Text> {message.content}</Text>
@ -45,7 +50,7 @@ export const MemoizedMessage = memo<MemoizedMessageProps>(
case "tool-error":
return (
<Box key={index} marginBottom={1}>
<Box key={index} marginLeft={1} marginBottom={1}>
<Text color="red" bold>
✗{" "}
</Text>
@ -55,7 +60,7 @@ export const MemoizedMessage = memo<MemoizedMessageProps>(
default:
return (
<Box key={index} marginBottom={1}>
<Box key={index} marginLeft={1} marginBottom={1}>
<Text color="gray" italic>
{message.content}
</Text>
@ -69,6 +74,7 @@ export const MemoizedMessage = memo<MemoizedMessageProps>(
return (
<Box
key={index}
marginLeft={1}
marginBottom={1}
borderStyle="single"
borderBottom={false}
@ -80,7 +86,7 @@ export const MemoizedMessage = memo<MemoizedMessageProps>(
}
return (
<Box key={index} marginBottom={1}>
<Box key={index} marginLeft={1} marginBottom={1}>
<Text color={isUser ? "green" : "magenta"}>●</Text>
<Text> </Text>
{isUser ? (