refactor(settings): theme (light / dark) should be radio selectors #
Area: Settings · Display · Theme · pages/settings.vue
Type: a11y / ui debt
Priority: p2
Summary #
The Display → Theme control (light / dark) is currently a button group with aria-pressed and is missing the system option. It should be a native radio group with light / dark / system (or at minimum light / dark as radios — but system is in the schema and should be exposed).
Current behavior #
pages/settings.vue:162-176:
<span id="label-theme">{{ t('settings.theme') }}</span>
<div role="group" aria-labelledby="label-theme">
<button :aria-pressed="settings.theme==='light'" @click="updateSettings('theme','light')">Light</button>
<button :aria-pressed="settings.theme==='dark'" @click="updateSettings('theme','dark')">Dark</button>
</div>
- Same button-group anti-pattern as Mode (see
05-*). server/db/schema.ts:userSettings.themeisenum['light','dark','system']with defaultsystem— UI hidessystem, so user can never return to system preference after picking light/dark.applyTheme()inpages/settings.vue:24-33already handles all three:light → marathon2026-light,dark → marathon2026,system → removeAttribute('data-theme').
Expected behavior #
<fieldset class="data-row">
<legend id="label-theme" class="data-row-label">{{ t('settings.theme') }}</legend>
<div class="flex gap-4">
<label class="flex items-center gap-2 text-xs">
<input type="radio" name="theme" value="light" :checked="settings.theme==='light'" @change="updateSettings('theme','light')">
{{ t('settings.light') }}
</label>
<label class="flex items-center gap-2 text-xs">
<input type="radio" name="theme" value="dark" :checked="settings.theme==='dark'" @change="updateSettings('theme','dark')">
{{ t('settings.dark') }}
</label>
<label class="flex items-center gap-2 text-xs">
<input type="radio" name="theme" value="system" :checked="settings.theme==='system'" @change="updateSettings('theme','system')">
{{ t('settings.system') ?? 'System' }}
</label>
</div>
</fieldset>
- If
t('settings.system')key doesn't exist, add toi18nlocales (en.jsonetc.). - Style consistent with
05(mode radios) — flattened, no→,44pxhit area. - Changing radio calls
updateSettings('theme', value)which already callsapplyTheme(value)+ persists tolocalStorage:smoker-theme.
Files to touch #
pages/settings.vue:162-176— theme block,applyTheme(no logic change, just ensuresystempath tested)i18n/locales/*.json— addsettings.systemif missing
Acceptance criteria #
How to test #
- Open Settings → Theme → should show 3 radios.
- Pick Light → page goes light; Dark → dark; System → follows OS (
prefers-color-scheme). - Reload → still on chosen value; check
document.documentElement.getAttribute('data-theme').