fix(webui): preserve range selection and turn timing

This commit is contained in:
Xubin Ren
2026-08-15 15:40:52 +08:00
parent 4de728a555
commit e630e78075
9 changed files with 262 additions and 16 deletions
+36
View File
@@ -662,6 +662,42 @@ describe("ChatList", () => {
expect(screen.queryByTestId("delete-selection-bar")).not.toBeInTheDocument();
});
it("selects a contiguous session range with Shift-click", async () => {
render(
<ChatList
sessions={[
session({ chatId: "first", title: "First topic" }),
session({ chatId: "second", title: "Second topic" }),
session({ chatId: "third", title: "Third topic" }),
session({ chatId: "fourth", title: "Fourth topic" }),
]}
activeKey="websocket:first"
onSelect={vi.fn()}
onRequestDelete={vi.fn()}
onTogglePin={vi.fn()}
onRequestRename={vi.fn()}
onToggleArchive={vi.fn()}
/>,
);
fireEvent.pointerDown(screen.getByRole("button", {
name: "Topic actions for First topic",
}), { button: 0, ctrlKey: false });
fireEvent.click(await screen.findByRole("menuitem", { name: "Select" }));
fireEvent.click(screen.getByRole("button", { name: "Fourth topic" }), {
shiftKey: true,
});
expect(screen.getByText("4 selected")).toBeInTheDocument();
for (const title of ["First topic", "Second topic", "Third topic", "Fourth topic"]) {
expect(screen.getByRole("button", { name: title })).toHaveAttribute(
"aria-pressed",
"true",
);
}
});
it("shows temporary chats separately and lets the user reopen or close them", async () => {
const temporarySession = session({
key: "temporary:temporary-one",