Skip to content

fix(desktop): apply saved theme before window startup - #716

Merged
murongg merged 1 commit into
v2from
fix/startup-theme-flash
Sep 11, 2026
Merged

murongg merged 1 commit into
v2from
fix/startup-theme-flash

Conversation

@murongg

@murongg murongg commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

When Windows uses a dark system theme and Markra is saved in light mode, an editor window can paint dark before React restores its appearance. Seed the native/WebView background and HTML startup palette from saved preferences before the main window is created, and reuse the same initialization for new editor windows.

Keep the native theme following the OS so switching back to system appearance still works. Startup parameters only seed the editor's palette: reveal still waits for complete saved preferences and any required custom CSS. Existing reveal fallbacks and settings-window behavior are preserved.

Fixes #713.

Validation

  • pnpm --filter @markra/desktop test — 164 passed, including startup palette regressions for opposite system/app themes.
  • pnpm --filter @markra/app exec vitest run src/App.test.tsx src/hooks/useStartupWindowReveal.test.tsx — 253 passed, including deferred custom-theme startup.
  • cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml --locked — 288 passed, including pre-creation background, startup URL, and native-theme preservation checks.
  • pnpm --filter @markra/desktop build — passed, including vendor chunk verification.
  • pnpm --filter @markra/desktop --filter @markra/app typecheck:test — passed.
  • cargo fmt --manifest-path apps/desktop/src-tauri/Cargo.toml -- --check — passed.

Local verification ran on macOS. Windows visual verification is still needed for cold launch, opening a file from Explorer, and creating another editor window with opposing system/app appearances; automated tests do not prove the native first frame is flicker-free.

Seed editor window backgrounds and HTML startup palettes from saved preferences before native window creation. Keep editor reveal gated on complete theme settings and custom CSS.

Closes #713
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markra-web Ready Ready Preview Sep 8, 2026 6:14am UTC

@murongg
murongg merged commit 0064fba into v2 Sep 11, 2026
23 checks passed
@murongg
murongg deleted the fix/startup-theme-flash branch September 11, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows系统为深色主题且markra为浅色主题时,启动markra时窗口显示黑色又变成浅色,不是正常的直接显示浅色

1 participant