From a01f258d4b5502713eb8ff27984d96807492d8b1 Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 24 Aug 2026 14:23:15 -0500 Subject: [PATCH] Remove system theme, keep light/dark/neon only --- frontend/src/lib/types.ts | 2 +- frontend/src/screens/SettingsScreen.tsx | 5 ++--- frontend/src/state/AppProvider.tsx | 7 ++----- frontend/src/test/FeedScreen.test.tsx | 2 +- frontend/src/test/apiMock.ts | 2 +- src/main.rs | 2 +- src/settings.rs | 2 -- 7 files changed, 8 insertions(+), 14 deletions(-) diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts index 2581bfe..f8e3884 100644 --- a/frontend/src/lib/types.ts +++ b/frontend/src/lib/types.ts @@ -1,4 +1,4 @@ -export type Theme = 'light' | 'dark' | 'system' | 'neon'; +export type Theme = 'light' | 'dark' | 'neon'; /** Lifecycle of the NIP-46 remote signer. */ export type SignerPhase = 'stopped' | 'connecting' | 'connected'; diff --git a/frontend/src/screens/SettingsScreen.tsx b/frontend/src/screens/SettingsScreen.tsx index 2ea58e1..c5c8ae2 100644 --- a/frontend/src/screens/SettingsScreen.tsx +++ b/frontend/src/screens/SettingsScreen.tsx @@ -104,12 +104,11 @@ export function SettingsScreen() { > -

- “System” follows your desktop's light or dark preference. “Neon” is a pure-black - theme with pink and purple accents. + “Light” and “Dark” follow your manual selection. “Neon” is a pure-black theme with + pink and purple accents.

diff --git a/frontend/src/state/AppProvider.tsx b/frontend/src/state/AppProvider.tsx index 6167031..d910afe 100644 --- a/frontend/src/state/AppProvider.tsx +++ b/frontend/src/state/AppProvider.tsx @@ -335,16 +335,13 @@ export function useApp(): AppContextValue { return context; } -/** Apply the requested theme (respecting system preference for `system`). */ +/** Apply the requested theme. */ export function applyTheme(theme: Theme): void { if (theme === 'neon') { document.documentElement.dataset.theme = 'neon'; return; } - const prefersDark = - theme === 'dark' || - (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); - document.documentElement.dataset.theme = prefersDark ? 'dark' : 'light'; + document.documentElement.dataset.theme = theme; } /** Keep the document theme in sync with settings, watching system changes. */ diff --git a/frontend/src/test/FeedScreen.test.tsx b/frontend/src/test/FeedScreen.test.tsx index 09be4c5..bb2a93c 100644 --- a/frontend/src/test/FeedScreen.test.tsx +++ b/frontend/src/test/FeedScreen.test.tsx @@ -24,7 +24,7 @@ describe('FeedScreen', () => { it('disable relays shows an empty state that can navigate to relays', async () => { const settings = { - theme: 'system' as const, + theme: 'light' as const, confirm_before_publish: true, shorten_npub: true, relays: [ diff --git a/frontend/src/test/apiMock.ts b/frontend/src/test/apiMock.ts index c5de46c..21b89ee 100644 --- a/frontend/src/test/apiMock.ts +++ b/frontend/src/test/apiMock.ts @@ -25,7 +25,7 @@ export function makeState(overrides?: Partial): AppState { is_active: false, }; const settings: Settings = { - theme: 'system', + theme: 'light', confirm_before_publish: true, shorten_npub: true, relays: [ diff --git a/src/main.rs b/src/main.rs index 6f630a7..6a66b31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ Commands: relays disable Disable a relay relays test Test a relay connection settings get Show application settings - settings set theme + settings set theme settings set confirm settings set shorten delete-profile Delete a profile (moves it to undo stack) diff --git a/src/settings.rs b/src/settings.rs index 55ee740..7293ee0 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -22,7 +22,6 @@ impl RelayConfig { pub enum Theme { Light, Dark, - System, Neon, } @@ -32,7 +31,6 @@ impl Theme { match s { "light" => Some(Self::Light), "dark" => Some(Self::Dark), - "system" => Some(Self::System), "neon" => Some(Self::Neon), _ => None, }