Skip to content

fix(app): a reloaded page replaces its tray icon instead of adding one - #113

Merged
httpsphl merged 1 commit into
mainfrom
fix/tray-reload
Oct 2, 2026
Merged

httpsphl merged 1 commit into
mainfrom
fix/tray-reload

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 2, 2026

Copy link
Copy Markdown
Owner

What

  • One tray icon after a reload. The tray icon lives in the app process, not in the page. When the page reloaded (dev hot reload, or the webview reloading), it forgot the icon it had made and created a second botloft icon next to the clock. Now, before creating its icon, the page removes any botloft icon left behind (TrayIcon.getById / removeById).
  • Dev icon says it is dev. A dev build runs beside the installed app; its tray tooltip now ends in (dev).
  • Spec 15.2 ("ícone perto do relógio") updated.

Tests

  • app/src/lib/tauriTray.test.ts (new): two concurrent updates keep one icon; a reloaded module replaces the icon left behind.
  • pnpm check passes locally (typecheck, biome, 279 tests).

Manual check (real app)

  1. pnpm tauri dev with the dev BOTLOFT_HOME, with the installed Botloft also running.
  2. Hover the tray icons: the dev one reads Botloft: … (dev).
  3. Reload the dev window (Ctrl+R) a few times: still one dev icon near the clock, and its menu still works.

The tray icon lives in the app process, not in the page. After a reload
(dev hot reload, or the webview reloading) the page forgot the icon it
had made and created a second one with the same id. Before creating its
icon, the page now removes any `botloft` icon left behind.

A dev build runs beside the installed app, so its tray tooltip ends in
"(dev)" to tell the two apart. Spec 15.2 updated.
@httpsphl
httpsphl merged commit 5cbd1fb into main Oct 2, 2026
4 checks passed
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