feat: theme - 02

This commit is contained in:
kodi
2026-03-12 20:13:50 +01:00
parent 09c3e14dea
commit e25d43200f
14 changed files with 295 additions and 9 deletions
@@ -32,6 +32,10 @@ class UiSmokeGoldenTest(unittest.TestCase):
self.assertIn('/ui/theme-midnight.css', body)
self.assertIn('/ui/theme-graphite.css', body)
self.assertIn('/ui/theme-windows11.css', body)
self.assertIn('/ui/theme-commander-electric.css', body)
self.assertIn('/ui/theme-nord-arctic.css', body)
self.assertIn('/ui/theme-catppuccin-soft.css', body)
self.assertIn('/ui/theme-fluent-neon.css', body)
self.assertIn('id="workspace"', body)
self.assertIn('id="footer-bar"', body)
self.assertIn('id="title-zone-actions"', body)
@@ -82,6 +86,10 @@ class UiSmokeGoldenTest(unittest.TestCase):
self.assertIn('value="midnight"', body)
self.assertIn('value="graphite"', body)
self.assertIn('value="windows11"', body)
self.assertIn('value="commander-electric"', body)
self.assertIn('value="nord-arctic"', body)
self.assertIn('value="catppuccin-soft"', body)
self.assertIn('value="fluent-neon"', body)
self.assertNotIn('id="settings-selected-color-mode"', body)
self.assertIn('id="settings-startup-path-left"', body)
self.assertIn('id="settings-startup-path-right"', body)
@@ -138,11 +146,19 @@ class UiSmokeGoldenTest(unittest.TestCase):
self.assertTrue((static_root / "theme-midnight.css").exists())
self.assertTrue((static_root / "theme-graphite.css").exists())
self.assertTrue((static_root / "theme-windows11.css").exists())
self.assertTrue((static_root / "theme-commander-electric.css").exists())
self.assertTrue((static_root / "theme-nord-arctic.css").exists())
self.assertTrue((static_root / "theme-catppuccin-soft.css").exists())
self.assertTrue((static_root / "theme-fluent-neon.css").exists())
app_js = (static_root / "app.js").read_text(encoding="utf-8")
self.assertIn('currentPath: "/Volumes"', app_js)
self.assertIn('selectedTheme: "default"', app_js)
self.assertIn('selectedColorMode: "dark"', app_js)
self.assertIn('const VALID_THEME_FAMILIES = ["default", "macos-soft", "midnight", "graphite", "windows11"];', app_js)
self.assertIn('const VALID_THEME_FAMILIES = [', app_js)
self.assertIn('"commander-electric"', app_js)
self.assertIn('"nord-arctic"', app_js)
self.assertIn('"catppuccin-soft"', app_js)
self.assertIn('"fluent-neon"', app_js)
self.assertIn('document.documentElement.dataset.themeFamily', app_js)
self.assertIn('document.documentElement.dataset.colorMode', app_js)
self.assertIn('function effectiveThemeKey(theme, colorMode)', app_js)
@@ -218,6 +234,10 @@ class UiSmokeGoldenTest(unittest.TestCase):
midnight_theme_css = (static_root / "theme-midnight.css").read_text(encoding="utf-8")
graphite_theme_css = (static_root / "theme-graphite.css").read_text(encoding="utf-8")
windows_theme_css = (static_root / "theme-windows11.css").read_text(encoding="utf-8")
commander_theme_css = (static_root / "theme-commander-electric.css").read_text(encoding="utf-8")
nord_theme_css = (static_root / "theme-nord-arctic.css").read_text(encoding="utf-8")
catppuccin_theme_css = (static_root / "theme-catppuccin-soft.css").read_text(encoding="utf-8")
fluent_theme_css = (static_root / "theme-fluent-neon.css").read_text(encoding="utf-8")
self.assertIn('#theme-toggle', base_css)
self.assertIn('.settings-card', base_css)
self.assertIn('.settings-tabs', base_css)
@@ -226,6 +246,8 @@ class UiSmokeGoldenTest(unittest.TestCase):
self.assertIn('.entry-media-icon.video', base_css)
self.assertIn('.entry-media-icon.pdf', base_css)
self.assertIn('.entry-media-svg', base_css)
self.assertIn('.entry-media-svg.is-filled', base_css)
self.assertIn('.entry-media-detail', base_css)
self.assertIn('.entry-media-icon.file', base_css)
self.assertIn('.editor-card', base_css)
self.assertIn('.editor-host', base_css)
@@ -236,6 +258,10 @@ class UiSmokeGoldenTest(unittest.TestCase):
self.assertIn(':root[data-theme-family="midnight"][data-color-mode="dark"]', midnight_theme_css)
self.assertIn(':root[data-theme-family="graphite"][data-color-mode="dark"]', graphite_theme_css)
self.assertIn(':root[data-theme-family="windows11"][data-color-mode="dark"]', windows_theme_css)
self.assertIn(':root[data-theme-family="commander-electric"][data-color-mode="dark"]', commander_theme_css)
self.assertIn(':root[data-theme-family="nord-arctic"][data-color-mode="dark"]', nord_theme_css)
self.assertIn(':root[data-theme-family="catppuccin-soft"][data-color-mode="dark"]', catppuccin_theme_css)
self.assertIn(':root[data-theme-family="fluent-neon"][data-color-mode="dark"]', fluent_theme_css)
app_js_url = app.url_path_for("ui", path="/app.js")
base_css_url = app.url_path_for("ui", path="/base.css")