From eec3864a6744cd507e28ce40badc3786dac7c97a Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Thu, 1 Oct 2026 12:18:04 -0700 Subject: [PATCH] Revert "test(desktop): ThemeProvider setTheme(default) paints Classic Hermes" This reverts commit c356d1df829dc07301d95ab086dcd1157bef2b05. --- apps/desktop/src/themes/context.test.tsx | 53 +----------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/apps/desktop/src/themes/context.test.tsx b/apps/desktop/src/themes/context.test.tsx index 93bf8faab5..5d5c077385 100644 --- a/apps/desktop/src/themes/context.test.tsx +++ b/apps/desktop/src/themes/context.test.tsx @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { $backendThemes, __resetBackendSkinSync, ingestBackendSkin } from './backend-sync' import { skinPref, ThemeProvider, useTheme } from './context' -import { DEFAULT_SKIN_NAME, everforestTheme } from './presets' +import { everforestTheme } from './presets' // The live-authoring loop: Hermes writes/edits one skin file and every surface // repaints. An in-place edit keeps the NAME — only the palette moves. @@ -12,23 +12,10 @@ const bloomberg = (foreground: string) => ({ colors: { background: '#000000', ui_text: foreground, ui_accent: '#ff8000' } }) -const classicDefault = { - name: 'default', - description: 'Classic Hermes — gold and kawaii', - colors: { background: '#1a1a2e', ui_accent: '#FFBF00', ui_text: '#FFF8DC', banner_text: '#FFF8DC' } -} - const cssVar = (name: string) => window.document.documentElement.style.getPropertyValue(name) const customStyleEl = () => window.document.getElementById('hermes-desktop-custom-css') as HTMLStyleElement | null -/** Probe so tests can call setTheme through the real provider path (not only skinPref). */ -function ThemeProbe({ onReady }: { onReady: (api: ReturnType) => void }) { - const api = useTheme() - onReady(api) - return null -} - describe('ThemeProvider ← backend skin sync', () => { beforeEach(() => { window.localStorage.clear() @@ -50,44 +37,6 @@ describe('ThemeProvider ← backend skin sync', () => { expect(cssVar('--theme-background-seed')).toBe('#000000') }) - it('keeps setTheme(default) active and paints Classic Hermes (#76579 / #76743)', () => { - // Review salvage: selecting registered `default` must go through setTheme / - // normalizeSkin (not only resolveTheme/skinPref) and must NOT collapse to nous. - let latest: ReturnType | null = null - - render( - - { - latest = api - }} - /> - - ) - - act(() => ingestBackendSkin(classicDefault, { apply: false })) - - expect(latest).not.toBeNull() - // Boot default remains nous until the user (or Appearance) selects classic. - expect(DEFAULT_SKIN_NAME).toBe('nous') - - act(() => { - latest!.setTheme('default') - }) - - // Active selection stays `default` (not retired → nous). deriveTheme may - // mode-suffix the seed (default-light / Classic Hermes Light); the - // selection key and painted palette are what Appearance must preserve. - expect(latest!.themeName).toBe('default') - expect(latest!.themeName).not.toBe(DEFAULT_SKIN_NAME) - expect(latest!.theme.label.toLowerCase()).toContain('classic hermes') - expect(latest!.availableThemes.some(t => t.name === 'default' && t.label === 'Classic Hermes')).toBe(true) - // Classic gold palette reaches CSS (ui_accent / ui_text → primary / foreground). - // Light-mode derivation may mix the navy background; accent/text stay gold. - expect(cssVar('--theme-foreground').toLowerCase()).toBe('#fff8dc') - expect(cssVar('--theme-primary').toLowerCase()).toBe('#ffbf00') - }) - it('repaints an in-place edit of the ACTIVE skin (same name, new palette)', () => { render(