Add mouse support: resize preview, click tabs & rows#722
Add mouse support: resize preview, click tabs & rows#722hjanuschka wants to merge 9 commits intodlvhdr:mainfrom
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.
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.
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)
|
Really excited to see this work! I recently started using gh-dash as part of my dev workflow (embedded in a zellij tab for PR monitoring), and as someone who is just getting started with gh-dash, mouse support would make a huge difference in lowering the barrier to getting comfortable with the tool. Being able to click around to explore rather than memorizing keybindings first is very welcome. Just wanted to chime in with some encouragement — are there any remaining blockers or things the community could help with to get this across the finish line? |
|
Just need to polish it a bit. I'm intending to merge this soon, just need to find the time. |
|
I'd love to see this merged. Anything to help get this over the finish line? |
|
I've just merged bubbletea v2 so this needs to be rebased |
Adds mouse interactions I've been missing:
What's new:
Details: