feat(layouts): add resizable side panels with localStorage persistence
Description
This PR implements the resizable side panels feature for Layer5 Docs, allowing users to customize the width of the left sidebar and right table of contents (TOC) panel.
Related Issue
Fixes #1039
Changes Made
- JavaScript (
assets/js/resizable-panels.js): Drag-to-resize functionality with localStorage persistence and reset button - Styling (
assets/scss/_resizable-panels.scss): Visual feedback for resize handles, responsive hiding on mobile/print - Integration: Updated stylesheet imports and created scripts partial for proper loading
Features Implemented
✅ Users can drag to adjust panel widths (left sidebar and right TOC) ✅ Preferences are saved in localStorage and persist across page visits ✅ Reset button available to restore default panel widths ✅ Responsive design: resize functionality only on desktop (XL screens) ✅ Constrained min/max widths to prevent layout breaking
Testing
- Tested resize functionality (drag handles work smoothly)
- Verified localStorage persistence (widths retained across page reloads)
- Tested reset button (restores defaults)
- Verified mobile/tablet responsiveness (handles hidden on smaller screens)
- Verified print styles (handles hidden)
Notes for Reviewers
Per the acceptance criteria, a matching issue should be created for Meshery Docs to receive the same enhancement.
Signed Commits
- [x] Yes, I signed my commits.
Contributing Conventions: PR includes descriptive title with [layouts] component, changes tested, and commits are signed.
| PR Preview Action v1.6.3 |
|---|
| Preview removed because the pull request was closed. |
| 2026-06-13 18:19 UTC |
@Rudra2637 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would :slightly_smiling_face:
@banana-three-join, how are we doing here?
REPEAT:
Acceptance Tests We're using the same framework (Hugo) and same theme across our site properties with much intentionality: reuse, consistent UX, lower cost of sustaining, and so on. When either Meshery Docs or Layer5 Docs receives an enhancement or bug fix in the layout/framework/shortcode/partial, etc... both should benefit. So, open an issue to enhance Meshery Docs when this feature is delivered.
Thanks for the clarification. I’ll revert back to the previous implementation with the side panel width adjustments and update the PR accordingly. Once that’s done, will let you know.
Ok, I will look into the suggested changes and re request review once i am done adjusting the pr as per the suggestions
/gemini review
@Rudra2637 Please review the recommendations and resolved them. The most recent recommendations (Both mine's a Gemini's) don't point out any major bugs so after the feedback has been addressed, and it has been stated how it has been addressed, a video proof should be more than enough to merge the pr!
Ok i will look into your suggestions as well as gemini and create video
The latest recommendations have been addressed. The resource-loading code now uses an array and loop instead of adding each asset individually, the resizable-panels logic has already been refactored to avoid unnecessary class usage, and the width normalization now uses the defined per-item limits instead of a shared magic number.
https://github.com/user-attachments/assets/c57f5d38-2282-4a2a-b04c-103b9cf25053
Hey @banana-three-join have exams would be looking to this as soon as i get some time.
@Rudra2637 Any updates in regards of your availability to conclude the PR?
sorry for the delay, will be updating the pr tomorrow or day after tomorrow
@Rudra2637 Also, you're going to have conflicts because you're currently using the outdated usage of .Site.Lang in Hugo which is now deprecated and was correctly replaced upstream so look into also removing it's usage in favor for the new convention.
Thanks for the feedback.
Dynamic event listeners: The pointermove, pointerup, and pointercancel listeners are now attached per drag gesture inside startResize() using an AbortController. When the resize gesture ends (pointerup or pointercancel), controller.abort() removes all associated listeners automatically.
Single manager / multiple sidebars: There is only one .row.flex-xl-nowrap container rendered per page (as defined in baseof.html), so initializing a single resize manager via querySelector() is intentional.
Please let me know if I've misunderstood any part of the earlier feedback or if there's another concern I should address.
@Rudra2637 I apologize but due to the lack of communication and the time that it took to take care of this PR, it was assigned to me so I could finish it which has been done over in https://github.com/layer5io/docs/pull/1098 so this PR can be closed.
Hey @banana-three-join no problem it was obvious i took so much of time