fix(webui): keep slash commands out of streaming state

This commit is contained in:
chengyongru
2026-07-07 15:42:04 +08:00
committed by Xubin Ren
parent 0f88927364
commit 8f68040f05
6 changed files with 318 additions and 59 deletions
+17
View File
@@ -1312,6 +1312,23 @@ describe("ThreadComposer", () => {
expect(onSend).toHaveBeenCalledWith("Draw a friendly robot", undefined, undefined);
});
it("marks known slash commands as side-channel sends", () => {
const onSend = vi.fn();
render(
<ThreadComposer
onSend={onSend}
placeholder="Type your message..."
slashCommands={COMMANDS}
/>,
);
const input = screen.getByLabelText("Message input");
fireEvent.change(input, { target: { value: "/history" } });
fireEvent.click(screen.getByRole("button", { name: "Send message" }));
expect(onSend).toHaveBeenCalledWith("/history", undefined, { sideChannel: true });
});
it("shows a stop button while streaming", () => {
const onStop = vi.fn();
render(