Compare commits

...

1 Commits

Author SHA1 Message Date
Simon Klee b7e29ff4e8 fix(tui): hide project commands from mini palette 2026-07-22 07:44:42 +02:00
2 changed files with 11 additions and 33 deletions
-32
View File
@@ -92,18 +92,6 @@ function countLabel(count: number, total: number, query: string) {
return `${count}/${total}`
}
function categoryRank(category: string) {
if (category === "Project Commands") {
return 0
}
if (category === "MCP Commands") {
return 1
}
return 2
}
function subagentStatusLabel(status: FooterSubagentTab["status"]) {
if (status === "completed") {
return "done"
@@ -374,7 +362,6 @@ export function RunCommandMenuBody(props: {
const skills = createMemo(() => (props.commands() ?? []).filter((item) => item.source === "skill"))
const activeSubagentCount = createMemo(() => props.subagents().filter((item) => item.status === "running").length)
const entries = createMemo<CommandEntry[]>(() => {
const builtins = ["compact", "editor", "new", "settings"]
const session: CommandEntry[] = [
{
action: "editor",
@@ -473,29 +460,10 @@ export function RunCommandMenuBody(props: {
]
: []),
]
const commands = (props.commands() ?? [])
.filter((item) => item.source !== "skill" && !builtins.includes(item.name))
.map(
(item) =>
({
action: "slash",
category: item.source === "mcp" ? "MCP Commands" : "Project Commands",
name: item.name,
display: item.name,
footer: `/${item.name}`,
keywords:
item.source === "mcp"
? `/${item.name} ${item.name} mcp ${item.description ?? ""}`
: `/${item.name} ${item.name} ${item.description ?? ""}`,
}) satisfies CommandEntry,
)
.sort((a, b) => categoryRank(a.category) - categoryRank(b.category) || a.display.localeCompare(b.display))
return [
...session,
...prompt,
...agent,
...commands,
{
action: "settings",
category: "System",
+11 -1
View File
@@ -355,7 +355,7 @@ test("run entry content updates when live commit text changes", async () => {
}
})
test("direct command panel renders grouped command palette", async () => {
test("direct command panel renders grouped actions without catalog commands", async () => {
const [commands] = createSignal<RunCommand[] | undefined>([
command({ name: "review", description: "Review code" }),
command({ name: "deploy", description: "Deploy prompt", source: "mcp" }),
@@ -423,6 +423,16 @@ test("direct command panel renders grouped command palette", async () => {
expect(frame).not.toContain("Review code")
expect(frame).not.toContain("Commands 8")
await app.mockInput.typeText("review")
await app.renderOnce()
expect(app.captureCharFrame()).toContain("No results found")
app.mockInput.pressKey("u", { ctrl: true })
await app.mockInput.typeText("deploy")
await app.renderOnce()
expect(app.captureCharFrame()).toContain("No results found")
app.mockInput.pressKey("u", { ctrl: true })
await app.mockInput.typeText("status")
await app.renderOnce()
expect(app.captureCharFrame()).toContain("Show status")