Add resizable sidebar with drag-to-resize and localStorage persistence#45
Open
chernikovalexey wants to merge 1 commit intojakemor:mainfrom
Open
Add resizable sidebar with drag-to-resize and localStorage persistence#45chernikovalexey wants to merge 1 commit intojakemor:mainfrom
chernikovalexey wants to merge 1 commit intojakemor:mainfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Owner
|
There are already drag to resize patterns in the app and state is managed by zustand - would you mind having your agent make these changes? |
Wraps the left sidebar in a ResizablePanelGroup with a zustand-backed store (persisted to localStorage) so users can drag the divider to resize. Width is clamped to 225–480px; the card inset is applied via panel padding so the right border sits flush with the resize handle.
95d8361 to
0264cfe
Compare
Author
|
Done. Let me know what you think! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
localStorageacross sessions and page reloadsHow it works
New
useSidebarResizehook handles mouse tracking, clamping, andlocalStorageread/write. The sidebar's fixedmd:w-[275px]is replaced with a CSS custom property (--sidebar-w) so width is dynamic on desktop but the mobile full-screen overlay still works viainset-0.The drag zone is a 6px invisible strip on the sidebar's right edge — no visual indicator, just a
col-resizecursor on hover.Files changed
src/client/app/useSidebarResize.ts— new hooksrc/client/app/KannaSidebar.tsx— wired up hook, swapped fixed width for CSS var, added drag zoneTest plan