mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-20 17:47:19 +00:00
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. |
||
|---|---|---|
| .. | ||
| dist | ||
| Scripts | ||
| src | ||
| src-tauri | ||
| .gitignore | ||
| DEVELOPMENT.md | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| tokens.json | ||
| tsconfig.json | ||
| vite.config.ts | ||