Skip to content

Add sidebar resize and improved collapse functionality#45

Open
teonimesic wants to merge 2 commits intojfernandez:mainfrom
teonimesic:feature/improved-sidebar
Open

Add sidebar resize and improved collapse functionality#45
teonimesic wants to merge 2 commits intojfernandez:mainfrom
teonimesic:feature/improved-sidebar

Conversation

@teonimesic
Copy link

@teonimesic teonimesic commented Nov 12, 2025

Why?

The default directory sidebar width was not enough to show longer file names, making it a guessing game of which file I was opening.

Summary

This PR adds Manual Sidebar Resize - Users can now drag the right edge of the sidebar to resize it between 150-600px, with the custom width persisting across page reloads

Changes

Commit 1: Add manual sidebar resize functionality

  • Add draggable 4px resize handle on sidebar right edge
  • Support width range: 150px to 600px
  • Persist custom width to localStorage
  • Add text ellipsis for file names when sidebar is narrow
  • Disable transitions during drag for smooth resizing
  • Handle highlights in blue when hovering/dragging

Commit 2: Improve sidebar collapse/expand behavior

  • Add smooth animated transitions for collapse/expand
  • Save current width before collapse, restore on expand
  • Add debounce protection to prevent rapid-click glitches
  • Persist collapsed state across page reloads
  • Set inline styles to ensure correct width on reload when collapsed
  • Skip width restoration in resize function if collapsed
  • Add detailed comments for maintainability

Testing

All features have been tested:

  • Drag resize works smoothly across the 150-600px range
  • Width persists correctly on page reload
  • Collapse and expand back to custom width works as expected
  • Debounce prevents glitches from rapid clicking
  • Collapsed state persists on page reload
  • Text ellipsis displays correctly for long file names

- Add draggable resize handle on sidebar right edge
- Support width range: 150px to 600px
- Persist custom width to localStorage
- Add text ellipsis for file names when sidebar is narrow
- Disable transitions during drag for smooth resizing
- Handle highlights in blue when hovering/dragging
@teonimesic teonimesic force-pushed the feature/improved-sidebar branch from f1ee640 to bc25ee9 Compare November 12, 2025 01:30
- Collapse sidebar to 48px width (showing icon only)
- Add smooth animated transitions for collapse/expand
- Save current width before collapse, restore on expand
- Add debounce protection to prevent rapid-click glitches
- Persist collapsed state across page reloads
- Set inline styles to ensure 48px width on reload when collapsed
- Skip width restoration in resize function if collapsed
- Extract setSidebarWidth() helper to eliminate code duplication
- Add detailed comments for maintainability
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.

1 participant