Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

improvement: replace canvas toolbar toggle expansion with popover UI#690

Merged
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
improvement/toolbar-popover-uibreaking-brake/cc-wf-studio:improvement/toolbar-popover-uiCopy head branch name to clipboard
Mar 27, 2026
Merged

improvement: replace canvas toolbar toggle expansion with popover UI#690
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
improvement/toolbar-popover-uibreaking-brake/cc-wf-studio:improvement/toolbar-popover-uiCopy head branch name to clipboard

Conversation

@breaking-brake
Copy link
Copy Markdown
Owner

@breaking-brake breaking-brake commented Mar 26, 2026

Summary

Replace the inline expanding toggle UI in the canvas toolbar with a Radix Popover-based approach for better UX and no overflow clipping issues.

What Changed

Before

  • Toggle buttons expanded horizontally inline when hovered, pushing adjacent toggles
  • Expansion direction caused layout shifts and overflow clipping at panel edges
  • useStableHover hook handled hover detection with complex bounds checking

After

  • Toggle buttons show a Radix Popover portal centered on the button on hover
  • Popover renders outside the DOM tree, eliminating all overflow/clipping issues
  • Smooth scaleX CSS animation for horizontal expand effect
  • New usePopoverHover hook tracks trigger + portal hover independently
  • Increased button gap (6px → 8px) for better spacing

Changes

  • src/webview/src/components/ScrollModeToggle.tsx - Popover UI
  • src/webview/src/components/InteractionModeToggle.tsx - Popover UI
  • src/webview/src/components/EdgeAnimationToggle.tsx - Popover UI
  • src/webview/src/components/HighlightToggle.tsx - Popover UI
  • src/webview/src/components/MinimapToggle.tsx - Popover UI
  • src/webview/src/components/CanvasToolbar.tsx - Button gap adjustment
  • src/webview/src/components/WorkflowEditor.tsx - Node palette button margin
  • src/webview/src/hooks/usePopoverHover.ts - New hook for portal hover
  • src/webview/src/hooks/useStableHover.ts - Removed (unused)
  • src/webview/src/styles/main.css - Popover animation keyframes

Testing

  • Manual E2E testing completed

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced toggle controls (edge animation, highlight, interaction mode, minimap, and scroll mode) with improved popover-based interactions for better usability.
    • Added smooth animations for toggle popover transitions with support for reduced motion preferences.
  • Style

    • Adjusted toolbar spacing and node palette button positioning for improved layout consistency.

- Replace inline expand animation with Radix Popover portal approach
- Toggle settings UI appears as popover centered on button via portal
- Add scaleX CSS animation for smooth horizontal expand effect
- Add usePopoverHover hook for stable trigger+portal hover management
- Remove useStableHover hook (no longer needed)
- Increase toolbar button gap from 6px to 8px
- Adjust node palette expand button margin

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

The PR refactors multiple canvas toolbar toggle components from hover-driven inline expansion to Radix Popover-based interactions, introduces a new usePopoverHover hook for managing hover state across trigger and content regions, removes the obsolete useStableHover hook, and applies CSS animations plus minor spacing adjustments.

Changes

Cohort / File(s) Summary
Toolbar Spacing
src/webview/src/components/CanvasToolbar.tsx, src/webview/src/components/WorkflowEditor.tsx
Minor adjustments to container gap and panel margin-top values for vertical/horizontal alignment.
Toggle Components Refactor
src/webview/src/components/EdgeAnimationToggle.tsx, src/webview/src/components/HighlightToggle.tsx, src/webview/src/components/InteractionModeToggle.tsx, src/webview/src/components/MinimapToggle.tsx, src/webview/src/components/ScrollModeToggle.tsx
Replaced useStableHover-driven expand/collapse behavior with Radix Popover wrapped around fixed-size trigger buttons; moved interactive controls into Popover.Content with portal rendering; removed transition timing and conditional inline rendering; updated event handlers for popover dismiss prevention.
Hover Hook Replacement
src/webview/src/hooks/usePopoverHover.ts, src/webview/src/hooks/useStableHover.ts
Added new usePopoverHover hook providing isHovered, triggerProps, and contentProps with delayed close logic to bridge portal transitions; removed deprecated useStableHover that relied on element bounding-rect hit-testing.
Popover Animations
src/webview/src/styles/main.css
Added CSS keyframe animations (toggle-popover-open, toggle-popover-close) with horizontal scale and opacity transitions, including reduced-motion media query support.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

