fix(frontend): harden activity split responsiveness

This commit is contained in:
User
2026-07-15 15:52:22 +02:00
parent f0ef2654df
commit 1f540fcb78
6 changed files with 160 additions and 18 deletions
@@ -40,6 +40,25 @@ test("renders question, reasoning, and response in chronological order", () => {
expect(screen.queryByText("bash")).not.toBeInTheDocument();
});
test("uses the activity-only Markdown wrapping renderer for long content", () => {
useSessionStore.setState({
activityLog: [
{ kind: "prompt", phase: "F1", text: "https://example.test/" + "x".repeat(120) },
{ kind: "thinking", phase: "F1", text: "Inline `" + "code".repeat(40) + "`" },
{ kind: "assistant", phase: "F1", text: "| Cell |\n| --- |\n| " + "table".repeat(40) + " |\n\n```sql\n" + "select_".repeat(40) + "\n```" },
],
});
render(<ModelActivityPanel onClose={vi.fn()} />);
const renderers = document.querySelectorAll(".thot-activity-prose");
expect(renderers).toHaveLength(3);
expect(renderers[0]).toHaveClass("thot-prose");
expect(renderers[1].querySelector("code")).not.toBeNull();
expect(renderers[2].querySelector("td")).not.toBeNull();
expect(renderers[2].querySelector("pre")).not.toBeNull();
});
test("uses an explicit default-deny activity-kind allowlist", () => {
const predicate = (activityPanelModule as unknown as {
isVisibleModelActivity?: (entry: ActivityEntry) => boolean;