-
Notifications
You must be signed in to change notification settings - Fork 13
Add draggable/resizable sidebar functionality to MUI Drawer-based sidebar #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add draggable/resizable sidebar functionality to MUI Drawer-based sidebar #476
Conversation
…management Co-authored-by: ahuang11 <[email protected]>
MarcSkovMadsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
18 units tests are mentioned but I don't see them. I would probably also prefer focusing on the most important tests only. If possible add a ui playwright based test.
|
Very cool that copilot was able to do most of it! a.mp4 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #476 +/- ##
==========================================
+ Coverage 78.93% 78.98% +0.04%
==========================================
Files 31 31
Lines 2901 2902 +1
==========================================
+ Hits 2290 2292 +2
+ Misses 611 610 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It should definitely stretch the whole height of the screen. Also I'd like to understand how this interacts with the different sidebar_variants. |
|
Here's the sidebar variants. temp.mp4persist.mp4perm.mp4 |
|
Great that this is happening! Is there / should there be a parameter @ahuang11 to set the "draggability" to True / False? |
|
There already is if I understand correctly |
Thanks @ahuang11 . Did you have a chance to test if draggability works in practice on a mobile device? I.e. is it easy to "grab" the drag bar on a touchscreen? Is the drag bar wide enough to do this? Made #481 to add the parameter to the docs. |
Yes, works well. |
Closes #470
This PR implements draggable/resizable functionality for the sidebar in
Page.jsx, allowing users to dynamically adjust the sidebar width by dragging a handle positioned at the right edge of the sidebar.What's New
The sidebar now features a drag handle that appears as a subtle vertical line at the right edge. Users can click and drag this handle horizontally to resize the sidebar in real-time, with the new width being persisted in the component's state.
Key Features
🎯 Visual Drag Handle
col-resizecursor indicates draggable functionality🖱️ Comprehensive Drag Support
📏 Smart Width Constraints
sidebar_widthis not setsetSidebarWidthsetter🔄 Full Compatibility
persistent,temporary,permanent,autoImplementation Details
The implementation adds minimal, surgical changes to
Page.jsx:Usage Example
Testing
Breaking Changes
None. This is a purely additive enhancement that maintains full backward compatibility with existing applications.
Users can now enjoy a more interactive and customizable sidebar experience while developers benefit from the same reliable API they're already using.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.