From aef75258f0aa14407fb23d04152b2878ea2d1c44 Mon Sep 17 00:00:00 2001 From: DevMando Date: Thu, 10 Sep 2026 22:11:30 -0700 Subject: [PATCH] Fix: restore the tab strip when a split view is exited MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exiting a split left the agents that had been in it with no tab at all. Their headers were collapsed — correctly, while they were on screen with their names on the pane headers — and nothing un-collapsed them, so the agents became unreachable until something else happened to refresh the strip. RefreshTabStrip owns that rule, and ExitSplit never called it. Closing a pane looked fine only by accident: RemovePane routes through SelectTab, which refreshes on the way past. Fixed at the choke point rather than at the call site. The strip lists what is NOT on screen, so it is a function of the pane set, and ApplyPaneLayout is the one method every pane-set change goes through. Refreshing there makes the two impossible to leave out of step; fixing only ExitSplit would have left the same trap for the next person to add a pane operation. An audit of all seven places that mutate the pane set found three more relying on an indirect refresh, and one — ValidateSplit, which runs when an agent is closed — with no refresh on either branch. This also re-divides the strip's width. LayoutTabStrip shares the viewport among visible headers only, so without the refresh the restored tabs would have kept widths computed while they were hidden. The bug was introduced with the pane headers and has not shipped, so there is no changelog entry. --- src/MandoCode.Desktop/MainWindow.Split.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/MandoCode.Desktop/MainWindow.Split.cs b/src/MandoCode.Desktop/MainWindow.Split.cs index 9938074..d22aa87 100644 --- a/src/MandoCode.Desktop/MainWindow.Split.cs +++ b/src/MandoCode.Desktop/MainWindow.Split.cs @@ -231,6 +231,15 @@ private void ApplyPaneLayout() // The bar keeps the add/exit controls and the layout hint, but the per-pane pickers are gone // — swapping is done by dragging a tab onto the pane it should occupy. SplitBar.Visibility = split ? Visibility.Visible : Visibility.Collapsed; + + // The strip lists what is NOT on screen, so it is a function of the pane set and has to be + // recomputed whenever that set changes. Doing it HERE rather than at each call site is the + // point: this method is the one thing every pane-set change goes through, and leaving the + // two to be kept in step by hand is exactly how exiting a split left the paned agents with + // no tab at all — ExitSplit applied the layout but never refreshed the strip, so their + // headers stayed collapsed with nothing on screen naming them. Closing a pane looked fine + // only because RemovePane happens to route through SelectTab, which refreshes. + RefreshTabStrip(); } ///