fix(ui): allow DefaultTheme "Auto" from config (#5190)

* fix(ui): allow DefaultTheme "Auto" from config

When DefaultTheme is set to "Auto" in the server config, the
defaultTheme() function in themeReducer now returns AUTO_THEME_ID
instead of falling through to the DarkTheme fallback.

This allows useCurrentTheme to correctly read prefers-color-scheme
and select Light or Dark theme automatically for new/incognito users.

Adds themeReducer unit tests covering Auto, named-theme, and
unrecognized-value fallback paths.

* chore: format

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Tom Boucher
2026-03-15 14:00:21 -04:00
committed by GitHub
parent a887521d7a
commit c42570446b
3 changed files with 38 additions and 0 deletions
+2
View File
@@ -7,6 +7,8 @@ export const M3U_MIME_TYPE = 'audio/x-mpegurl'
export const AUTO_THEME_ID = 'AUTO_THEME_ID'
export const AUTO_THEME_CONFIG_VALUE = 'Auto'
export const DraggableTypes = {
SONG: 'song',
ALBUM: 'album',