fix(cli): let lowercase d type in /agents search (#1006)
This commit is contained in:
@@ -615,7 +615,7 @@ export function AgentSelector({
|
|||||||
}
|
}
|
||||||
loadPinnedAgents();
|
loadPinnedAgents();
|
||||||
}
|
}
|
||||||
} else if (input === "d" || input === "D") {
|
} else if (input === "D") {
|
||||||
// Delete agent - open confirmation
|
// Delete agent - open confirmation
|
||||||
let selectedAgent: AgentState | null = null;
|
let selectedAgent: AgentState | null = null;
|
||||||
let selectedAgentId: string | null = null;
|
let selectedAgentId: string | null = null;
|
||||||
@@ -937,7 +937,7 @@ export function AgentSelector({
|
|||||||
: activeTab === "letta-code"
|
: activeTab === "letta-code"
|
||||||
? `Page ${lettaCodePage + 1}${lettaCodeHasMore ? "+" : `/${lettaCodeTotalPages || 1}`}${lettaCodeLoadingMore ? " (loading...)" : ""}`
|
? `Page ${lettaCodePage + 1}${lettaCodeHasMore ? "+" : `/${lettaCodeTotalPages || 1}`}${lettaCodeLoadingMore ? " (loading...)" : ""}`
|
||||||
: `Page ${allPage + 1}${allHasMore ? "+" : `/${allTotalPages || 1}`}${allLoadingMore ? " (loading...)" : ""}`;
|
: `Page ${allPage + 1}${allHasMore ? "+" : `/${allTotalPages || 1}`}${allLoadingMore ? " (loading...)" : ""}`;
|
||||||
const hintsText = `Enter select · ↑↓ ←→ navigate · Tab switch · D delete${activeTab === "pinned" ? " · P unpin" : ""}${onCreateNewAgent ? " · N new" : ""} · Esc cancel`;
|
const hintsText = `Enter select · ↑↓ ←→ navigate · Tab switch · Shift+D delete${activeTab === "pinned" ? " · P unpin" : ""}${onCreateNewAgent ? " · N new" : ""} · Esc cancel`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box flexDirection="column">
|
<Box flexDirection="column">
|
||||||
|
|||||||
24
src/tests/cli/agent-selector-shortcuts.test.ts
Normal file
24
src/tests/cli/agent-selector-shortcuts.test.ts
Normal 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");
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user