tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.71k stars 2.45k forks source link

[bug] [windows] [Edge/WebView2] DevTools theme gets initialized incorrectly #10629

Open hansSchall opened 4 weeks ago

hansSchall commented 4 weeks ago

Describe the bug

Disclaimer: This is NOT an issue with system theme detection or theme preference storage. The theme selector correctly remembers the last selection and after clicking on any option everything works fine for the current session.

When opening the DevTools, the theme used looks like this:

Screenshot 2024-08-14 203154

The theme used looks like the default light at first, but as you can see in the screenshot, it contains some white-text-on-white-background issues.

Most parts of the UI use the default light theme, which is incorrect when set to dark mode or system preference (on dark mode systems). Only some parts (like the white text in the screenshot) use the correct colors.

The Edge browser DevTools are not affected.

The bug does not arrise from a specific tauri version, it even occurrs on binaries built ~half a year ago and back then there were no issues

Reproduction

No response

Expected behavior

Correct theme is used

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 127.0.2651.98
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.12.2
    - pnpm: 9.7.1
    - yarn: 1.22.22
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 1.7.1
    - tauri-build [RUST]: 1.5.3
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - tauri-cli [RUST]: 1.6.0
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.6.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ./dist
    - devPath: http://localhost/

Stack trace

No response

Additional context

No response

ParkerTonra commented 3 weeks ago

image

I'm having the same issue as well. The Theme is set to Dark+ but appears white. I can set it to dark + again and this fixes the issue temporarily, but when I reopen the dev tools it appears white again.

S1lander commented 3 weeks ago

Having the same issue here (on Windows).

june07 commented 3 weeks ago

See https://github.com/june07/nimv3/issues/10#issuecomment-2268321317 for a fix. I believe this is the same issue.