From 07d3b420f9cd9cf8d000a1c3503d2d576fa9dc8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= <14975046+skjnldsv@users.noreply.github.com> Date: Wed, 7 Oct 2026 00:02:02 +0200 Subject: [PATCH 1/2] fix(viewer): keep the dark palette to the viewer's own parts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was set on the whole modal and reached into what a handler shows: under a light theme a document in Text came out white on black below its light menu bar, and printed grey. The header, arrows, close button, loading and error states keep it. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com> --- e2e/theme.spec.ts | 13 +++++++++++++ lib/views/Viewer.vue | 30 ++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/e2e/theme.spec.ts b/e2e/theme.spec.ts index 8cca883..43ca013 100644 --- a/e2e/theme.spec.ts +++ b/e2e/theme.spec.ts @@ -45,4 +45,17 @@ test.describe('Backdrop', () => { // What WCAG asks of normal text expect(contrast).toBeGreaterThanOrEqual(4.5) }) + + // The dark palette was set on the whole modal, so it reached into what a + // handler shows: a document in Text came out white on black under a + // light theme, and printed grey + test('leaves the colours of what a handler shows to the theme', async ({ page }) => { + const viewer = new ViewerPage(page) + await viewer.open('photo.jpg') + await viewer.waitForOpen() + + const text = (selector: string) => page.locator(selector).first().evaluate((element) => getComputedStyle(element).getPropertyValue('--color-main-text').trim()) + expect(await text('.viewer__modal .modal-header')).toBe('#ffffff') + expect(await text('.viewer__modal oca-viewer-image')).not.toBe('#ffffff') + }) }) diff --git a/lib/views/Viewer.vue b/lib/views/Viewer.vue index d376ddc..b13cf15 100644 --- a/lib/views/Viewer.vue +++ b/lib/views/Viewer.vue @@ -147,6 +147,7 @@