mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
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 |