Repository navigation
feat(windows): keep reminder toasts on screen until dismissed - #154
Conversation
Windows toasts vanished after a few seconds, so a missed alert had no way to stay visible. windows.scenario: "reminder" now sends the toast through PowerShell and the WinRT toast API with scenario="reminder" and a Dismiss action, which Windows requires before it honors that scenario. Windows silently drops reminder toasts for an AppUserModelID it does not know, so the toast script registers windows.appID under HKCU\Software\Classes\AppUserModelId with a display name and icon before showing it. An unset windows.scenario still produces today's banner, and a failed PowerShell call falls back to the regular transient toast. Reminder toasts have no activation callback, so focusOnClick and onClickCommand do not run for them. Verified on Windows with the new notify-windows tests and config tests; WSL uses the same code path but was not run on real hardware.
A broken PowerShell could delay the regular toast by five seconds; the call now times out after two. The reminder/default/fallback decision has unit tests with a stubbed execFile, and WSL /mnt icon paths are translated for the toast image the same way as the AUMID icon. Docs now state the reminder-toast registry entry and that the plugin never removes it.
The directory-plugin loader uses package.json name and exports, so the checkout loads dist/index.js and dist/tui.js and needs a build plus restart, not a shim directory.
This reverts commit a8c2e97.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ow start Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on both hosts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@NGC13009 I made a few fixes on top, mainly how the app ID gets registered, and I can't test on Windows here. Could you try the beta with windows.scenario set to "reminder" and report any problems? Especially whether the toast shows the right name and icon, and whether you ever get a second regular toast with it. |
Got it I've tested this version and there are no issues at all. The updated code works well: the icon and name are completely correct, and a single notification does not trigger two toast notification. it's just one reminder notification, with no extra unexpected regular toast. In other words, it works well. (When I complete another task without clearing the previous notification, the new toast appears alongside the previous uncleared notification; this is expected behavior and makes sense.) |
Problem
On Windows and WSL the default toast disappears after a few seconds, so a permission request or a finished session is easy to miss while away from the desk.
Fixes #153
Change
Adds an opt-in
windows.scenariooption. The default,"default", is unchanged: nobody who leaves it alone sees a difference. With"reminder", the popup is shown through Windows PowerShell and the WinRT toast API withscenario="reminder"and a background Dismiss action, so it stays until dismissed.Windows drops reminder toasts for an unregistered AppUserModelID, so the plugin registers a missing
windows.appIDunderHKCU\Software\Classes\AppUserModelIdwith the display nameOpenCodeand, when Windows can read the path, its icon. An ID that already has a display name is left alone, and the plugin never removes the key.Reminders are best-effort: when PowerShell is missing, cannot be started, fails, or exceeds five seconds, delivery falls back to the regular toast. Reminder toasts have no activation callback, so
focusOnClickandonClickCommanddo not run for them.Maintainer changes on top
OpenCode version and platforms
powershell. WSL: launchespowershell.exe;/mnt/<drive>icon paths are translated.Tested by the contributor on the original version of this PR: Windows 11 26H2, TUI, OpenCode 2.4.1.
Not tested: the current PowerShell script has not been run on Windows since the maintainer changes. WSL and OpenCode 1 have not been tried.
Evidence
bun test src/notify-windows.test.ts src/notify.windows-reminder.test.ts src/config.test.ts: 50 pass, 0 failbun run typecheckandbun run build: passThe tests cover the toast XML, script and payload, config defaults and invalid values, and on both Windows and WSL: default unchanged, reminder replaces the toast, fallback when PowerShell fails or cannot start.
Screenshot from the contributor's original version, with customized prompt text:
Retest on Windows before release
windows.scenarioto"reminder"andwindows.appIDto a new name that is not registered yet.windows.scenarioback to"default". The regular banner should appear as before.Original change: deepseek-v4.1-flash-1017; harness: OpenCode.
Reviewed with review-loop: 2 rounds with GPT-6.1 Sol. Sol verdict: approved
Generated with Claude Code using Claude Opus 5.5