Skip to content

fix(desktop): opencode wheel scroll + native Windows notifications#2422

Open
aprv10 wants to merge 1 commit into
AgentWrapper:mainfrom
aprv10:fix/opencode-wheel-scroll-and-win-notifications
Open

fix(desktop): opencode wheel scroll + native Windows notifications#2422
aprv10 wants to merge 1 commit into
AgentWrapper:mainfrom
aprv10:fix/opencode-wheel-scroll-and-win-notifications

Conversation

@aprv10

@aprv10 aprv10 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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 converts
wheel 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 own
transcript 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:

  • for keyboard-scroll agents (paneScrollsByKeyboard, currently opencode) on
    every platform,
  • on Windows (conpty has no copy-mode, so SGR never helps), and
  • for any pane app with mouse tracking fully off.

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 and show() runs without
error, 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 NSIS
maker'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: page
    keys on Windows with mouseTrackingMode: "any", and page keys for a
    keyboard-scroll agent under a mux.
  • tsc --noEmit clean.
  • Wheel scroll verified live in an opencode session on Windows (video attached).
Video.Project.5.mp4

Caveats

  • The macOS/Linux opencode wheel path is routed by agent type and is deterministic
    (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 opencode from KEYBOARD_SCROLL_PROVIDERS.
  • The notification fix applies to installed/packaged builds; an unpackaged
    npm run dev on Windows may still not toast (no installer shortcut carrying the
    AUMID).

Files

  • frontend/src/main.ts — Windows AppUserModelID
  • frontend/src/renderer/components/XtermTerminal.tsx — wheel → page-key routing + paneScrollsByKeyboard
  • frontend/src/renderer/components/TerminalPane.tsx — pass the agent's keyboard-scroll hint
  • frontend/src/renderer/components/XtermTerminal.test.tsx — coverage…ndows notifications

@aprv10 aprv10 changed the title fix(desktop): wheel-scroll opencode transcripts and surface native Wi… fix(desktop): opencode wheel scroll + native Windows notifications Jul 4, 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