From c0fe5b68f42106e55464cbda52311f5fe4281080 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 15:15:18 +0000 Subject: [PATCH 1/2] feat(macos): setting to hide the menu bar icon (#44) A "Show menu bar icon" switch under Settings > Behavior, shown on macOS only and on by default. With it off the tray icon is hidden and a hidden window comes back from the Dock icon (RunEvent::Reopen). Windows and Linux keep the tray icon: there it is the only way back to a window closed to the tray. Older settings.json files without the field keep the icon. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01L8dUghRiNrKrHHR5BNMSSD --- settings-ui/index.html | 5 +++++ settings-ui/main.js | 6 +++++- src-tauri/src/settings.rs | 9 +++++++++ src-tauri/src/tray.rs | 11 +++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/settings-ui/index.html b/settings-ui/index.html index be0013f..c7e1914 100644 --- a/settings-ui/index.html +++ b/settings-ui/index.html @@ -44,6 +44,11 @@

Behavior

Show new messages as system notifications + diff --git a/settings-ui/main.js b/settings-ui/main.js index 9b86d17..1732e88 100644 --- a/settings-ui/main.js +++ b/settings-ui/main.js @@ -1,5 +1,8 @@ const invoke = window.__TAURI__.core.invoke; -const BOOLS = ["close_to_tray", "start_minimized", "autostart", "notifications", "hotkey_enabled"]; +const BOOLS = ["close_to_tray", "start_minimized", "autostart", "notifications", "hotkey_enabled", "menu_bar_icon"]; +// The menu-bar icon can only be hidden on macOS, where the Dock icon still +// brings the window back (issue #44). +const IS_MAC = /Mac/.test(navigator.platform || navigator.userAgent); const ZOOM_DEFAULT = 1; // settings.json holds a zoom factor, not a preset name, so a stored value need @@ -13,6 +16,7 @@ function selectNearestZoom(value) { async function load() { const s = await invoke("get_settings"); + document.getElementById("menu_bar_icon_row").hidden = !IS_MAC; for (const f of BOOLS) { const el = document.getElementById(f); if (el) el.checked = !!s[f]; diff --git a/src-tauri/src/settings.rs b/src-tauri/src/settings.rs index fb64a92..ef0fff0 100644 --- a/src-tauri/src/settings.rs +++ b/src-tauri/src/settings.rs @@ -11,6 +11,10 @@ pub struct Settings { pub notifications: bool, /// Display zoom for the WhatsApp webview, 1.0 = the site's own sizing. pub zoom: f64, + /// macOS only (issue #44): show the icon in the menu bar. With it off, the + /// Dock icon brings a hidden window back. Windows and Linux always show the + /// tray icon, since there it is the only way back to a hidden window. + pub menu_bar_icon: bool, } impl Default for Settings { @@ -23,6 +27,7 @@ impl Default for Settings { hotkey: "CmdOrCtrl+Shift+W".to_string(), notifications: true, zoom: 1.0, + menu_bar_icon: true, } } } @@ -137,6 +142,7 @@ pub fn apply(app: &AppHandle, s: &Settings) -> Option { // Zoom is a webview property, so it applies on every platform and takes // effect on the open account windows without a reload. crate::window::apply_zoom_all(app, s.zoom); + crate::tray::apply_visibility(app, s.menu_bar_icon); #[cfg(desktop)] { @@ -229,6 +235,7 @@ mod tests { assert_eq!(s.hotkey, "CmdOrCtrl+Shift+W"); assert!(!s.autostart); assert_eq!(s.zoom, 1.0); + assert!(s.menu_bar_icon); } #[test] @@ -266,6 +273,8 @@ mod tests { assert!(s.autostart); assert!(s.close_to_tray); assert_eq!(s.hotkey, "CmdOrCtrl+Shift+W"); + // Absent in a settings.json written before issue #44: keep the icon. + assert!(s.menu_bar_icon); } #[test] diff --git a/src-tauri/src/tray.rs b/src-tauri/src/tray.rs index 48aff48..3cf98d3 100644 --- a/src-tauri/src/tray.rs +++ b/src-tauri/src/tray.rs @@ -160,6 +160,17 @@ pub fn rebuild_menu(app: &AppHandle) { let _ = tray.set_menu(Some(menu)); } +/// Show or hide the menu-bar icon (macOS, issue #44). Elsewhere the tray icon +/// stays: on Windows and Linux it is the only way back to a hidden window, +/// while macOS always has the Dock icon (see `RunEvent::Reopen` in lib.rs). +#[allow(unused_variables)] +pub fn apply_visibility(app: &AppHandle, visible: bool) { + #[cfg(target_os = "macos")] + if let Some(tray) = app.tray_by_id("main-tray") { + let _ = tray.set_visible(visible); + } +} + /// Update the tray to reflect the current (aggregate) unread count. pub fn update_badge(app: &AppHandle, count: u32) { let Some(tray) = app.tray_by_id("main-tray") else { From c9cf66c31c3f7dace61b1f5c7eaef0913966a495 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 15:15:33 +0000 Subject: [PATCH 2/2] chore: release v0.6.8 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01L8dUghRiNrKrHHR5BNMSSD --- docs/release-notes/v0.6.8.md | 27 +++++++++++++++++++ .../io.github.karem505.whatRust.metainfo.xml | 6 +++++ src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 docs/release-notes/v0.6.8.md diff --git a/docs/release-notes/v0.6.8.md b/docs/release-notes/v0.6.8.md new file mode 100644 index 0000000..68be689 --- /dev/null +++ b/docs/release-notes/v0.6.8.md @@ -0,0 +1,27 @@ +## whatRust v0.6.8 + +An option to hide the menu bar icon on macOS, and two fixes for Windows. + +### macOS + +- **New:** Settings → Behavior → **Show menu bar icon**. Turn it off to keep whatRust out of the menu bar; click its Dock icon to bring the window back. It's on by default. Thanks to @Dumboiroy for the suggestion in #44. + +### Windows + +- **Fixed:** the Display size list in Settings → Appearance no longer opens as a blank white box in dark mode. Thanks to @viktorstarscollector for the report in #40. +- **Fixed:** notifications now show the whatRust logo in their header instead of a generic window icon (also #40). Windows may keep showing the old icon until you sign out and back in once. + +### Linux + +- The FAQ now explains why voice and video calls don't work on Linux: the WebKitGTK inside the AppImage is built without WebRTC (#39). + +### Install or update + +```bash +# Linux (AppImage) and macOS +curl -fsSL https://raw.githubusercontent.com/karem505/whatRust/master/install.sh | sh +# Linux (Flatpak) +curl -fsSL https://raw.githubusercontent.com/karem505/whatRust/master/install-flatpak.sh | sh +``` + +On Windows, run the `x64-setup.exe` or `.msi` below. diff --git a/flatpak/io.github.karem505.whatRust.metainfo.xml b/flatpak/io.github.karem505.whatRust.metainfo.xml index 8bf2533..894fafd 100644 --- a/flatpak/io.github.karem505.whatRust.metainfo.xml +++ b/flatpak/io.github.karem505.whatRust.metainfo.xml @@ -62,6 +62,12 @@ + + https://github.com/karem505/whatRust/releases/tag/v0.6.8 + +

Adds an option to hide the menu bar icon on macOS, fixes a blank Display size list and shows the app logo on notifications on Windows.

+
+
https://github.com/karem505/whatRust/releases/tag/v0.6.7 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ada049e..d534e7d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4695,7 +4695,7 @@ dependencies = [ [[package]] name = "whatrust" -version = "0.6.7" +version = "0.6.8" dependencies = [ "argon2", "block2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 62844ba..d84e20c 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whatrust" -version = "0.6.7" +version = "0.6.8" edition = "2021" rust-version = "1.82" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 42ae3f6..75d99eb 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "whatRust", - "version": "0.6.7", + "version": "0.6.8", "identifier": "com.karem.whatrust", "build": { "frontendDist": "../settings-ui"