fix(ui): smooth mouse-wheel review scrolling#208
Conversation
Greptile SummaryReplaces the previous fixed multi-row mouse-wheel jump with an OpenTUI Confidence Score: 5/5Safe to merge — minimal, well-scoped change with no correctness issues All three changed files are clean: the new factory is a single-responsibility wrapper, DiffPane correctly gates the instance behind useMemo, and the CHANGELOG entry lands in the right section. No P0/P1 findings. No files require special attention Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User (wheel gesture)
participant OT as OpenTUI ScrollBox
participant MA as MacOSScrollAccel
participant VP as DiffPane Viewport
User->>OT: mouse wheel tick
OT->>MA: computeMultiplier(timeSinceLastTick)
MA-->>OT: multiplier (1.0 → up to 3.0)
OT->>VP: scrollBy(delta × multiplier)
VP-->>User: updated view
Note over MA: A=0.4, tau=4, maxMultiplier=3<br/>First tick ≈ 1×, sustained burst → 3×
User->>OT: shift + mouse wheel tick
OT->>OT: onMouseScroll fires first
OT->>VP: onScrollCodeHorizontally(±1)
OT->>OT: queueMicrotask restores scrollTop/Left
Reviews (1): Last reviewed commit: "fix(ui): smooth mouse-wheel review scrol..." | Re-trigger Greptile |
Summary
CHANGELOG.mdTesting
bun run typecheckbun test src/ui/AppHost.interactions.test.tsx -t "mouse wheel scrolling updates the active file and hunk to the viewport center|shift plus mouse wheel scrolls code horizontally|shift plus mouse wheel does not move the vertical review position"bun test test/pty/ui-integration.test.ts -t "mouse wheel scrolling moves the review pane|the first mouse-wheel step still advances content under the always-pinned file header above a collapsed gap|one mouse-wheel step down then up restores the collapsed-gap view beneath the pinned file header"This PR description was generated by Pi using OpenAI o3