Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

Fix the two nightly frontend failures (a11y contrast + Firefox Copy menu test) (#7286)

EthanHealy014d8a86ad2862
diff --git a/frontend/editor/src/core/tests/stubbed/viewer-text-selection.spec.ts b/frontend/editor/src/core/tests/stubbed/viewer-text-selection.spec.ts
index d9a08ae9e7..55dad6e2a4 100644
--- a/frontend/editor/src/core/tests/stubbed/viewer-text-selection.spec.ts
+++ b/frontend/editor/src/core/tests/stubbed/viewer-text-selection.spec.ts
@@ -120,27 +120,35 @@ test("Ctrl+C copies selected text to the clipboard", async ({
expect(clipboardText.trim().length).toBeGreaterThan(0);
});
-test("right-click on a word auto-selects it and reveals the Copy menu", async ({
- page,
-}) => {
- test.setTimeout(60_000);
- const firstPage = await loadSampleAndOpenViewer(page);
- const box = await firstPage.boundingBox();
- if (!box) throw new Error("no box");
-
- // Right-click on a word in the top paragraph "Test document for word documents".
- await page.mouse.click(box.x + box.width * 0.21, box.y + box.height * 0.105, {
- button: "right",
+// Pinned wide: the page is auto-fit, so at the 1280x720 firefox/webkit projects
+// the text renders too small to hit-test a word reliably.
+test.describe("right-click selection", () => {
+ test.use({ viewport: { width: 1920, height: 1080 } });
+
+ test("right-click on a word auto-selects it and reveals the Copy menu", async ({
+ page,
+ }) => {
+ test.setTimeout(60_000);
+ const firstPage = await loadSampleAndOpenViewer(page);
+ const box = await firstPage.boundingBox();
+ if (!box) throw new Error("no box");
+
+ // Right-click a word in the top paragraph "Test document for word documents".
+ await page.mouse.click(
+ box.x + box.width * 0.21,
+ box.y + box.height * 0.105,
+ { button: "right" },
+ );
+ await page.waitForTimeout(400);
+
+ const selectionRects = firstPage.locator(
+ ".pdf-selection-layer > div:first-child > div",
+ );
+ await expect(selectionRects.first()).toBeAttached({ timeout: 5_000 });
+
+ const copyButton = page.getByRole("button", { name: "Copy" }).first();
+ await expect(copyButton).toBeVisible({ timeout: 5_000 });
});
- await page.waitForTimeout(400);
-
- const selectionRects = firstPage.locator(
- ".pdf-selection-layer > div:first-child > div",
- );
- await expect(selectionRects.first()).toBeAttached({ timeout: 5_000 });
-
- const copyButton = page.getByRole("button", { name: "Copy" }).first();
- await expect(copyButton).toBeVisible({ timeout: 5_000 });
});
test("right-click on the page does not surface the browser context menu", async ({
diff --git a/frontend/editor/src/core/theme/colors.css b/frontend/editor/src/core/theme/colors.css
index c7b0ccb08f..e79bc64c49 100644
--- a/frontend/editor/src/core/theme/colors.css
+++ b/frontend/editor/src/core/theme/colors.css
@@ -161,7 +161,8 @@ html[data-app-theme="midnight"] {
/* ── Base accent — fixed default (blue buttons); [data-accent="default"] blocks at the end keep surfaces neutral. LIGHT base here, DARK base next. ── */
html[data-app-theme="custom"] {
--c-primary: var(--p-blue-500);
- --c-primary-hover: color-mix(in srgb, var(--c-primary) 85%, var(--p-black));
+ /* Also the accent text colour (--_text), so 80% keeps 4.5:1 on the canvas. */
+ --c-primary-hover: color-mix(in srgb, var(--c-primary) 80%, var(--p-black));
--c-primary-subtle: color-mix(in srgb, var(--c-primary) 14%, transparent);
--c-text-on-primary: var(--p-white);
--c-accent-fg: var(--c-primary);