Skip to content

refactor(site): replace DiffRightPanel with generic tabbed RightPanel - #22633

Merged
kylecarbs merged 1 commit into
mainfrom
kylecarbs/right-panel
Mar 5, 2026
Merged

kylecarbs merged 1 commit into
mainfrom
kylecarbs/right-panel

Conversation

@kylecarbs

Copy link
Copy Markdown
Member

Replace the single-purpose DiffRightPanel with a generic RightPanel component that supports tabs, drag-resize, drag-to-snap, and drag-to-collapse-sidebar.

Changes

  • New RightPanel.tsx: generic tabbed panel with:
    • Drag handle with pointer capture for smooth resizing
    • Snap thresholds: drag past max → expand, drag below min → close
    • Live sidebar collapse when dragging to the left viewport edge (and reverses if dragged back)
    • Persisted width via localStorage
    • onVisualExpandedChange callback so parent syncs sibling visibility during drag (not just on pointer-up)
  • Deleted DiffRightPanel.tsx
  • Updated AgentDetail.tsx: uses RightPanel with tabContent record, tracks dragVisualExpanded for live chat section hiding
  • Updated FilesChangedPanel.tsx: removed border/background (now handled by RightPanel wrapper)

Drag behavior

Gesture Effect
Drag left past 70vw + 80px Snap to expanded (fullscreen within parent)
Drag right below 360px - 80px Snap to closed
Drag to left viewport edge (<80px) Collapse sidebar live
Drag back from left edge Uncollapse sidebar live
Start expanded, drag right Live resize back to normal

Replace the single-purpose DiffRightPanel with a generic RightPanel
component that supports tabs, drag-resize, drag-to-snap (expanded,
closed), and drag-to-collapse-sidebar.

Key changes:
- New RightPanel.tsx: generic tabbed panel with drag handle, snap
  thresholds for expand/close, persisted width, and live sidebar
  collapse when dragging to the left viewport edge
- Parent provides tab content via tabContent record; panel owns
  tab definitions and active tab state internally
- Drag state syncs live to parent via onVisualExpandedChange so
  sibling content (chat section) hides/shows during drag, not
  just on pointer-up
- Removed DiffRightPanel.tsx
- Updated AgentDetail.tsx to use RightPanel with visualExpanded
  derived from both committed state and drag override
- Removed border/background from FilesChangedPanel (now handled
  by RightPanel wrapper)
@kylecarbs
kylecarbs force-pushed the kylecarbs/right-panel branch from 4b5936d to 565a975 Compare March 5, 2026 00:29
@kylecarbs
kylecarbs requested a review from mattvollmer March 5, 2026 00:31
@kylecarbs
kylecarbs enabled auto-merge (squash) March 5, 2026 00:32
@kylecarbs
kylecarbs merged commit 6afcc7b into main Mar 5, 2026
25 checks passed
@kylecarbs
kylecarbs deleted the kylecarbs/right-panel branch March 5, 2026 00:37
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants