-
-
Notifications
You must be signed in to change notification settings - Fork 3
Make sidebar resizable #45
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
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
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.
Pull Request Overview
This PR adds resizable sidebar functionality to the diff viewer using the paneforge library. Users can now manually adjust the sidebar width by dragging a resize handle, with the layout state persisted in cookies across sessions.
- Integrates paneforge library for split pane layout with resizable sidebar
- Implements layout state persistence via cookies for sidebar width
- Adds keyboard shortcut (Ctrl/Cmd+B) to toggle sidebar visibility
- Refactors sidebar positioning logic to work within the paneforge layout system
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| web/package.json | Adds [email protected] dependency for resizable panes |
| web/src/lib/layout.svelte.ts | New LayoutState class managing sidebar width, collapse state, and layout persistence |
| web/src/lib/util.ts | Adds setCookie and clearCookie helper functions for layout persistence |
| web/src/lib/keybinds.svelte.ts | Renames getModifierKey to formatModifierKey (private) and adds formatModifierBind for consistent keybind formatting |
| web/src/lib/global-options.svelte.ts | Uses new setCookie utility function instead of inline cookie setting |
| web/src/lib/diff-viewer.svelte.ts | Integrates LayoutState and registers Ctrl/Cmd+B keybind for sidebar toggle |
| web/src/routes/+layout.svelte | Moves GlobalOptions.init from page to layout for earlier initialization |
| web/src/routes/+page.server.ts | New server load function to retrieve persisted layout state from cookies |
| web/src/routes/+page.svelte | Replaces manual sidebar positioning with PaneGroup/Pane/PaneResizer components |
| web/src/routes/Sidebar.svelte | Simplifies sidebar component by removing positioning logic and click-outside handling |
| web/src/routes/FileHeader.svelte | Updates to use layoutState.sidebarCollapsed |
| web/src/lib/components/SidebarToggle.svelte | Moved from routes/ and updated to use layoutState.toggleSidebar() |
| web/src/lib/components/menu-bar/MenuBar.svelte | Adds "Toggle Sidebar" and "Reset Layout" menu items, includes SidebarToggle in menubar |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
64d2c59 to
c5ee5b6
Compare
Allows resizing the sidebar while maintaining the same general layout and sidebar left/right positioning ability.
Known issue:
When opening a new window with an existing layout cookie for a different sized window, the absolute sidebar size will change as only proportions are persisted. There is a TODO in the code with more details, but fixing this properly needs changes in paneforge to support setting a size in px for SSR.