feat(webui): add temporary chat mode

This commit is contained in:
Xubin Ren
2026-08-08 23:20:59 +08:00
parent 113e8d67ad
commit c9a6145878
41 changed files with 1500 additions and 119 deletions
+36
View File
@@ -848,6 +848,42 @@ describe("ThreadShell", () => {
expect(screen.getByText("persist me across tabs")).toBeInTheDocument();
});
it("keeps temporary messages across navigation and drops them after clear", async () => {
const client = makeClient();
const view = (chatId: string, temporary: boolean) => wrap(
client,
<ThreadShell
session={session(chatId)}
title={temporary ? "Temporary chat" : "Regular chat"}
temporary={temporary}
onToggleSidebar={() => {}}
/>,
);
const { rerender } = render(view("temporary-live", true));
fireEvent.change(screen.getByLabelText("Message input"), {
target: { value: "keep this only in memory" },
});
fireEvent.click(screen.getByRole("button", { name: "Send message" }));
await waitFor(() => expectSendMessageWithTurn(
client,
"temporary-live",
"keep this only in memory",
));
rerender(view("regular", false));
await waitFor(() => {
expect(screen.queryByText("keep this only in memory")).not.toBeInTheDocument();
});
rerender(view("temporary-live", true));
expect(screen.getByText("keep this only in memory")).toBeInTheDocument();
rerender(view("temporary-cleared", true));
await waitFor(() => {
expect(screen.queryByText("keep this only in memory")).not.toBeInTheDocument();
});
});
it("highlights sent skill references without skill metadata", async () => {
const client = makeClient();
render(wrap(