fix-mouse-wheel-3

Fix: mouse wheel does nothing (post fix-mouse-wheel-2) — outer scroll path isn't actually advancing

Metadata

Statusdone
Assignedagent-1180
Agent identity3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3
Created2026-04-29T20:47:31.856730498+00:00
Started2026-04-29T20:49:26.154067981+00:00
Completed2026-04-29T21:24:53.025881178+00:00
Tagspriority-high,bug,tui,input,regression, eval-scheduled
Eval score0.73
└ blocking impact0.75
└ completeness0.70
└ constraint fidelity0.55
└ coordination overhead0.80
└ correctness0.75
└ downstream usability0.75
└ efficiency0.75
└ intent fidelity0.29
└ style adherence0.80

Description

Description

Regression #2 in the same session. After fix-mouse-wheel-2 (commit 745243957), scroll wheel no longer sends arrow keys to inner app (claude warning is gone — confirmed by user). BUT the outer scroll also doesn't advance. Net: wheel events do nothing.

User quote: 'i rebuilt now and the scroll wheel does bupkis'

What changed (per fix-mouse-wheel-2's task log)

forward_chat_wheel now ALWAYS scrolls outer vt100 pane, never forwards arrow keys to PTY child stdin.

The 'never forwards arrow keys' part is verified working (claude no longer warns; byte-level test asserts zero bytes to PTY stdin). The 'scrolls outer vt100 pane' part ISN'T actually advancing the scroll offset in real use.

Likely cause

The fix-mouse-wheel-2 test asserted (a) outer scroll advanced + (b) zero bytes to PTY child. Test (a) might have been against a code path that doesn't match the real-world chat-tab event routing, OR the scroll-advance call is hitting a different pane than the one currently focused.

Hypotheses to verify:

  1. forward_chat_wheel IS called on wheel events, but it advances scroll on the wrong pane / a pane that isn't visible
  2. forward_chat_wheel is NOT called for the chat tab's wheel events — they hit a different handler that consumes-without-action
  3. The vt100 pane's internal scroll state advances but the renderer doesn't read from the new offset (so visually nothing changes)

Investigation steps (diagnose-first)

  1. Add temporary tracing or use existing logs to confirm forward_chat_wheel IS being called on every wheel notch in the chat tab
  2. If yes: confirm the scroll offset on the active vt100 pane is actually changing
  3. If yes: confirm the renderer reads from that offset
  4. If yes: confirm the rendered output reflects different content (not just an unchanged buffer)

The bug is at whichever step the chain breaks.

Validation

  • Failing test or repro added: simulate a wheel-up event on an active claude chat tab with multi-screen scrollback. Pre-fix: outer scroll offset doesn't change. Post-fix: outer scroll offset advances + rendered content changes.
  • Same for codex chat
  • Same for nex chat
  • Test under tmux for all three
  • No regression of fix-mouse-wheel-2's invariant: zero bytes still written to PTY child stdin
  • Smoke scenario: simulate ScrollUp event, assert (a) child stdin bytes_written = 0 (already gated), (b) active pane scroll offset advances, (c) rendered output line N differs from line N pre-event
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done — and live smoke evidence (actual scroll behavior) pasted before claim of done

Process note

fix-mouse-wheel-2 had a smoke test for the 'don't send arrows' half but apparently a weaker test for the 'do scroll outer' half. The pattern of 'half-passing test asserts only one of two invariants' has bitten this codebase repeatedly. The new validation requires asserting BOTH halves of the contract (no inner forward AND outer actually advances).

Depends on

Required by

Log