- Do not create a
WebviewWindowBuilderfrom a synchronous Tauri command on Windows. In this repo, opening the Token Usage window from a sync#[tauri::command]produced a native window shell, but the WebView content stayed white, the close button did not work reliably, and DevTools could not be opened. - Use an
async fncommand for window creation instead. The working fix was changingshow_token_usage_windowfrom a synchronous command topub(crate) async fn show_token_usage_window(...) -> Result<(), String>. - If adding a new Tauri window label, also add it to
apps/desktop/src-tauri/capabilities/default.json. For Token Usage, the label istoken-usage. - Prefer hash routing for single-page subwindows loaded from packaged assets, for example
WebviewUrl::App("index.html#token-usage".into()), and keep the frontend route parser compatible with both query and hash routes. - For auxiliary windows that previously got stuck, add a Rust-side close fallback in
on_window_eventthat destroys the specific window label instead of hiding the main app.