From 2639d6ce1e049400f6cb2af999a7eee1f4a95528 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 8 Sep 2025 18:45:33 -0700 Subject: [PATCH 1/3] feat: enter to continue Co-authored-by: Nate Sesti --- extensions/cli/src/ui/TipsDisplay.tsx | 2 +- extensions/cli/src/ui/UserInput.tsx | 4 +++- .../ui/__tests__/TUIChat.interruption.minimal.test.tsx | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/extensions/cli/src/ui/TipsDisplay.tsx b/extensions/cli/src/ui/TipsDisplay.tsx index 0ec90de92..148e06583 100644 --- a/extensions/cli/src/ui/TipsDisplay.tsx +++ b/extensions/cli/src/ui/TipsDisplay.tsx @@ -4,7 +4,7 @@ import React, { useMemo } from "react"; // Array of helpful tips for Continue CLI users const CONTINUE_CLI_TIPS = [ "Use `/help` to learn keyboard shortcuts", - "Press escape to pause cn, and press enter to resume", + "Press escape to pause cn, and press enter to continue", "Use arrow keys (↑/↓) to navigate through your input history", 'Multi-line input is supported by typing "\\" and pressing enter', "Use `cn ls` or `/resume` to resume a previous conversation", diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index 910257523..9d837a5ef 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -27,7 +27,9 @@ const InterruptedBanner: React.FC<{ wasInterrupted: boolean }> = ({ if (!wasInterrupted) return null; return ( - ⚠ Interrupted by user - Press enter to resume + + ⚠ Interrupted by user - Press enter to continue + ); }; diff --git a/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx b/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx index 6dc292cad..8d04fab5b 100644 --- a/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx +++ b/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx @@ -33,7 +33,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { let frame = lastFrame(); expect(frame).toBeDefined(); expect(frame).not.toContain("⚠ Interrupted by user"); - expect(frame).not.toContain("Press enter to resume"); + expect(frame).not.toContain("Press enter to continue"); // Re-render with wasInterrupted: true rerender( @@ -50,7 +50,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { frame = lastFrame(); expect(frame).toBeDefined(); expect(frame).toContain("⚠ Interrupted by user"); - expect(frame).toContain("Press enter to resume"); + expect(frame).toContain("Press enter to continue"); } finally { unmount(); } @@ -75,7 +75,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { let frame = lastFrame(); expect(frame).toBeDefined(); expect(frame).toContain("⚠ Interrupted by user"); - expect(frame).toContain("Press enter to resume"); + expect(frame).toContain("Press enter to continue"); // Re-render with wasInterrupted: false rerender( @@ -92,7 +92,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { frame = lastFrame(); expect(frame).toBeDefined(); expect(frame).not.toContain("⚠ Interrupted by user"); - expect(frame).not.toContain("Press enter to resume"); + expect(frame).not.toContain("Press enter to continue"); } finally { unmount(); } From 943f59607c559ebb1b79de86d9ef529b587de1c5 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 8 Sep 2025 21:27:31 -0700 Subject: [PATCH 2/3] fix: remove warning triangle --- extensions/cli/src/ui/UserInput.tsx | 4 +--- .../ui/__tests__/TUIChat.interruption.minimal.test.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index 9d837a5ef..4b5deb5bc 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -27,9 +27,7 @@ const InterruptedBanner: React.FC<{ wasInterrupted: boolean }> = ({ if (!wasInterrupted) return null; return ( - - ⚠ Interrupted by user - Press enter to continue - + Interrupted by user - Press enter to continue ); }; diff --git a/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx b/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx index 8d04fab5b..9377a1d4f 100644 --- a/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx +++ b/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx @@ -1,6 +1,6 @@ import { render } from "ink-testing-library"; import React from "react"; -import { vi, expect, describe, it, beforeEach, afterEach } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { UserInput } from "../UserInput.js"; @@ -32,7 +32,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { // Initial render - no interruption message let frame = lastFrame(); expect(frame).toBeDefined(); - expect(frame).not.toContain("⚠ Interrupted by user"); + expect(frame).not.toContain("Interrupted by user"); expect(frame).not.toContain("Press enter to continue"); // Re-render with wasInterrupted: true @@ -49,7 +49,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { // Should show interruption message frame = lastFrame(); expect(frame).toBeDefined(); - expect(frame).toContain("⚠ Interrupted by user"); + expect(frame).toContain("Interrupted by user"); expect(frame).toContain("Press enter to continue"); } finally { unmount(); @@ -74,7 +74,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { // Initial render - should show interruption message let frame = lastFrame(); expect(frame).toBeDefined(); - expect(frame).toContain("⚠ Interrupted by user"); + expect(frame).toContain("Interrupted by user"); expect(frame).toContain("Press enter to continue"); // Re-render with wasInterrupted: false @@ -91,7 +91,7 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { // Should not show interruption message frame = lastFrame(); expect(frame).toBeDefined(); - expect(frame).not.toContain("⚠ Interrupted by user"); + expect(frame).not.toContain("Interrupted by user"); expect(frame).not.toContain("Press enter to continue"); } finally { unmount(); From 9b211a21fb5fd360577d795d590959dbd4f8a3c9 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 8 Sep 2025 21:48:47 -0700 Subject: [PATCH 3/3] fix tests --- extensions/cli/package-lock.json | 2 +- .../src/ui/__tests__/TUIChat.interruption.minimal.test.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index 8bb910c94..e74cc388e 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -310,7 +310,7 @@ "@types/node": "^20.11.19", "@types/shell-quote": "^1.7.5", "typescript": "^5.5.2", - "vitest": "^1.6.0" + "vitest": "^3.2.4" } }, "node_modules/@alcalzone/ansi-tokenize": { diff --git a/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx b/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx index 9377a1d4f..8a4abe341 100644 --- a/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx +++ b/extensions/cli/src/ui/__tests__/TUIChat.interruption.minimal.test.tsx @@ -177,10 +177,10 @@ describe("TUIChat - Interruption UI (Minimal Test)", () => { let foundInputBoxLine = -1; frameLines.forEach((line, index) => { - if (line.includes("⚠ Interrupted by user")) { + if (line.includes("Interrupted by user")) { foundInterruptionLine = index; } - if (line.includes("●") && line.includes("▋")) { + if (line.includes("●") || line.includes("▋")) { foundInputBoxLine = index; } });