Skip to content

AppImage catalog review: app starts dark on light systems (pre-paint default) #72

Closed

Description

@yjid

Summary

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.

Activity

  1. yjid commented on Nov 2, 2026

    @yjid
    OwnerAuthor

    Resolved in commit 9ca8fa9 on master:

    • 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.
    • Pushed to master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions