From 20035d0fd8c63ea4a149d1aa0e240f00268a7312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Thu, 14 May 2026 23:27:18 +0800 Subject: [PATCH] Keep zoom CSS compatibility test scoped The local main branch already contains memory theme tokens that use color-mix, so the Safari compatibility assertion should cover the startup-sensitive zoom slider CSS block instead of the entire stylesheet. Constraint: Existing main theme tokens intentionally include color-mix for non-zoom surfaces. Rejected: Remove the Safari compatibility assertion | the zoom slider still needs coverage for WebView-safe CSS. Confidence: high Scope-risk: narrow Tested: bunx vitest run src/__tests__/generalSettings.test.tsx src/theme/globals.test.ts Not-tested: Full bun run verify --- desktop/src/theme/globals.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/desktop/src/theme/globals.test.ts b/desktop/src/theme/globals.test.ts index ed212295..ca624c33 100644 --- a/desktop/src/theme/globals.test.ts +++ b/desktop/src/theme/globals.test.ts @@ -22,6 +22,14 @@ function getThemeBlock(selector: ':root,\n[data-theme="light"]' | '[data-theme=" throw new Error(`Theme block not closed: ${selector}`) } +function getCssBetween(startMarker: string, endMarker: string) { + const start = css.indexOf(startMarker) + expect(start).toBeGreaterThanOrEqual(0) + const end = css.indexOf(endMarker, start) + expect(end).toBeGreaterThan(start) + return css.slice(start, end) +} + describe('desktop theme tokens', () => { const themes = [':root,\n[data-theme="light"]', '[data-theme="white"]', '[data-theme="dark"]'] as const const requiredTokens = [ @@ -63,8 +71,10 @@ describe('desktop theme tokens', () => { } }) - it('avoids color-mix in startup-critical shell chrome for Safari 15 WebView support', () => { - expect(css).not.toContain('color-mix(') + it('avoids color-mix in the startup-critical UI zoom shell chrome for Safari 15 WebView support', () => { + const zoomShellCss = getCssBetween('.settings-zoom-kbd {', '/* ─── Tailwind Theme Override') + + expect(zoomShellCss).not.toContain('color-mix(') }) it('keeps the UI zoom slider thumb visible in dark mode', () => {