Skip to content

Conversation

@jpenilla
Copy link
Member

@jpenilla jpenilla commented Nov 16, 2025

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.

@jpenilla jpenilla added type: feature New feature or request area: diff viewer labels Nov 16, 2025
@github-actions
Copy link

github-actions bot commented Nov 16, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
diffs ✅ Ready (View Log) Visit Preview c5ee5b6

Copy link

Copilot AI left a 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 paneforge@1.0.2 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.

@jpenilla jpenilla force-pushed the feat/resizable-sidebar branch from 64d2c59 to c5ee5b6 Compare November 18, 2025 03:22
@jpenilla jpenilla merged commit dd93e61 into master Nov 18, 2025
3 checks passed
@jpenilla jpenilla deleted the feat/resizable-sidebar branch November 18, 2025 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants