Skip to content

Desktop v0.1.4: fix dead tray click, template icon, and first-run window#322

Merged
ericflo merged 2 commits intomainfrom
ce/desktop-v0.1.4-tray-fixes
Apr 18, 2026
Merged

Desktop v0.1.4: fix dead tray click, template icon, and first-run window#322
ericflo merged 2 commits intomainfrom
ce/desktop-v0.1.4-tray-fixes

Conversation

@ericflo
Copy link
Copy Markdown
Owner

@ericflo ericflo commented Apr 18, 2026

Why

The v0.1.3 macOS install was unusable on first launch:

  • The tray icon rendered as a solid black square in the menu bar
  • Left-clicking it did nothing — totally dead UI
  • No window ever appeared on launch — only the macOS About menu worked

Three stacked bugs caused it. This PR fixes all three and cuts desktop v0.1.4.

What

1. Real monochrome template tray icon

tauri.conf.json declared iconAsTemplate: true but pointed iconPath at icons/icon.png, which is the full-color 1024×1024 carrier-pigeon brand mark (cream rounded-square background, deep slate-blue silhouette). macOS template icons must be monochrome (black + alpha) — anything else renders as a solid black blob.

Added two new assets derived from the existing brand mark:

  • crates/modelrelay-desktop/icons/tray-icon.png (22×22)
  • crates/modelrelay-desktop/icons/tray-icon@2x.png (44×44)

Both are pure black RGB with alpha derived from a contrast-pushed luminance inversion of the source mark, then auto-cropped to the silhouette bbox and padded ~10% so the pigeon fills the tray frame at small sizes. trayIcon.iconPath now points at icons/tray-icon.png. Bundle icon references (bundle.icon) are unchanged — those use the full-color icons and are correct.

2. Tray click reliability

TrayIconBuilder had no left-click affordance. On macOS in Tauri 2.10, that means left-click is a dead no-op unless one of:

  • .show_menu_on_left_click(true) — pops the menu on left-click
  • .on_tray_icon_event(...) — gives you the click event to react to

Added both:

  • show_menu_on_left_click(true) so the menu opens on left-click like users expect.
  • A belt-and-suspenders on_tray_icon_event handler that, on TrayIconEvent::Click { button: Left, button_state: Up, .. }, shows + focuses the main window. Even if the menu fails to pop on some platform, the tray is never a dead UI element.

3. First-run window visibility

The single window in tauri.conf.json has visible: false and main.rs::setup() never called window.show(). So if the tray was broken (see #1 + #2), the user never saw any UI.

The setup now shows + focuses the main window on launch unless the user is the returning silent-tray case (auto_start enabled AND worker_secret non-empty). This means:

  • First launch: window appears so the onboarding wizard is reachable.
  • Returning user without auto_start: window appears.
  • Returning user with auto_start and a saved secret: silent tray launch as before.

4. Version bump

  • crates/modelrelay-desktop/Cargo.toml: 0.1.3 → 0.1.4
  • crates/modelrelay-desktop/tauri.conf.json: 0.1.3 → 0.1.4
  • Cargo.lock: cargo update -p modelrelay-desktop --precise 0.1.4
  • CHANGELOG.md: new Desktop 0.1.4 entry summarizing the three fixes

Validation

  • cargo fmt --check -p modelrelay-desktop — clean
  • cargo check --workspace --exclude modelrelay-desktop — clean
  • Tauri 2.10 API verified against tauri-2.10.3/src/tray/mod.rs in the local cargo cache: show_menu_on_left_click, on_tray_icon_event, TrayIconEvent::Click { button, button_state, .. }, MouseButton::Left, MouseButtonState::Up, and TrayIcon::app_handle() all exist with the expected signatures.
  • The modelrelay-desktop crate cannot be cargo-checked locally because GTK/webkit2gtk system libs are absent in the dev environment; CI runners on macOS / Windows / Linux will perform the full build.

Tagging

This PR does not tag desktop-v0.1.4. Tag after verifying the diff looks right.

Cloud Eric added 2 commits April 18, 2026 11:42
Three stacked bugs made the v0.1.3 macOS install unusable on first launch
(black-square tray, dead left-click, no window ever appeared):

1. Tray icon was the full-color carrier-pigeon brand mark with
   iconAsTemplate: true. macOS template icons must be monochrome (black
   + alpha), so the cream/slate-blue PNG rendered as a solid black blob.
   Generated black-on-alpha derivatives at icons/tray-icon.png (22x22)
   and tray-icon@2x.png (44x44) and pointed trayIcon.iconPath at them.
   Bundle icon references unchanged.

2. TrayIconBuilder had no left-click affordance. Added
   show_menu_on_left_click(true) plus an on_tray_icon_event fallback
   that shows + focuses the main window on left-click up, so the tray
   is never a dead UI element even if the platform fails to pop the
   menu.

3. Main window had visible: false and no setup() show() call, so a
   broken tray meant no UI at all on first launch. Now show + focus
   the main window unless the user is a returning auto_start +
   non-empty worker_secret case (silent tray launch).

Bumped Cargo.toml, tauri.conf.json, and Cargo.lock to 0.1.4 and added
a CHANGELOG entry summarizing the three fixes.
@ericflo ericflo merged commit f806efe into main Apr 18, 2026
12 checks passed
@ericflo ericflo deleted the ce/desktop-v0.1.4-tray-fixes branch April 18, 2026 11:50
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.

1 participant