Skip to content

Add support for interactive panel docking#4015

Merged
Keavon merged 5 commits intomasterfrom
panel-docking
Apr 8, 2026
Merged

Add support for interactive panel docking#4015
Keavon merged 5 commits intomasterfrom
panel-docking

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented Apr 8, 2026

Partly closes #195

capture_4_.mp4

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 8 files

Confidence score: 2/5

  • High-risk merge: there are concrete, high-confidence data-loss paths in editor/src/messages/portfolio/portfolio_message_handler.rs where SplitPanelGroup and MoveAllPanelTabs remove/clear tabs before validating target_group, so invalid targets can drop tabs.
  • editor/src/messages/portfolio/utility_types.rs can return a fresh PanelGroupId even when split insertion fails, creating state drift where subsequent lookups/mutations target an ID not present in the layout tree.
  • frontend/wrapper/src/editor_wrapper.rs uses unwrap() while decoding JS input; malformed input can panic and crash the editor runtime, making this a user-visible stability risk.
  • Pay close attention to editor/src/messages/portfolio/portfolio_message_handler.rs, editor/src/messages/portfolio/utility_types.rs, and frontend/wrapper/src/editor_wrapper.rs - tab-loss ordering, invalid ID/state drift, and panic-on-decode need guarding before merge.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/wrapper/src/editor_wrapper.rs">

<violation number="1" location="frontend/wrapper/src/editor_wrapper.rs:478">
P2: Avoid `unwrap()` when decoding JS inputs in this wrapper method; malformed input can panic and crash the editor runtime.</violation>
</file>

<file name="editor/src/messages/portfolio/utility_types.rs">

<violation number="1" location="editor/src/messages/portfolio/utility_types.rs:241">
P2: `split_panel_group` returns a newly generated `PanelGroupId` even when the insertion fails. That ID is not present in the layout tree, so any follow-up lookup/mutation will fail or drift from the real state. Consider returning `Option<PanelGroupId>` (or the existing group ID) and only returning `Some(new_id)` when insertion succeeds.</violation>
</file>

<file name="editor/src/messages/portfolio/portfolio_message_handler.rs">

<violation number="1" location="editor/src/messages/portfolio/portfolio_message_handler.rs:472">
P1: `MoveAllPanelTabs` does not validate `target_group` before clearing the source tabs, so an invalid target can drop all moved tabs.</violation>

<violation number="2" location="editor/src/messages/portfolio/portfolio_message_handler.rs:1288">
P1: `SplitPanelGroup` can lose dragged tabs when `target_group` is invalid because tabs are removed before split insertion is validated.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements advanced panel docking and tab management features, including the ability to move entire tab groups and split panel groups via drag-and-drop. The implementation introduces new message types, updates the workspace layout logic, and adds visual feedback in the frontend. Feedback was provided regarding the efficiency of inserting elements into a vector, the use of a sentinel value for list insertion, and the performance impact of frequent DOM queries during drag operations.

@Keavon Keavon merged commit b099e2f into master Apr 8, 2026
11 checks passed
@Keavon Keavon deleted the panel-docking branch April 8, 2026 13:09
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.

Rearrange and dock tabs and panel groups in the editor workspace

1 participant