codeburn/desktop/src-tauri
AgentSeal ea5e311d4a feat(desktop): replace Linux tray with ksni for Mac-style click UX
Tauri's Linux tray uses libappindicator, which by design never fires
left-click events to the app and exposes no icon screen position. That
forced a menu-first UX on GNOME and made anchoring the popover near the
icon impossible (tauri-apps/tauri#7283, closed not-planned).

Drop libappindicator on Linux and talk StatusNotifierItem directly via
the ksni crate:

* new src-tauri/src/tray_linux.rs implements ksni::Tray. activate(x, y)
  and secondary_activate(x, y) arrive with real screen coordinates. The
  implementation exports no menu on purpose, so SNI hosts (notably the
  gnome-shell-extension-appindicator) call Activate on left click instead
  of opening a context menu.
* LinuxTrayHandle wraps the async ksni::Handle with a sync Mutex so the
  Tauri command handler can push title updates without naming the
  generic Handle<CodeburnTray> across module boundaries.
* lib.rs gates TrayIconBuilder behind cfg(not(target_os = "linux")) and
  spawns ksni on the Tokio runtime Tauri already owns. Tray click events
  go through codeburn://tray-activate with {x, y} so the positioning logic
  can anchor the popover directly below the click, clamped to the monitor.
* new set_tray_title command pushes the hero cost to the tray label on
  every payload fetch. On Linux that's the SNI title next to the icon;
  on other platforms it's the TrayIcon::set_title.
* new quit_app command + popover-footer × button gives Linux users a way
  to exit without a tray menu.
* empty-state copy already landed in a previous commit. Combined with the
  footer Quit button, the popover is now self-contained on Linux.

Windows is unaffected: TrayIconBuilder there fires left-click events
correctly and set_title/tooltip work out of the box.

Known limitation: on vanilla GNOME without AppIndicator support, there is
no tray to click. Documentation will link to the AppIndicator extension
install, same caveat Slack, Discord and 1Password ship with.
2026-04-18 03:59:13 -07:00
..
capabilities feat(desktop): scaffold Tauri 2.x tray app for Linux + Windows 2026-04-17 17:53:10 -07:00
icons feat(desktop): scaffold Tauri 2.x tray app for Linux + Windows 2026-04-17 17:53:10 -07:00
src feat(desktop): replace Linux tray with ksni for Mac-style click UX 2026-04-18 03:59:13 -07:00
build.rs feat(desktop): scaffold Tauri 2.x tray app for Linux + Windows 2026-04-17 17:53:10 -07:00
Cargo.lock feat(desktop): replace Linux tray with ksni for Mac-style click UX 2026-04-18 03:59:13 -07:00
Cargo.toml feat(desktop): replace Linux tray with ksni for Mac-style click UX 2026-04-18 03:59:13 -07:00
tauri.conf.json feat(desktop): scaffold Tauri 2.x tray app for Linux + Windows 2026-04-17 17:53:10 -07:00