tui: migrate off deprecated Bubble Tea mouse Type API (SA1019)#214
tui: migrate off deprecated Bubble Tea mouse Type API (SA1019)#214gnanam1990 wants to merge 1 commit into
Conversation
The mouse classification helpers checked both the current Button/Action pair and the deprecated msg.Type / tea.Mouse* constants. Bubble Tea's parser always populates Button+Action and only DERIVES Type from them, so the Type fallbacks were pure redundancy (a left-button drag is Action==Motion, already covered by mouseMotion). Drop them — clears all 11 SA1019 findings in internal/tui with no behavior change. The left-drag test now asserts the Action==Motion path directly. Gates: gofmt/vet/build(host+linux+windows)/test -race/staticcheck(SA1019 0)/ deadcode(no new) all pass.
Zero automated PR reviewVerdict: No blockers found Blockers
Validation
ScopeHead: This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughMouse event classification helpers ( ChangesRemove deprecated
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Consolidating the audit-backlog work into a single PR with one commit per change (per request). This change is preserved verbatim as a commit there. |
Summary
Clears the 11
SA1019deprecation findings ininternal/tui(surfaced by the v16 audit) by migrating the mouse helpers off the deprecatedmsg.Type/tea.MouseLeft|MouseMotion|MouseRelease|MouseWheelUp|MouseWheelDownAPI to the currentButton/Actionpair.Why it's safe (no behavior change)
Bubble Tea's mouse parser always sets
Button+Actionas the source of truth and merely derives the deprecatedTypefield from them (parseMouseButton's "backward compatibility" switch). So the|| msg.Type == …fallbacks in the five helpers were pure redundancy. In particular a left-button drag is reported asAction==Motion(withTypederived toMouseLeft), whichmouseMotionalready matches viaAction==Motion— so droppingTypechanges nothing.mouseLeftPress,mouseMotion,mouseRelease,mouseWheelUp,mouseWheelDown) now useButton/Actiononly.Type:field and asserts theAction==Motionpath directly (its 1 SA1019 too).Verification
staticcheck ./internal/tui/SA1019 count: 11 → 0. Existing mouse + transcript-selection tests pass under-race. gofmt · vet · build (host + linux + windows) · fullgo test ./...· deadcode (no new vs main) all green.First of the audit-hygiene / remaining-backlog items.
Summary by CodeRabbit