Add drag-to-collapse right panel - #297
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
WalkthroughThe artifacts panel now uses a half-minimum-width threshold for drag collapse. The state hook tracks raw drag width, temporary collapse state, and laid-out width. Dragging below the threshold closes the active panel and clears maximization. The hook passes collapse state to Sequence Diagram(s)sequenceDiagram
participant PointerEvents
participant useArtifactsPanelState
participant artifactsPanelDragLayout
participant AppShell
participant AppShellRightPanel
PointerEvents->>useArtifactsPanelState: update pointer position
useArtifactsPanelState->>artifactsPanelDragLayout: calculate drag layout
artifactsPanelDragLayout-->>useArtifactsPanelState: width and collapsed state
useArtifactsPanelState->>AppShell: update panel state
AppShell->>AppShellRightPanel: pass collapsed state
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing Touches✨ Simplify code
Comment |
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
What changed
The right-side preview panel now supports a deliberate drag-to-collapse gesture for artifacts, execution details, and the integrated browser.
Previously, dragging the divider toward the right stopped at the panel's minimum width. That protected the panel content, but it also left the divider feeling stuck: users could not tell whether they had reached an intentional limit or whether resizing had broken, and there was no direct way to dismiss the panel from the drag gesture.
This change introduces a three-stage interaction:
Reversing direction before release restores the panel at its minimum width and resumes normal resizing. A collapsed drag never persists a zero or undersized width, so reopening the panel restores the user's previous usable width.
Implementation
Validation
corepack pnpm run lintcorepack pnpm run ts-checkcorepack pnpm exec vitest run src/components/app-shell/app-shell-model.test.ts(59 tests)