released

Poem

🐰 With popovers now in place,
Those toggles gain some breathing space!
No more hover-rect, just clean portals bright—
The canvas toolbars shimmer with delight ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing inline toggle expansion with a Radix Popover-based UI across the canvas toolbar components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improvement/toolbar-popover-ui

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/webview/src/components/WorkflowEditor.tsx (1)

458-458: Consider deriving the toolbar offset dynamically to improve maintainability.

The margin increased from 48px to 56px to position the expand button below the CanvasToolbar (which is 34px tall). While the value appears correct for the current toolbar dimensions, it's a hardcoded magic number that will require manual updates if the toolbar height or spacing changes in the future. Consider deriving this value dynamically (via a CSS variable, a calculated constant, or a ref measurement) to reduce coupling between components and improve maintainability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/webview/src/components/WorkflowEditor.tsx` at line 458, Replace the
hardcoded marginTop '56px' on the Panel with a dynamically computed offset
derived from the CanvasToolbar's actual height/spacing: add a ref on the
CanvasToolbar (e.g., toolbarRef), measure its height (via getBoundingClientRect
or a ResizeObserver) and store a CSS variable or component state (e.g.,
toolbarHeight or --canvas-toolbar-offset) and use that value to set Panel's
marginTop (or style={{ marginTop: `${toolbarHeight + extraSpacing}px` }}).
Update references to Panel and CanvasToolbar in WorkflowEditor.tsx so the expand
button positioning uses the measured toolbar size rather than the magic number.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/webview/src/components/WorkflowEditor.tsx`:
- Line 458: Replace the hardcoded marginTop '56px' on the Panel with a
dynamically computed offset derived from the CanvasToolbar's actual
height/spacing: add a ref on the CanvasToolbar (e.g., toolbarRef), measure its
height (via getBoundingClientRect or a ResizeObserver) and store a CSS variable
or component state (e.g., toolbarHeight or --canvas-toolbar-offset) and use that
value to set Panel's marginTop (or style={{ marginTop: `${toolbarHeight +
extraSpacing}px` }}). Update references to Panel and CanvasToolbar in
WorkflowEditor.tsx so the expand button positioning uses the measured toolbar
size rather than the magic number.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0c5a10d-047f-4d8c-922b-fce683ab94a3

📥 Commits

Reviewing files that changed from the base of the PR and between f340c94 and faf416c.

📒 Files selected for processing (10)
  • src/webview/src/components/CanvasToolbar.tsx
  • src/webview/src/components/EdgeAnimationToggle.tsx
  • src/webview/src/components/HighlightToggle.tsx
  • src/webview/src/components/InteractionModeToggle.tsx
  • src/webview/src/components/MinimapToggle.tsx
  • src/webview/src/components/ScrollModeToggle.tsx
  • src/webview/src/components/WorkflowEditor.tsx
  • src/webview/src/hooks/usePopoverHover.ts
  • src/webview/src/hooks/useStableHover.ts
  • src/webview/src/styles/main.css
💤 Files with no reviewable changes (1)
  • src/webview/src/hooks/useStableHover.ts

{/* Expand Node Palette Button (when collapsed) */}
{isNodePaletteCollapsed && onExpandNodePalette && (
<Panel position="top-left" style={{ marginTop: '48px' }}>
<Panel position="top-left" style={{ marginTop: '56px' }}>
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The toolbar height (34px) is stable and unlikely to change. Introducing a ref + ResizeObserver for this would add unnecessary complexity. This is consistent with other hardcoded Panel marginTop values in the codebase. No change needed.

@breaking-brake breaking-brake merged commit 7ece04a into main Mar 27, 2026
4 checks passed
@breaking-brake breaking-brake deleted the improvement/toolbar-popover-ui branch March 27, 2026 01:36
@breaking-brake breaking-brake mentioned this pull request Mar 27, 2026
braking-brake-semantic-release Bot pushed a commit that referenced this pull request Mar 27, 2026
## [3.31.1](v3.31.0...v3.31.1) (2026-03-27)

### Bug Fixes

* use non-localized labels for built-in sub-agent names and badge ([#691](#691)) ([d4100e8](d4100e8))

### Improvements

* replace canvas toolbar toggle expansion with popover UI ([#690](#690)) ([7ece04a](7ece04a))
@braking-brake-semantic-release
Copy link
Copy Markdown

🎉 This PR is included in version 3.31.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.