Bugfix: Why did split only work once per section in dock-layout, and...

Documentation for Sessions

🐛 Bugfix: Why did split only work once per section in dock-layout, and...

Date: 2026-03-08
Time: 17:33:40 UTC
Session: gspace1-192.3
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Why did split only work once per section in dock-layout, and how to enable unlimited splits?

Task: Enable unlimited splits in dock-layout


🎯 Decision Made

Chosen:

Created splitActiveTab() in DockStateService that restructures the tree atomically in a single state update, bypassing the remove+insert+cleanup pattern that caused the bug

Options Considered:

  1. Fix movePanel to not cleanup during split operations
  2. Create new splitActiveTab method with atomic tree restructuring
  3. Add empty placeholder panel to prevent cleanup

💭 Reasoning

Root cause: movePanel() uses removeFromParent() + insertNode() + cleanupEmptyContainers(). When moving the last tab out of a group, the source tab group becomes empty → cleanupEmptyContainers collapses the split → net zero change. The fix creates splitActiveTab() that (1) removes the active tab from the tabs array, (2) creates a new tabs container for it, (3) creates a new split wrapping both, (4) rewires all parent references — all in one atomic signal update. No intermediate empty state means no cleanup collapse. Requires 2+ tabs to split (with 1 tab there's nothing to split from). Also added position parameter ('before'/'after') for Split Left/Up vs Split Right/Down.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation