fix(ui): refine mouse handling for proposal#34
Conversation
andev0x
commented
Jul 4, 2026
- restructure mouse event processing into phases for better clarity and maintainability
- restructure mouse event processing into phases for better clarity and maintainability
andev0x
left a comment
There was a problem hiding this comment.
-
Phase 1 (lines ~352-366): Wheel scrolling intercepted first — mouseMsg.Action == tea.MouseActionPress with MouseButtonWheelUp/Down. Routes directly to m.vp.Update(msg) for native smooth scrolling, consumes immediately via return m, vpCmd.
-
Phase 2 (lines ~369-378): Left-click intercepted for Izen components — iterates m.pendingProposals calling checkProposalHeaderBounds() which dynamically computes the header line position from m.widgetScreenStartY() + 1. If a proposal header is hit, toggles Expanded and returns early — the viewport never sees the click.
-
Phase 3 (lines ~381-410): Everything else (Press→selection start, Motion→drag, Release→copy) falls through to the viewport text-selection pipeline unchanged.