Skip to content

Add mouse support: resize preview, click tabs & rows#722

Open
hjanuschka wants to merge 9 commits intodlvhdr:mainfrom
hjanuschka:feature/mouse-resize-and-tab-click
Open

Add mouse support: resize preview, click tabs & rows#722
hjanuschka wants to merge 9 commits intodlvhdr:mainfrom
hjanuschka:feature/mouse-resize-and-tab-click

Conversation

@hjanuschka
Copy link
Copy Markdown

Adds mouse interactions I've been missing:

What's new:

  • Drag the left edge of the preview pane to resize it
  • Click on tabs to switch sections
  • Click on PR/Issue rows to select them
  • Scroll wheel works in preview pane and list
  • Preview width is saved between sessions (~/.config/gh-dash/state.yml)

Details:

  • Resize is clamped to 30-150 chars (max 70% of screen)
  • Scroll moves 3 lines/items at a time
  • Auto-fetches more items when scrolling near bottom

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
Copy link
Copy Markdown
Owner

@dlvhdr dlvhdr left a 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.

image

@hjanuschka
Copy link
Copy Markdown
Author

hjanuschka commented Jan 2, 2026

done, glitch with the maxwidth/height should be fixed

use "P" to reset preview pane width.
also fixed selection issues on larger lists

@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Jan 2, 2026

Great work, looks much better!
A couple of issues:

  • There are some artifacts when scrolling that the selected line leaves behind.
  • The scrolling, at least for me, seems to scroll 6 items per grading. I think it would be best to only scroll 1 item, so each item would be reachable with the scroll-wheel. wdyt?
Screen.Recording.2026-01-02.at.18.17.29.mov

@hjanuschka
Copy link
Copy Markdown
Author

thanks for the video, should all be fixed with latest commit!!
thanks for the great project!

- 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)
@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Jan 4, 2026

this is great @hjanuschka!! I'm gonna go over it in the next few days

Copy link
Copy Markdown
Owner

@dlvhdr dlvhdr left a 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!

@hjanuschka
Copy link
Copy Markdown
Author

@dlvhdr thanks for the review, feedback addressed!

@hjanuschka hjanuschka force-pushed the feature/mouse-resize-and-tab-click branch from 47282e0 to 647abc7 Compare January 9, 2026 15:10
@hjanuschka hjanuschka force-pushed the feature/mouse-resize-and-tab-click branch from fff836c to 749dd38 Compare January 9, 2026 15:58
…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)
@dlvhdr dlvhdr mentioned this pull request Jan 10, 2026
@schickling
Copy link
Copy Markdown

schickling commented Feb 11, 2026

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?

@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Feb 11, 2026

Just need to polish it a bit. I'm intending to merge this soon, just need to find the time.

@drod3763
Copy link
Copy Markdown

I'd love to see this merged. Anything to help get this over the finish line?

@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Mar 13, 2026

I've just merged bubbletea v2 so this needs to be rebased

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants