Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: a lone /word goes without the space completion leaves

This commit is contained in:
iris 2026-11-16 17:39:35 +01:00 • committed by mara
commit 2f3c9253bf

View file

@ -10,6 +10,7 @@ import {
menuQuery,
moveSelection,
splitName,
textToSend,
} from "../src/agent/terminal/command-menu.ts";
const cmd = (name, kind = "command", description = "") => ({
@ -113,3 +114,16 @@ test("without the backend's /clear command, or with a skill of that name, it is
assert.equal(controlRoute("/clear", []), null);
assert.equal(controlRoute("/clear", [cmd("clear", "skill")]), null);
});
test("a lone slash word goes without the space completion left", () => {
assert.equal(textToSend("/compact "), "/compact");
assert.equal(textToSend("/compact"), "/compact");
assert.equal(textToSend(" /base:pr-review "), "/base:pr-review");
});
test("any other message goes as it is", () => {
assert.equal(textToSend("hello "), "hello ");
assert.equal(textToSend("/compact now "), "/compact now ");
assert.equal(textToSend("fix /etc/hosts"), "fix /etc/hosts");
assert.equal(textToSend(" "), " ");
});