feat(webui): show forked history boundary

This commit is contained in:
Xubin Ren
2026-06-10 04:26:06 +08:00
parent 73d4b1cb2f
commit 26a58282d4
21 changed files with 242 additions and 121 deletions
+18
View File
@@ -230,6 +230,24 @@ describe("useSessions", () => {
expect(result.current.sessions[0]?.workspaceScope).toEqual(workspaceScope);
});
it("keeps a fork title visible while the server session list catches up", async () => {
vi.mocked(api.listSessions).mockResolvedValue([]);
const client = fakeClient();
client.forkChat.mockResolvedValue("chat-fork");
const { result } = renderHook(() => useSessions(), {
wrapper: wrap(client),
});
await waitFor(() => expect(result.current.loading).toBe(false));
await act(async () => {
await result.current.forkChat("source", 2, "Fork: Original title");
});
expect(client.forkChat).toHaveBeenCalledWith("source", 2, "Fork: Original title");
expect(result.current.sessions[0]?.title).toBe("Fork: Original title");
});
it("passes through WebUI transcript user media as images and media", async () => {
vi.mocked(api.fetchWebuiThread).mockResolvedValue({
schemaVersion: 3,