mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 10:50:38 +09:00
Polish issue chat transcript presentation
This commit is contained in:
parent
34589ad457
commit
92f142f7f8
6 changed files with 765 additions and 271 deletions
|
|
@ -5,7 +5,7 @@ import type { ReactNode } from "react";
|
|||
import { createRoot } from "react-dom/client";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { IssueChatThread } from "./IssueChatThread";
|
||||
import { IssueChatThread, resolveAssistantMessageFoldedState } from "./IssueChatThread";
|
||||
|
||||
vi.mock("@assistant-ui/react", () => ({
|
||||
AssistantRuntimeProvider: ({ children }: { children: ReactNode }) => <div>{children}</div>,
|
||||
|
|
@ -206,4 +206,24 @@ describe("IssueChatThread", () => {
|
|||
remount.unmount();
|
||||
});
|
||||
});
|
||||
|
||||
it("folds chain-of-thought when the same message transitions from running to complete", () => {
|
||||
expect(resolveAssistantMessageFoldedState({
|
||||
messageId: "message-1",
|
||||
currentFolded: false,
|
||||
isFoldable: true,
|
||||
previousMessageId: "message-1",
|
||||
previousIsFoldable: false,
|
||||
})).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves a manually opened completed message across rerenders", () => {
|
||||
expect(resolveAssistantMessageFoldedState({
|
||||
messageId: "message-1",
|
||||
currentFolded: false,
|
||||
isFoldable: true,
|
||||
previousMessageId: "message-1",
|
||||
previousIsFoldable: true,
|
||||
})).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue