feat(ui): route mouse-wheel to preview in stacked (below) layout (#1626 follow-up) - #1782
feat(ui): route mouse-wheel to preview in stacked (below) layout (#1626 follow-up)#1782jdidion wants to merge 3 commits into
Conversation
CodeRabbit review on asheshgoplani#1626 (merged): in the below/stacked preview layout, the mouse wheel always moved the session-list cursor because wheel-to-preview routing was dual-layout-only (X-based: "is the wheel over the right column"). Stacked mode has no right column — the preview is the LOWER region — so scroll input never reached it. Add Y-based routing for stacked mode: a wheel event at or below the horizontal divider scrolls the preview (previewScrollOffset), matching the dual layout's X-based behaviour. New stackedPreviewTopY() computes the divider Y by mirroring renderStackedLayout's height split (via the shared stackedListHeight helper + a new contentChromeTop() that both this and the render path use, so the Y can't drift from what's drawn). Single layout unchanged (no preview target). Scope: this addresses the wheel-scroll half of the review. Divider RESIZE in stacked mode stays on the `<`/`>` keys (added in asheshgoplani#1626) rather than a mouse drag — the X-axis divider-drag path (isOnDivider/setPreviewPctFromMouseX) is X-only, and a parallel Y-drag would duplicate fragile layout math for redundant polish. Noted for a possible follow-up. Build + go vet + gofmt clean; UI layout/preview tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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 (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAdds layout-aware helpers for locating the stacked PREVIEW pane and routes mouse-wheel events there in stacked layouts, while preserving existing dual and single layout behavior. ChangesStacked PREVIEW wheel routing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 Thanks for opening this — a couple of intake fields would help the maintainer's validation pipeline (and any reviewer) understand it faster. Nothing here blocks you and nothing is closing: this is a heads-up, and editing the description re-runs this check automatically.
The full field-level contract is in .github/INTAKE.md. AI-authored PRs are welcome here with equal standing. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/ui/home.go`:
- Line 1102: Remove the unused panelTitleLines constant declaration from the
surrounding function in internal/ui/home.go, leaving the remaining panel layout
logic unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5460e40b-60a6-49cc-bd3a-98db6b289c82
📒 Files selected for processing (1)
internal/ui/home.go
…olangci) The golangci `unused` linter flagged home.go:1102 — panelTitleLines was declared in stackedPreviewTopY but never used (stackedListHeight already accounts for the panel title internally). Dead code; removed. Verified with golangci-lint run locally (0 issues). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No code change. The prior push (golangci green) hit a flaky internal/session -race failure (TestIssue1421 / -race timing) unrelated to this PR's one-line home.go change, which passed the Full test suite on the push before it. Empty commit to re-run the gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@asheshgoplani heads-up on CI, and a request to re-run when you get a chance. The code side is done and
Could you re-run the gate (you have admin; I can't re-run from the fork)? If it's a known-flaky suite you already manage, happy to defer to whatever your standard is. And if you'd rather I split anything out or adjust scope, just say. Same disclosure as before: largely Claude-generated, diff reviewed by me. |
Follow-up to the merged #1626 (preview-below orientation), addressing a CodeRabbit review finding on that PR.
What
In the
below/stacked preview layout, the mouse wheel always moved the session-list cursor — it never scrolled the preview. Wheel-to-preview routing was dual-layout only (X-based: "is the wheel over the right column?"). Stacked mode has no right column — the preview is the lower region — so scroll input never reached it.This adds Y-based routing for stacked mode: a wheel event at or below the horizontal divider scrolls the preview (
previewScrollOffset), matching the dual layout's X-based behaviour. Single layout is unchanged (no preview target).How
stackedPreviewTopY()computes the divider's screen-Y by mirroringrenderStackedLayout's height split — it reuses the sharedstackedListHeighthelper plus a newcontentChromeTop()that both this and the render path use, so the routing Y can't drift from what's actually drawn.Scope
This is the wheel-scroll half of CodeRabbit's finding. Divider resize in stacked mode stays on the
</>keys (added in #1626), not a mouse drag: the existing divider-drag path (isOnDivider/setPreviewPctFromMouseX) is X-axis only, and a parallel Y-drag would duplicate fragile layout math for redundant polish (the keyboard path already covers stacked resize). Flagged in the commit as a possible follow-up if you want mouse-drag parity.Verification
go build ./...,go vet,gofmtclean;internal/uilayout/preview/mouse tests pass.🤖 Generated with Claude Code
Summary by CodeRabbit