feat(webui): show pin indicators for pinned chats (#5025)

This commit is contained in:
chengyongru
2026-07-22 11:47:45 +08:00
committed by GitHub
parent 79d9455313
commit 7bf7469d90
2 changed files with 44 additions and 2 deletions
+26
View File
@@ -56,6 +56,32 @@ describe("ChatList", () => {
expect(text.indexOf("Middle chat")).toBeLessThan(text.indexOf("Older chat"));
});
it("shows a pin indicator for pinned chats", () => {
const sessions = [
session({ chatId: "pinned", title: "Pinned chat" }),
session({ chatId: "normal", title: "Normal chat" }),
];
render(
<ChatList
sessions={sessions}
activeKey={null}
onSelect={vi.fn()}
onRequestDelete={vi.fn()}
onTogglePin={vi.fn()}
onRequestRename={vi.fn()}
onToggleArchive={vi.fn()}
pinnedKeys={["websocket:pinned"]}
/>,
);
const pinnedSection = screen.getByRole("region", { name: "Pinned" });
expect(within(pinnedSection).getByTitle("Pinned")).toBeInTheDocument();
expect(
within(screen.getByRole("region", { name: "Earlier" })).queryByTitle("Pinned"),
).not.toBeInTheDocument();
});
it("groups WebUI chats by workspace project while preserving in-project sorting and activity", () => {
const sessions = [
session({