fix(ui): contain mobile article fields and stabilize history checks
CI / check (push) Successful in 1m51s
CI / deploy (push) Successful in 1m3s
CI / publish-container (push) Successful in 42s

This commit is contained in:
Simo committed 2026-09-11 09:05:19 +02:00
1 parent 88790d1a0d
commit fe1b358ed2
5 files changed
+47 -3

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

+10 -2
View File
@@ -18,10 +18,18 @@ export function FurnitureJobsHarness() {
>
Refresh twice
</button>
<button type="button" onClick={() => void history.navigate("next")}>
<button
type="button"
disabled={history.loading || !history.nextCursor}
onClick={() => void history.navigate("next")}
>
Next page
</button>
<button type="button" onClick={() => void history.navigate("previous")}>
<button
type="button"
disabled={history.loading || history.page === 1}
onClick={() => void history.navigate("previous")}
>
Previous page
</button>
<output aria-label="Page">{history.page}</output>
+1
View File
@@ -56,6 +56,7 @@ test("history hook deduplicates refreshes, pages and reports completion once", a
await page.getByRole("button", { name: "Refresh twice" }).click();
await expect(page.getByLabel("Loading", { exact: true })).toHaveText("true");
await expect(page.getByLabel("Completions", { exact: true })).toHaveText("1");
await expect(page.getByLabel("Loading", { exact: true })).toHaveText("false");
await page.getByRole("button", { name: "Refresh twice" }).click();
await expect(page.getByLabel("Loading", { exact: true })).toHaveText("true");
await expect(page.getByLabel("Loading", { exact: true })).toHaveText("false");
+31
View File
@@ -65,6 +65,13 @@ test("article form and preview dialog pass accessibility with focus return", asy
}) => {
await page.goto("/admin/articles/new");
await expect(page.locator("iframe.tox-edit-area__iframe")).toBeVisible();
await expect
.poll(() =>
page
.locator("form")
.evaluate((form) => form.scrollWidth <= form.clientWidth),
)
.toBe(true);
await accessible(page);
await page.locator('input[name="title"]').fill("Accessible community update");
const preview = page.getByRole("button", { name: "Preview", exact: true });
@@ -129,3 +136,27 @@ test("queued synchronization survives reload without duplicate submission", asyn
await accessible(page);
await expect(page.getByRole("main")).toHaveScreenshot("sync-history.png");
});
test("article editor fits a narrow mobile card without horizontal overflow", async ({
page,
}) => {
await page.setViewportSize({ width: 360, height: 844 });
await page.goto("/admin/articles/new");
await expect(page.locator("iframe.tox-edit-area__iframe")).toBeVisible();
await expect
.poll(() =>
page
.locator("form")
.evaluate((form) => form.scrollWidth <= form.clientWidth),
)
.toBe(true);
await expect
.poll(() =>
page.evaluate(
() =>
document.documentElement.scrollWidth <=
document.documentElement.clientWidth,
),
)
.toBe(true);
});
+5 -1
View File
@@ -186,7 +186,11 @@ export function ArticleForm({
});
}}
className="admin-card"
style={{ display: "grid", gap: "1rem" }}
style={{
display: "grid",
gridTemplateColumns: "minmax(0, 1fr)",
gap: "1rem",
}}
>
<fieldset disabled={pending} className="contents">
<input type="hidden" name="baseToken" value={token} />