feat(webui): add reading text size preferences (#6325)

* feat(webui): add reading text size preferences

* fix(webui): align loading skeletons with reading typography
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-20 16:33:05 +08:00
1 parent 816c9221a0
commit 282839cc65
48 files changed
+662 -120

No files matched your search

+19 -1
View File
@@ -20,7 +20,7 @@ function Example({
mode = "buttons",
animateIndicator = true,
}: {
mode?: "buttons" | "tabs";
mode?: "buttons" | "tabs" | "radio";
animateIndicator?: boolean;
}) {
const [value, setValue] = useState("summary");
@@ -101,6 +101,24 @@ describe("SegmentedControl", () => {
expect(diff).toHaveFocus();
});
it("exposes one checked radio and moves selection and focus with the keyboard", () => {
render(<Example mode="radio" />);
const summary = screen.getByRole("radio", { name: "Summary" });
const diff = screen.getByRole("radio", { name: "Diff" });
expect(summary).toBeChecked();
expect(summary).toHaveAttribute("tabindex", "0");
expect(diff).toHaveAttribute("tabindex", "-1");
summary.focus();
fireEvent.keyDown(summary, { key: "ArrowRight" });
expect(diff).toBeChecked();
expect(diff).toHaveFocus();
expect(summary).not.toBeChecked();
fireEvent.keyDown(diff, { key: "Home" });
expect(summary).toBeChecked();
expect(summary).toHaveFocus();
});
it("can disable motion when the set of segments is dynamic", () => {
const { container } = render(<Example animateIndicator={false} />);
const summary = screen.getByRole("button", { name: "Summary" });