fix(desktop): opencode wheel scroll + native Windows notifications#2422
Open
aprv10 wants to merge 1 commit into
Open
fix(desktop): opencode wheel scroll + native Windows notifications#2422aprv10 wants to merge 1 commit into
aprv10 wants to merge 1 commit into
Conversation
…ndows notifications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two Windows-surfaced desktop bugs, both from the renderer/Electron layer not
accounting for how the pane app or the OS actually behaves. No tracking issue —
this PR is the writeup.
1. Scrolling does nothing in opencode sessions
Symptom: in an opencode session you cannot scroll the transcript with the mouse
wheel. PageUp/PageDown work; the wheel does nothing.
Cause: the terminal keeps no local scrollback (
scrollback: 0) and convertswheel motion into SGR mouse-wheel reports written to the pane. Those only scroll an
app that acts on wheel reports — tmux/zellij copy-mode, or a mouse-driven TUI.
opencode enables mouse tracking (
mouseTrackingMode: "any") but scrolls its owntranscript only by keyboard, so it silently ignores the wheel reports. On
Windows there is no mux (conpty) to fall back to at all, so nothing scrolls.
Fix: the wheel handler now sends PageUp/PageDown instead of SGR reports when
the pane can't use them:
paneScrollsByKeyboard, currentlyopencode) onevery platform,
Every other agent keeps the SGR path, so tmux/zellij copy-mode scrolling on
macOS/Linux is unchanged. Video below shows opencode scrolling on the wheel.
2. Native notifications never appear on Windows
Symptom: no notification toast ever pops on Windows, even though the in-app bell
and unread badge update correctly.
Cause:
Notification.isSupported()returns true andshow()runs withouterror, but Windows silently drops every toast because the app never declared an
AppUserModelID matching its installer shortcut — a required step for Windows toasts.
Fix: call
app.setAppUserModelId("dev.agent-orchestrator.desktop")(the NSISmaker's appId) on Windows, before the notification code. No-op on macOS/Linux.
Testing
npx vitest run(frontend gate) — terminal suite 30/30, incl. new cases: pagekeys on Windows with
mouseTrackingMode: "any", and page keys for akeyboard-scroll agent under a mux.
tsc --noEmitclean.Video.Project.5.mp4
Caveats
(opencode scrolls on PageUp; tmux forwards plain keystrokes untouched), but I
could not test it on those platforms — flagging for a reviewer with a Mac/Linux
box. Trivially revertible: drop
opencodefromKEYBOARD_SCROLL_PROVIDERS.npm run devon Windows may still not toast (no installer shortcut carrying theAUMID).
Files
frontend/src/main.ts— Windows AppUserModelIDfrontend/src/renderer/components/XtermTerminal.tsx— wheel → page-key routing +paneScrollsByKeyboardfrontend/src/renderer/components/TerminalPane.tsx— pass the agent's keyboard-scroll hintfrontend/src/renderer/components/XtermTerminal.test.tsx— coverage…ndows notifications