fix-mouse-wheel

Fix: mouse wheel doesn't scroll codex chat tab (touch scroll works — same logical action, different event)

Metadata

Statusdone
Assignedagent-1134
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-29T17:01:47.444579507+00:00
Started2026-04-29T17:02:12.003062521+00:00
Completed2026-04-29T17:28:20.374497956+00:00
Tagsbug,tui,ux,input, eval-scheduled
Eval score0.77
└ blocking impact0.80
└ completeness0.70
└ constraint fidelity0.85
└ coordination overhead0.85
└ correctness0.75
└ downstream usability0.75
└ efficiency0.85
└ intent fidelity0.64
└ style adherence0.80

Description

Description

User report 2026-04-29: in the wg TUI codex chat tab, touch scroll (trackpad gesture) successfully scrolls the chat scrollback. Mouse wheel does NOT — the same logical scroll action produces no effect.

User quote: 'touch scrolled codex. but not mouse wheel!'

This proves:

  1. The codex scrollback IS scrollable (good news — fix-pass-no's --no-alt-screen really did give us scrollback content)
  2. The scroll handler exists and works for at least one input event type
  3. The mouse wheel events specifically aren't being captured or aren't propagating to the chat tab's scroll path

Likely cause

Mouse wheel and touch scroll generate different event types in the terminal-input layer:

  • Touch scroll (gesture / pixel-precise) often translates to PgUp/PgDn-style key codes OR pixel-level scroll events
  • Mouse wheel produces discrete MouseEventKind::ScrollUp / ScrollDown events (crossterm types)

The chat tab probably handles one type but not the other. Most likely the mouse-wheel events are either:

  • Not being captured by the TUI's mouse-event subscriber
  • Captured but routed to the parent task list / viz pane instead of the active chat tab
  • Captured + routed but the chat tab's handler doesn't include MouseEventKind::ScrollUp/Down arms

Investigation

  1. Find the TUI's main input dispatch — search for MouseEventKind or Event::Mouse handling
  2. Confirm the chat tab is registered to receive these events when active
  3. Check whether the chat tab's handler delegates to the same scroll function that touch scroll triggers — if not, wire it up

Validation

  • Failing test or repro: open codex chat with multi-screen scrollback, mouse wheel up. Pre-fix: nothing happens. Post-fix: scrollback scrolls.
  • Both directions work — wheel up scrolls back, wheel down scrolls forward
  • No regression: touch scroll still works
  • Test the same fix on claude chat tab (likely same code path)
  • Same on nex chat tab if the in-process handler also uses chat tabs
  • Other panes (task list, viz, log) still receive their wheel events for THEIR scrolling — wheel events don't get monopolized by the chat tab
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done

Depends on

Required by

Log