Skip to content

Add resizable inline right panels#2512

Open
shivamhwp wants to merge 16 commits into
pingdotgg:mainfrom
shivamhwp:right-sidebar-resize-fix
Open

Add resizable inline right panels#2512
shivamhwp wants to merge 16 commits into
pingdotgg:mainfrom
shivamhwp:right-sidebar-resize-fix

Conversation

@shivamhwp
Copy link
Copy Markdown
Collaborator

@shivamhwp shivamhwp commented May 5, 2026

  • Wrap plan and diff sidebars in a shared resizer
  • Persist widths as ratios in local storage
  • Simplify sidebar layout to use full-width content

What Changed

Added a reusable resizable right-panel wrapper and used it for the inline plan/tasks sidebar and inline diff panel. The panel now defaults to 40% of the available chat area, can be resized between 30% and 80%, and persists the chosen width separately for plan/tasks and diff panels.

Why

The plan/tasks sidebar was fixed-width, so users could not adjust the space split between the conversation and the right-side detail panel. A percentage-based resizer matches the requested behavior and keeps the layout proportional when the window or left sidebar changes.

UI Changes

Screen.Recording.2026-05-05.at.7.34.29.AM.mov

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
UI-only layout and localStorage key changes; composer overflow guards limit regressions, and users may need to re-adjust panel width after the switch from pixel to ratio storage.

Overview
Adds a shared ResizableRightPanel so inline right panels (plan/tasks and diff) can be dragged between 30–80% of the chat row, default 40%, with widths saved as separate localStorage ratios (chat_plan_sidebar_width_ratio, chat_diff_sidebar_width_ratio). Resize is blocked when it would squeeze the chat composer below a minimum width.

The inline plan sidebar in ChatView is wrapped in this panel; PlanSidebar drops the fixed 340px width and fills the panel. The thread route’s inline diff panel replaces the old SidebarProvider / resizable Sidebar setup with the same wrapper and a simpler flex layout beside SidebarInset (including removing the inline sidebar’s open-diff navigation hook).

For desktop tests, a Vitest electron alias points imports at a new electronMock stub module.

Reviewed by Cursor Bugbot for commit f6510cc. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add resizable inline right panels for plan sidebar and diff panel

  • Adds ResizableRightPanel, a reusable component with a draggable handle that resizes a right panel as a ratio (30–80%) of its container, persisting the ratio to localStorage per storageKey.
  • Wraps the inline plan sidebar in ChatView and the inline diff panel in the chat thread route with ResizableRightPanel, replacing the previous pixel-based sidebar mechanism for the diff panel.
  • Resize logic validates against the chat composer's DOM layout to prevent overflow or violating a minimum composer width, using requestAnimationFrame throttling during drag.
  • Adds a Vitest config and Electron API mock for the desktop app to support unit tests that import electron.
  • Behavioral Change: the diff panel is now hidden when closed rather than off-canvas, and its width is ratio-based rather than pixel-based.

Macroscope summarized f6510cc.

shivamhwp added 2 commits May 5, 2026 07:31
- Wrap plan and diff sidebars in a shared resizer
- Persist widths as ratios in local storage
- Simplify sidebar layout to use full-width content
- Coalesce width ratio updates through a single commit helper
- Keep the ref and React state in sync during pointer-driven resizing
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6cd8825f-8f98-408c-a782-52daeab971dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 5, 2026
Comment thread apps/web/src/components/ResizableRightPanel.tsx
…e-fix

# Conflicts:
#	apps/web/src/routes/_chat.$environmentId.$threadId.tsx
Comment thread apps/web/src/routes/_chat.$environmentId.$threadId.tsx
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 5, 2026

Approvability

Verdict: Needs human review

This PR introduces a new resizable panel feature with non-trivial interaction logic. An unresolved review comment identifies a medium-severity bug where stored panel widths aren't validated on mount, potentially causing layout issues with the chat composer.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/routes/_chat.$environmentId.$threadId.tsx
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 5, 2026
@macroscopeapp macroscopeapp Bot dismissed their stale review May 5, 2026 04:54

Dismissing prior approval to re-evaluate 385b32c

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 5, 2026
Comment thread apps/web/src/routes/_chat.$environmentId.$threadId.tsx
Comment thread apps/web/src/components/ResizableRightPanel.tsx
Comment thread apps/web/src/components/ResizableRightPanel.tsx
shivamhwp added 2 commits May 9, 2026 20:59
- Guard body style cleanup to avoid leaking resize cursor state
- Keep the diff sidebar mounted when closed so width is preserved
@macroscopeapp macroscopeapp Bot dismissed their stale review May 9, 2026 16:03

Dismissing prior approval to re-evaluate 52721c9

Comment thread apps/web/src/components/ResizableRightPanel.tsx
Comment thread apps/web/src/components/ResizableRightPanel.tsx
Comment thread apps/web/src/components/ResizableRightPanel.tsx
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f6510cc. Configure here.

const violatesMinimumComposerWidth = composerForm.clientWidth + 0.5 < minimumComposerWidth;

return !hasComposerOverflow && !overflowsViewport && !violatesMinimumComposerWidth;
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined panel widths unchecked on mount

Medium Severity

The ResizableRightPanel applies stored or default width ratios on mount without checking canAcceptComposerWidth. This can cause the chat composer to be clipped, overflow, or become too narrow, especially with dynamic layout changes from other panels.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f6510cc. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant