fix(webui): restore session drag and review findings

This commit is contained in:
chengyongru
2026-08-12 17:26:13 +08:00
committed by chengyongru
parent 4b5319b760
commit 686dd0603e
24 changed files with 494 additions and 169 deletions
@@ -0,0 +1,52 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { ThinkingReasoningShell } from "@/components/thread/activity/ThinkingReasoningShell";
function renderShell(expanded: boolean) {
return render(
<ThinkingReasoningShell
active={false}
expanded={expanded}
label="Thought"
viewportRef={() => undefined}
contentRef={() => undefined}
fadeTop={false}
fadeBottom={false}
onToggle={vi.fn()}
onScroll={vi.fn()}
>
<button type="button">Hidden action</button>
</ThinkingReasoningShell>,
);
}
describe("ThinkingReasoningShell", () => {
it("makes collapsed descendants inert as well as visually hidden", () => {
const { rerender } = renderShell(false);
const disclosure = screen.getByRole("button", { name: "Thought" });
const collapsible = disclosure.nextElementSibling;
expect(collapsible).toHaveAttribute("inert");
expect(collapsible).toHaveAttribute("aria-hidden", "true");
rerender(
<ThinkingReasoningShell
active={false}
expanded
label="Thought"
viewportRef={() => undefined}
contentRef={() => undefined}
fadeTop={false}
fadeBottom={false}
onToggle={vi.fn()}
onScroll={vi.fn()}
>
<button type="button">Hidden action</button>
</ThinkingReasoningShell>,
);
expect(disclosure.nextElementSibling).not.toHaveAttribute("inert");
expect(disclosure.nextElementSibling).toHaveAttribute("aria-hidden", "false");
});
});