Skip to content

feat: Botloft near the clock, Windows notifications and opening at sign-in - #43

Merged
httpsphl merged 2 commits into
mainfrom
feat/tray-notifications
Sep 29, 2026
Merged

httpsphl merged 2 commits into
mainfrom
feat/tray-notifications

Conversation

@httpsphl

Copy link
Copy Markdown
Owner

Stacked on #42 (itself on #41).

What

  • Icon near the clock. When the bots keep working after the window closes, Botloft stays in the notification area.
    • The tooltip says what the bots are doing: "Scout needs you", "2 bots working" or "No bot working".
    • The icon gets a dot when something waits for the owner.
    • A click opens the window. The menu has that same line, Open Botloft, Pause every crew (or Resume every crew) and Quit Botloft. Quitting leaves the bots working.
    • Closing the window then only hides it.
    • It can be turned off in Settings → General: "Show Botloft near the clock".
  • Windows notifications, while Botloft is not in front:
    • When a bot needs the owner: "Scout asks for your permission" with the action ("Run a command", not the command itself), or "Scout needs you to sign in to Claude".
    • When a bot finishes, if the owner wants it: "Scout finished", with the crew.
    • With Play a sound, the notification uses the Windows sound; without it, it is silent. In front, Botloft plays a short chime made on the spot, with no sound file.
    • What was already there when the app connected does not notify.
    • Coming back from a notification (within 10 min) opens that bot.
    • These switches are in a new Notifications part of Settings.
  • Opening at sign-in. When the bots start with Windows, the app also opens at sign-in if the owner wants the icon or the window. It stays near the clock unless "Open the window when you sign in to Windows" is on.

How

  • Hidden start: the window starts with visible: false. setup shows it unless the app was started with --autostart. In that case the app shows it if the owner wants the window, or if anything goes wrong before connecting, so it can never get stuck invisible.
  • Run key: we write it ourselves (sign_in.rs, with winreg) as "<app>" --autostart, quoted. tauri-plugin-autostart writes the path without quotes, which splits at C:\Users\Ana Lima\....
    • Turning it on also clears a "disabled" left in Task Manager's startup apps.
    • A dev build never registers itself.
    • The uninstaller deletes the value.
  • One copy only: tauri-plugin-single-instance, in release builds only, so the dev app still runs next to the installed one. A second launch (Start menu, a notification) brings the running app forward and emits botloft://reopened.
  • Tray: TrayIcon and Menu from @tauri-apps/api, with updates queued so two quick changes never create two icons. tauri-plugin-notification shows the notifications.
  • App state: the daemon's settings now live in the app store, so the tray and the Run key follow them.
  • Spec: sections 15.1, 15.2 and 15.4 updated.

Tests

  • pnpm check passes (176 tests). cargo clippy -D warnings passes for botloft-app in both debug and release, and its tests pass (including the quoting test).
  • New app tests:
    • Tray: status, dot, open, pause and resume every crew, quit, and turning it off.
    • Opening at sign-in: follows the settings, the window stays hidden near the clock or shows when chosen, and it shows when Botloft cannot start.
    • Notifications: permission and sign-in text, "finished" only when chosen, silent without sound, none in front or for existing states, and coming back from one opens its bot.
    • Settings: switches shown only where they apply, and the Notifications part.
  • The routines test "chosen days, intervals and cron…" gets 15 s. It passes alone and ran past 5 s in the full suite, like the messages one in feat(app): panels follow what the bot starts doing and slide open #38.

Real test (pnpm tauri dev on the dev data folder, Windows 11)

  • The window opened, and the tray icon was created (its tray_icon_app window existed).
  • Windows' close message (the same one Alt+F4 sends) only hid the window; the app kept running.
  • A left click on the tray icon, sent as the tray's own message, brought the window back.

Manual steps still open

  • Right-click menu of the tray icon: Pause every crew, Resume every crew, Quit.
  • A real notification, and clicking it in the installed app. In dev the toast carries PowerShell's identity; the installed app uses its own and a single instance.
  • Sign out and back in with Start with Windows on: Botloft starts near the clock, or with its window when chosen.

…gn-in

With the bots working after the window closes, Botloft keeps an icon in
the notification area: what the bots are doing in the tooltip, a dot when
something waits, a click to open, and Open, Pause every crew and Quit.
Closing the window then only hides it. Windows notifications say when a
bot needs the owner (and, if wanted, when one finishes) while Botloft is
not in front, with the Windows sound or none; in front, a short chime.
Coming back from a notification opens that bot.

The window starts hidden and shows unless Windows opened the app at
sign-in (--autostart) and Botloft waits near the clock. The app opens at
sign-in through the Run key, quoted for paths with spaces, when the bots
start with Windows and the owner wants the icon or the window; a release
build keeps a single instance, which a second launch brings forward. The
uninstaller removes the Run value. Settings gets the two switches in
General and a Notifications part; the daemon's settings live in the app
store.
# Conflicts:
#	app/src/features/account/GeneralSettings.tsx
#	docs/spec.md
@httpsphl
httpsphl changed the base branch from feat/approval-wait to main September 29, 2026 23:06
@httpsphl
httpsphl enabled auto-merge September 29, 2026 23:06
@httpsphl
httpsphl merged commit 8ef23f6 into main Sep 29, 2026
3 checks passed
@httpsphl httpsphl mentioned this pull request Sep 30, 2026
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