feat: add Arrange action to multi-select toolbox#12068
Conversation
Adds an Arrange popover between the color picker and frame icons in the selection toolbox. Three layouts (vertical, horizontal, grid) reposition selected nodes from the smallest x+y anchor with a 12-unit gap, sorted by current position. Visual bounds account for the title bar so titles don't overlap stacked bodies. After picking a layout, the popover swaps to a 0–48 spacing slider: drag previews live (rAF-throttled, no undo capture), release commits one undo entry. Closing the popover ends the session.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR adds a multi-layout node arrangement feature to the ComfyUI graph editor. Users can select multiple nodes and arrange them vertically, horizontally, or in a grid pattern with adjustable spacing. The system includes interactive gap previews via a popover slider, automatic undo/canvas state tracking, and full i18n support. ChangesNode Arrangement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
🎭 Playwright: ⏳ Running... |

Summary
Adds an Arrange popover to the multi-select toolbox that repositions selected nodes into vertical, horizontal, or grid layouts, with a follow-up slider to tune the spacing.
Changes
ArrangeButtonplaced between the color picker and frame icons. Three layouts (vertical, horizontal, grid) sort selected nodes by current position and lay them out from the smallest-x+yanchor with a 12-unit gap. Visual bounds account forLiteGraph.NODE_TITLE_HEIGHTso titles don't overlap stacked bodies. After picking a layout, the popover swaps to a 0–48 spacing slider — drag previews live (rAF-throttled, no undo capture), release commits one undo entry. Closing the popover ends the session.Review Focus
useArrangeNodes.computeArrangement— pure layout math separated from side effects; covered by 8 unit tests including the title-height handling andTitleMode.NO_TITLEcase.useArrangeSession— owns the slider's state machine. rAF-throttledpreviewGapcollapses rapid drag events into one frame;commitGapcancels any pending preview before capturing undo. Covered by 5 unit tests.useLayoutMutations().batchMoveNodes(single batched layout-store transaction) followed bychangeTracker.captureCanvasState()for undo — same pattern as drag and other selection-toolbox actions.pos.x + pos.yrather than min-x or min-y alone, to keep the layout origin stable across re-runs (slider drags).┆Issue is synchronized with this Notion page by Unito