Skip to content

Notifications: show clickable desktop banners on Windows - #127

Open
katulevskiy wants to merge 3 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/662
Open

katulevskiy wants to merge 3 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/662

Conversation

@katulevskiy

Copy link
Copy Markdown
Owner

Upstream mirror

Source: zeronsh#662
Original author: @RemingtonWilcox
Original revision: ae8358dc70e2ff2e10879d608f47b9672be267f1

This PR is an isolated Contribution Manager pilot mirror. Its reviews, checks and merge state are separate from upstream. An empty [skip ci] commit suppresses automatic bulk CI; the code tree matches the imported upstream revision.


Summary

  • Windows showed no desktop banner at all. notify::post was a no-op there, so only the chime played. Session banners (run finished, waiting on input, run failed), the connection banner and the agent-update banner now show as Windows toasts through gpui's own system notifications (cx.show_system_notification). No new dependency and no platform code in Zeron.
  • Identity. On Windows, run_app calls cx.set_app_identity("sh.zeron.app", "Zeron"), the macOS bundle id. gpui registers it under HKCU\Software\Classes\AppUserModelId with a DisplayName when it first posts, so portable copies get named banners too.
  • Clicks. cx.on_system_notification_response routes a clicked banner to the existing open_notification_target, the same path macOS banner clicks take. Agent-update banners open Settings → Agents as on macOS. A banner without a chat (the connection banner) just brings Zeron forward.
  • One banner per chat. The chat id is the toast tag, so a chat's newer banner replaces its older one instead of stacking.
  • No double sound. gpui's toasts set <audio silent="true">, so Zeron's chime stays the only sound and the existing sound settings still apply.
  • Installer. zeron.iss declares the AppUserModelId\sh.zeron.app key with uninsdeletekey so uninstall removes what gpui wrote. It also sets AppUserModelID: "sh.zeron.app" on the Start-menu and desktop shortcuts (see below). scripts/test-windows-installer.ps1 checks the shortcut's ID and that the key exists after install and is gone after uninstall.
  • macOS and Linux are unchanged apart from notify::post taking cx. Notification settings and when banners fire are unchanged, including Only when in the background.

Worth a close look

  • Taskbar grouping. set_app_identity also sets the process's AppUserModelID (SetCurrentProcessExplicitAppUserModelID), not just the toast identity. Without a matching ID on the shortcut, a pinned Zeron and the running window would show as two taskbar buttons. The installer now stamps the same ID on its shortcuts. Two gaps remain: taskbar pins made before this change, and Start-menu shortcuts from installs that only ever updated in-app (the updater doesn't rewrite shortcuts). Those keep the old ID until Zeron is re-pinned or the installer runs again. I haven't checked this by hand. A gpui option to name toasts without changing the process ID would avoid it, but that would be a zui change.
  • Icon. gpui registers a DisplayName but no IconUri. With the installer's shortcut carrying the ID, Windows should take the icon from it. Portable copies may show a blank or generic icon. If so, the fix belongs in zui (registering an IconUri), not here.
  • Banners left over from an earlier run only dismiss when clicked. gpui handles clicks in-process, through the toast's Activated event.
  • This replaces this PR's earlier version, which added its own WinRT toast module, a registry write and a windows dependency. gpui already covers all of that.

Test plan

  • New Windows-only notify::tests::windows_banners_replace_per_chat (gpui test platform): a chat's second banner replaces its first, keyed by chat id, and a chat-less banner gets its own slot. It fails without the change (nothing delivered).
  • cargo test --locked -p zeron-ui --lib notify::tests on Windows 11 x64: 2 passed.
  • cargo check --locked -p zeron-ui --tests: no new warnings in touched code. rustfmt --check is clean for the changed hunks.
  • Not done: running the rebuilt app and clicking a real banner (session, connection, agent update). Not checked: banner icon on an installed copy vs a portable one, and taskbar grouping with an old pin.
  • Not run locally: scripts/test-windows-installer.ps1 (needs Inno Setup, and it touches the current user's registration; CI runs it). The shortcut-ID check was tried by hand on existing shortcuts.
  • Linux UI and core suites on the fork's CI (ui-tests workflow): https://github.com/RemingtonWilcox/zeron/actions/runs/37240689962

Screenshots

The banner from a finished run while Zeron was minimized, on Windows 11. This is a debug build run in place, not an installed one. It shows the name "Zeron", an icon, the chat title and "Run finished":

Windows toast: Zeron, Card balance pass, Run finished

Zeron after clicking that banner: restored, focused, and on the notified chat (a different chat was selected before). Dark, device name pixelated:

Zeron focused on the Card balance pass chat after the banner click

Not captured: a banner from an installed build or a portable copy, and the sound (no audio capture, so "no second sound" is unverified).

🤖 Generated with Claude Code

@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added the review:needs-triage Managed by Contribution Manager label Oct 6, 2026
@contribution-manager-katulevskiy

contribution-manager-katulevskiy Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Contribution Manager

needs triage · medium risk · untriaged

Open review workspace · Revision 0775705a

Next actions:

  • Direction decision needed
  • Scope, risk, and platform triage needed
  • Independent code review needed
  • Required check: core-tests (missing)

This summary is maintained by the review app. Decisions and test evidence are recorded in the workspace; the app does not merge PRs.

@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added cm:inbox Contribution Manager: waiting for triage and removed review:needs-triage Managed by Contribution Manager labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cm:inbox Contribution Manager: waiting for triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants