[Mods] Add `surface` to the `ui.scroll` and `ui.focus` events

Status Open
Reported on v2.1.296
Maintainer reply None cached
Activity 0 comments · opened Oct 12, 2026

Claude Code 2.1.296.

ui.render gives a mod e.surface, and $.session.surfaces() lists every surface attached to the session. The two input events that carry the person's wheel and clicks, ui.scroll and ui.focus, have no such field: UiScrollInput and UiFocusInput in the mods types carry no surface. A hook that receives one of them cannot tell which surface raised it.

Effect: a pane that scrolls its own regions in the terminal has to hand Desktop's pointerless wheel ticks back to the engine, because the Desktop wheel arrives with no pointer position to hit-test against the pane's regions. With a terminal also attached to the same session, the hook cannot tell a Desktop tick from a terminal one, so a phone or Desktop viewer's wheel and clicks take the terminal's path. The pane can be correct for one surface and wrong for the other, and there is no signal to branch on.

Request: add surface: RenderSurface to both UiScrollInput and UiFocusInput, the same value ui.render already reports, so a mod can handle each surface's input on its own terms.

View original on GitHub ↗