Skip to content

Conversation

@RebliNk17
Copy link

Overview

Implements resizable panels for the project editor, allowing users to dynamically adjust the width of the chat and preview sections based on their preferences.

Motivation

Previously, the chat and preview sections were fixed width. This feature provides flexibility for users who want to focus on either the chat interface or the live preview by resizing the divider between them.

Changes

  • Resizable Layout: Replaced fixed flex layout with react-resizable-panels PanelGroup
  • Chat Panel: Left panel with 50% default width, 30% minimum
  • Preview Panel: Right panel with 50% default width, 30% minimum
  • Resize Handle: Styled divider with:
    • Theme-aware colors (adapts to light/dark mode)
    • Hover effect using primary color for visual feedback
    • Smooth cursor change (col-resize) on hover
    • 1px width for minimal visual footprint

Technical Details

  • Uses react-resizable-panels library (already installed)
  • Horizontal panel group layout
  • Maintains minimum 30% width on each side to keep both usable
  • Default 50/50 split for balanced default experience
  • Smooth resizing with no performance impact

User Experience

✅ Intuitive drag-to-resize interaction
✅ Visual feedback on hover
✅ Maintains minimum usable sizes
✅ Works seamlessly in light and dark themes
✅ No configuration needed - works out of the box

Testing

  • Tested resizing chat panel left and right
  • Verified minimum width constraints work correctly
  • Confirmed resize handle styling in both themes

Files Changed

  • src/components/project-chat.tsx

Related Issues

Improves user experience on project page by allowing more flexible layout preferences.

image

- Implement PanelGroup with horizontal layout
- Add resizable Panel for chat and preview sections
- Configure minimum panel width of 30% to keep both usable
- Default to 50/50 split between chat and preview
- Style resize handle with theme-aware colors
- Add hover effect on resize handle with primary color
- Smooth resizing with cursor feedback
- Supports dynamic layout adjustment based on user preference
@vercel
Copy link

vercel bot commented Nov 9, 2025

@RebliNk17 is attempting to deploy a commit to the personal Team on Vercel.

A member of the Team first needs to authorize it.

- Add localStorage persistence for panel sizes per project
- Load saved sizes on component mount with loading state
- Save panel sizes automatically when resized
- Fix timing issue where defaultSize was set before localStorage loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant