Skip to content

Add drag-to-collapse right panel - #297

Merged
alwaysmavs merged 2 commits into
mainfrom
codex/right-panel-drag-collapse
Aug 2, 2026
Merged

Add drag-to-collapse right panel#297
alwaysmavs merged 2 commits into
mainfrom
codex/right-panel-drag-collapse

Conversation

@alwaysmavs

Copy link
Copy Markdown
Contributor

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:

  1. The panel follows the pointer normally until it reaches its 260px minimum presentation width.
  2. Further movement enters a resistance zone while the visible panel remains at 260px.
  3. Crossing a 130px collapse threshold hides the panel in real time; releasing the pointer closes the active right-side surface.

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

  • Add a shared drag-layout calculation and collapse threshold alongside the existing panel width constraints.
  • Track transient drag width and collapse state independently from persisted panel width.
  • Reuse the behavior for both artifact and browser right panels while invoking the correct close action for each surface.
  • Allow the existing width, opacity, and transform transition during threshold crossing while preserving transition-free normal resizing.
  • Add boundary coverage for the resistance zone, collapse threshold, and constrained-window layout.

Validation

  • corepack pnpm run lint
  • corepack pnpm run ts-check
  • corepack pnpm exec vitest run src/components/app-shell/app-shell-model.test.ts (59 tests)
  • Manual Electron verification of resize, resistance, collapse-before-release, reverse-drag recovery, committed close, and width restoration after reopening

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb039061-3eef-4b98-a5a9-ca1ec48c2ff9

📥 Commits

Reviewing files that changed from the base of the PR and between 814d0ac and f14700e.

📒 Files selected for processing (1)
  • src/components/app-shell/use-artifacts-panel-state.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/app-shell/use-artifacts-panel-state.ts

Summary by CodeRabbit

  • New Features

    • Added drag-to-collapse behavior for the artifacts/browser panel.
    • Dragging the panel below the collapse threshold now closes it automatically.
    • Panel width and visibility update smoothly during resizing.
  • Bug Fixes

    • Improved panel behavior when starting, completing, or canceling a drag.
    • Prevented incorrect transitions while the panel is temporarily collapsed.
    • Ensured panel sizing remains within supported minimum and maximum limits.

Walkthrough

The 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 AppShellRightPanel, which preserves transitions while the panel is drag-collapsed. Tests cover clamping, threshold behavior, and equal width limits.

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
Loading

Possibly related PRs

  • oomol-lab/wanta#296: Both changes update AppShell and use-artifacts-panel-state for right-panel layout and visibility.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes the change but does not use the required <type>(<scope>): <subject> format. Rename the title using the required format, such as feat(app-shell): add drag-to-collapse right panel.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the change and validation, but it omits the required Safety and Compatibility section and checklist.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/right-panel-drag-collapse

Comment @coderabbitai help to get the list of available commands.

@alwaysmavs
alwaysmavs marked this pull request as ready for review August 2, 2026 11:38
@alwaysmavs

Copy link
Copy Markdown
Contributor Author

@coderabbitai help

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai rate limit to show your current review rate limit status.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
  • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
  • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai simplify to simplify the code in this PR.
  • @coderabbitai emit path instructions to emit generated path-specific review instructions for this repository.
  • @coderabbitai autofix to automatically fix issues identified in unresolved review comments.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @cr summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @cr anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@alwaysmavs
alwaysmavs merged commit e44c850 into main Aug 2, 2026
3 checks passed
@alwaysmavs
alwaysmavs deleted the codex/right-panel-drag-collapse branch August 2, 2026 12:15
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