You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AppImage catalog review: app starts dark on light systems (pre-paint default) #72
AppImageHub catalog review (PR #10929) flagged that Kensaku launches in a dark theme even on a light-mode test system. The reviewer asked "Why do we get dark mode?"
Root cause
index.html ships with a hardcoded data-theme="dark" so the UI is never unstyled before React mounts. On a fresh install, src/hooks/useTheme.ts swaps it to the OS preference (prefers-color-scheme) once get_config resolves, but the screenshot/first frame can be captured during that initial paint, before the swap lands — so it reads as dark.
Existing installs keep their saved theme (config is the durable source); fresh installs already follow the OS via systemTheme().
Fix
Remove the hardcoded dark initial attribute in index.html (or resolve the theme before paint via an inline script reading prefers-color-scheme), so even the first frame matches the OS.
Keep default_theme() in src-tauri/src/config.rs consistent (or document that the frontend owns first-run resolution).
Related (optional, from same review)
Add AppStream metadata (usr/share/metainfo/com.gochi.kensaku.metainfo.xml) with a controlled screenshot.
Embed update info (.zsync) so AppImageUpdate works (createUpdaterArtifacts is currently false).
Acceptance
Fresh launch on a light system shows light mode from the first frame.
Re-run AppImageHub test (/retest) passes without the "mostly dark" warning.
Added an early inline theme resolution script in index.html before first paint.
Evaluates window.matchMedia('(prefers-color-scheme: dark)').matches to set data-theme dynamically before React mounts, preventing the initial flash of dark mode on light-mode systems.
Activity
fix(theme): resolve system theme before first paint
yjid commentedon Nov 2, 2026
Resolved in commit 9ca8fa9 on master:
index.htmlbefore first paint.window.matchMedia('(prefers-color-scheme: dark)').matchesto setdata-themedynamically before React mounts, preventing the initial flash of dark mode on light-mode systems.master.