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

+7 -2
View File
@@ -187,8 +187,12 @@ for (const width of [390, 1440]) {
} finally { release(); }
});
test("file preview skeletons follow code gutters and Markdown controls", async ({ page }) => {
for (const readingTextSize of ["small", "standard", "large"] as const) test(`file preview skeletons follow code gutters and Markdown controls: ${readingTextSize}`, async ({ page }) => {
await page.addInitScript((size) => {
localStorage.setItem("nanobot-webui.settings-preferences", JSON.stringify({ schemaVersion: 1, readingTextSize: size }));
}, readingTextSize);
await page.goto(fixture("file"));
await expect(page.locator("html")).toHaveAttribute("data-reading-text-size", readingTextSize);
await expect(page.getByTestId("viewport-code-rows")).toBeVisible();
const source = await box(page.locator("pre"));
const code = await box(page.locator("[data-highlighted]"));
@@ -202,7 +206,8 @@ for (const width of [390, 1440]) {
const controls = await box(page.getByTestId("file-preview-panel").locator(":scope > div").first());
await page.goto(fixture("markdown", true));
sameBox(await box(status(page).locator("[aria-hidden] > .flex").first()), controls);
const title = await box(status(page).locator(".h-7 > div"));
const title = await box(status(page).locator("[data-file-preview-heading-skeleton]"));
sameBox(title, heading);
expect(title.x).toBe(heading.x);
expect(title.y + title.height / 2).toBe(heading.y + heading.height / 2);
await noOverflow(page);