Skip to content

Conversation

@pablospe
Copy link
Contributor

@pablospe pablospe commented Jan 6, 2026

Summary

  • Click on files in the tree to select them
  • Scroll wheel works in both file tree and diff viewer panes
  • Drag the border between panes to resize sidebar
  • Click on the filter box to enter search mode
  • Click on search results to select a file

@dlvhdr
Copy link
Owner

dlvhdr commented Jan 6, 2026

My god, this is great!
Do you think the code would be simpler if we use something like https://github.com/lrstanley/bubblezone? I've used it in my other projects and it's been great

@pablospe
Copy link
Contributor Author

pablospe commented Jan 6, 2026

Please take another look! The bubblezone dependency requires Go 1.23.0. When I ran go get github.com/lrstanley/bubblezone, it automatically upgraded.

Copy link
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.

looks good! I left some suggestions for you to think about. Let me know what you think and how we should proceed.

@pablospe
Copy link
Contributor Author

pablospe commented Jan 7, 2026

I fixed the conflicts with a rebase and then git push --force. I think github is showing duplicates? (hmm... I am not sure).

I would recommend to set merge squash as the only option for merging against main in the github settings, so one PR is one commit in main, and it is easier to revert and follow the changes.

Create a rule for the main branch:
image

then:
image

- Click on files in the tree to select them
- Scroll wheel works in both file tree and diff viewer panes
- Drag the border between panes to resize sidebar
- Add bubblezone dependency for zone-based click detection
- Mark UI zones (searchbox, filetree, searchresults, diffviewer)
- Replace coordinate-based checks with zone.InBounds()
- Use zone.Pos() for relative coordinates in click handlers
- Keep hybrid approach for sidebar resize (coordinate-based)
- Update FileNode to implement new tree.Node interface
Add SetCursorNoScroll method to filetree that updates selection
without scrolling the viewport. Use it in handleFileTreeClick so
the view stays in place when clicking a visible file.
Consolidate duplicate root-hidden checks into a single reusable method.
Also fixes inconsistency where one check used '.' and another used
dirIcon+'.' - now all use the correct dirIcon+'.' check.
When user drags sidebar width below 10px, automatically hide it.
Pressing 'e' to show the tree again resets to default width (26).
Allow dragging the sidebar back open by clicking and dragging
the thin vertical line that remains when sidebar is hidden.
Add constants for sidebar constraints and scroll speed:
- sidebarMinWidth (20)
- sidebarHideWidth (10)
- scrollLines (3)

Also add comment explaining Width(0) for grab line.
@pablospe
Copy link
Contributor Author

pablospe commented Jan 8, 2026

I resolved the conflicts, please take another look.

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.

2 participants