perf(webui): reduce repeated work and bound history rendering (#5703)

* perf(webui): reduce repeated work and bound history rendering

* fix(webui): keep continuation reasoning with its answer

* refactor(webui): reuse answer buffers and prepared copy text

* perf(webui): restore conditional replay buffer initialization

* fix(webui): remove code block pagination
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-09 14:02:26 +08:00
1 parent 1c451b5b5f
commit 1469d4811c
32 files changed
+1156 -361

No files matched your search

@@ -17,6 +17,17 @@ function session(index: number): ChatSummary {
}
describe("SessionSearchDialog", () => {
it("windows large result sets and selects an item reached beyond the first window", () => {
const onSelect = vi.fn();
render(<SessionSearchDialog open sessions={Array.from({ length: 1000 }, (_, i) => session(i))}
activeKey={null} loading={false} onOpenChange={() => {}} onSelect={onSelect} />);
expect(screen.getAllByRole("button").length).toBeLessThanOrEqual(24);
const input = screen.getByRole("textbox", { name: "Search" });
for (let i = 0; i < 40; i++) fireEvent.keyDown(input, { key: "ArrowDown" });
fireEvent.keyDown(input, { key: "Enter" });
expect(onSelect).toHaveBeenCalledWith("websocket:chat-40");
expect(screen.getAllByRole("button").length).toBeLessThanOrEqual(24);
});
afterEach(() => {
vi.restoreAllMocks();
});