@@ -35,6 +35,13 @@ const (
3535
3636 // Sidebar resize detection threshold in pixels.
3737 sidebarGrabThreshold = 2
38+
39+ // Sidebar width constraints.
40+ sidebarMinWidth = 20
41+ sidebarHideWidth = 10
42+
43+ // Scroll speed in lines per wheel tick.
44+ scrollLines = 3
3845)
3946
4047type mainModel struct {
@@ -265,6 +272,7 @@ func (m mainModel) View() string {
265272 BorderForeground (lipgloss .Color ("8" )).Render (content )
266273 } else {
267274 // Show a thin grab line when sidebar is hidden.
275+ // Width(0) means only the border is rendered (1 char).
268276 grabLine := lipgloss .NewStyle ().
269277 Width (0 ).
270278 Height (m .height - footerHeight - headerHeight ).
@@ -505,7 +513,7 @@ func (m mainModel) handleFileTreeClick(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
505513}
506514
507515func (m mainModel ) handleScroll (msg tea.MouseMsg ) (tea.Model , tea.Cmd ) {
508- lines := 3
516+ lines := scrollLines
509517
510518 // Check if scrolling in sidebar (file tree or search results).
511519 if zone .Get (zoneFileTree ).InBounds (msg ) || zone .Get (zoneSearchResults ).InBounds (msg ) {
@@ -538,15 +546,15 @@ func (m mainModel) handleScroll(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
538546
539547func (m mainModel ) handleSidebarDrag (msg tea.MouseMsg ) (tea.Model , tea.Cmd ) {
540548 // Hide sidebar if dragged below threshold.
541- if msg .X < 10 {
549+ if msg .X < sidebarHideWidth {
542550 m .isShowingFileTree = false
543551 m .draggingSidebar = false
544552 cmd := m .diffViewer .SetSize (m .width , m .height - footerHeight - headerHeight )
545553 return m , cmd
546554 }
547555
548556 // Clamp to reasonable bounds.
549- minWidth := 20
557+ minWidth := sidebarMinWidth
550558 maxWidth := m .width / 2
551559 newWidth := max (minWidth , min (maxWidth , msg .X ))
552560
0 commit comments