Remove system theme, keep light/dark/neon only

This commit is contained in:
Avi 2026-08-24 14:23:15 -05:00
commit a01f258d4b
7 changed files with 8 additions and 14 deletions

View file

@ -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';

View file

@ -104,12 +104,11 @@ export function SettingsScreen() {
>
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="system">System</option>
<option value="neon">Neon</option>
</select>
<p className="hint">
“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.
</p>
</div>
</div>

View file

@ -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. */

View file

@ -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: [

View file

@ -25,7 +25,7 @@ export function makeState(overrides?: Partial<AppState>): AppState {
is_active: false,
};
const settings: Settings = {
theme: 'system',
theme: 'light',
confirm_before_publish: true,
shorten_npub: true,
relays: [

View file

@ -35,7 +35,7 @@ Commands:
relays disable <url> Disable a relay
relays test <url> Test a relay connection
settings get Show application settings
settings set theme <light|dark|system|neon>
settings set theme <light|dark|neon>
settings set confirm <true|false>
settings set shorten <true|false>
delete-profile <npub> Delete a profile (moves it to undo stack)

View file

@ -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,
}