-
-
Notifications
You must be signed in to change notification settings - Fork 325
Add mouse support: resize preview, click tabs & rows #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add mouse support: resize preview, click tabs & rows #722
Conversation
Add two new mouse interaction features: 1. Preview pane resizing via drag: - Click and drag the left border of the preview pane to resize - Width is constrained between 30 and 150 chars, max 70% of screen - Uses bubblezone for resize handle detection 2. Tab clicking: - Click on any tab to switch to it directly - Each tab is now wrapped in a bubblezone for click detection Implementation details: - Added PreviewWidth to ProgramContext for dynamic width tracking - Added ResizeMsg, ResizeStartMsg, ResizeEndMsg for resize state management - Added HandleClick to carousel and tabs for click detection - Added tests for sidebar resize and carousel click functionality Closes #XXX
- Scroll wheel in preview pane scrolls the content (3 lines at a time) - Scroll wheel in list area scrolls through items (3 items at a time) - Auto-fetches more items when scrolling near bottom of list - Mouse position determines which area receives scroll events
- Make PR/Issue rows clickable to select them - Save preview pane width to state file on resize - Restore saved width on startup - Fix tab click zones for view switching
dlvhdr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yo, this is awesome!
love these changes.
regarding the width state, how would the user reset the width to the one in their config? remove the state file? maybe there should be a way to reset it through a keybind / flag.
I think that before I go over the code in depth, there are some visual bugs that needs to be fixed.
I had to deal with similar issues due to bubblezone, especially because of MaxHeight and MaxWidth. See https://github.com/lrstanley/bubblezone?tab=readme-ov-file#maxheight-and-maxwidth.
|
done, glitch with the maxwidth/height should be fixed use "P" to reset preview pane width. |
|
Great work, looks much better!
Screen.Recording.2026-01-02.at.18.17.29.mov |
|
thanks for the video, should all be fixed with latest commit!! |
- Change scroll wheel to move 1 item at a time (was 3) for precise navigation - Remove early returns from mouse handlers to ensure full Update flow runs, fixing visual artifacts where old/new selections were both visible - Remove Width() wrapper from listviewport.View() to prevent zone marker artifacts (per bubblezone docs, Width/MaxWidth can corrupt zone markers)
|
this is great @hjanuschka!! I'm gonna go over it in the next few days |
dlvhdr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had some small nits and questions, but great job!
|
@dlvhdr thanks for the review, feedback addressed! |
47282e0 to
647abc7
Compare
fff836c to
749dd38
Compare
…call - Remove unused lastScrollTime field that was never read - Fix scroll-down to call NextRow() only once per event (was calling twice, causing 2x scroll speed)
Adds mouse interactions I've been missing:
What's new:
Details: