Elffuss BraidHub

kikocis/continue public

fix: /help tests
Changeset66328f2e8dcfbe89907183fed02dcc8e8815f34d4bd6863aa0b841de8e69c59b
AuthorNate <sestinj@gmail.com> · 2025-08-28 20:37 -07:00
CommitterNate <sestinj@gmail.com> · 2025-08-28 20:37 -07:00
Parents3dbe838518f2

Browse the files at this changeset

2 files changed

modified extensions/cli/src/slashCommands.test.ts +22 −0
@@ -96,6 +96,28 @@
9696 });
9797
9898 describe("handleSlashCommands", () => {
99+ it("should handle /help command", async () => {
100+ const result = await handleSlashCommands("/help", mockAssistant);
101+
102+ expect(result).toBeDefined();
103+ expect(result?.output).toContain("Keyboard Shortcuts:");
104+ expect(result?.output).toContain("Navigation:");
105+ expect(result?.output).toContain("↑/↓");
106+ expect(result?.output).toContain("Tab");
107+ expect(result?.output).toContain("Enter");
108+ expect(result?.output).toContain("Shift+Enter");
109+ expect(result?.output).toContain("Controls:");
110+ expect(result?.output).toContain("Ctrl+C");
111+ expect(result?.output).toContain("Ctrl+D");
112+ expect(result?.output).toContain("Ctrl+L");
113+ expect(result?.output).toContain("Shift+Tab");
114+ expect(result?.output).toContain("Esc");
115+ expect(result?.output).toContain("Special Characters:");
116+ expect(result?.output).toContain("@");
117+ expect(result?.output).toContain("/");
118+ expect(result?.exit).toBeUndefined();
119+ });
120+
99121 it("should handle /info command when not authenticated", async () => {
100122 const { isAuthenticated } = await import("./auth/workos.js");
101123 const { services } = await import("./services/index.js");
modified extensions/cli/src/slashCommands.ts +16 −8
@@ -18,25 +18,33 @@
1818 assistant: AssistantConfig,
1919 ) => Promise<SlashCommandResult> | SlashCommandResult;
2020
21-async function handleHelp() {
21+async function handleHelp(
22+ _args: string[],
23+ _assistant: AssistantConfig,
24+) {
2225 const helpMessage = [
2326 chalk.bold("Keyboard Shortcuts:"),
2427 "",
2528 chalk.white("Navigation:"),
26- ` ${chalk.cyan("↑/↓")} Navigate previous messages`,
29+ ` ${chalk.cyan("↑/↓")} Navigate command/file suggestions or history`,
30+ ` ${chalk.cyan("Tab")} Complete command or file selection`,
2731 ` ${chalk.cyan("Enter")} Submit message`,
28- ` ${chalk.cyan("\\+Enter")} New line`,
32+ ` ${chalk.cyan("Shift+Enter")} New line`,
33+ ` ${chalk.cyan("\\")} Line continuation (at end of line)`,
2934 "",
3035 chalk.white("Controls:"),
3136 ` ${chalk.cyan("Ctrl+C")} Clear input`,
3237 ` ${chalk.cyan("Ctrl+D")} Exit application`,
33- ` ${chalk.cyan("Shift+Tab")} Cycle modes`,
34- ` ${chalk.cyan("Esc")} Interrupt`,
38+ ` ${chalk.cyan("Ctrl+L")} Clear screen`,
39+ ` ${chalk.cyan("Shift+Tab")} Cycle permission modes (normal/plan/auto)`,
40+ ` ${chalk.cyan("Esc")} Cancel streaming or close suggestions`,
3541 "",
3642 chalk.white("Special Characters:"),
37- ` ${chalk.cyan("@")} Attach files`,
38- ` ${chalk.cyan("/")} Slash commands`,
39- "",
43+ ` ${chalk.cyan("@")} Search and attach files for context`,
44+ ` ${chalk.cyan("/")} Access slash commands`,
45+ "",
46+ chalk.white("Available Commands:"),
47+ ` Type ${chalk.cyan("/")} to see available slash commands`,
4048 ].join("\n");
4149 posthogService.capture("useSlashCommand", { name: "help" });
4250 return { output: helpMessage };