fix(cli): let lowercase d type in /agents search (#1006)

This commit is contained in:
paulbettner
2026-02-18 00:18:38 -05:00
committed by GitHub
parent 61139bfd4f
commit 9b438bdd91
2 changed files with 26 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
describe("agent selector shortcuts", () => {
test("uses Shift+D for delete so lowercase d can be typed in search", () => {
const selectorPath = fileURLToPath(
new URL("../../cli/components/AgentSelector.tsx", import.meta.url),
);
const source = readFileSync(selectorPath, "utf-8");
expect(source).toContain('} else if (input === "D") {');
expect(source).not.toContain('input === "d" || input === "D"');
const deleteShortcutIndex = source.indexOf('} else if (input === "D") {');
const searchTypingIndex = source.indexOf(
'} else if (activeTab !== "pinned" && input && !key.ctrl && !key.meta) {',
);
expect(deleteShortcutIndex).toBeGreaterThanOrEqual(0);
expect(searchTypingIndex).toBeGreaterThan(deleteShortcutIndex);
expect(source).toContain("Shift+D delete");
});
});