Skip to content

fix: tabbed and stacked groups go back to the split direction they had - #567

Open
mattchristenson wants to merge 1 commit into
forge-ext:mainfrom
Reliable-Collaboration:fix/group-toggle-keeps-direction
Open

mattchristenson wants to merge 1 commit into
forge-ext:mainfrom
Reliable-Collaboration:fix/group-toggle-keeps-direction

Conversation

@mattchristenson

Copy link
Copy Markdown

Fixes #563.

Change.

  • Remembering. Node.layout is now an accessor. Whenever a split container becomes tabbed or stacked, wherever that happens (toggles, drag and drop, settings), it remembers its split direction (splitLayout).
  • Restoring. Node.restoreSplitLayout(fallback) returns to that direction, or to fallback if there is none. Every way back to a split uses it:
    • both toggles;
    • auto-exit of a tab group with one window left;
    • resetLayoutSingleChild();
    • turning the stacked or tabbed feature off.
  • Nothing to remember. A container created just for a group has no direction to remember (setGroupLayout(layout, false)): the one a toggle wraps around a window sitting directly on the workspace, and the one a drop on a window's centre creates. For those, the monitor's shape (determineSplitLayout()) stays the fallback.

Testing. scenarios/17_stack_tab_switching.py: 17.1 (stacked) and 17.2 (tabbed) fail on main, where a vertical split comes back horizontal, and pass with this PR. That is 2/13 on main and 4/13 on this branch; the other checks belong to the related PRs. On a build with all of them, scenario 17 passes 13/13. That build was also run in a real GNOME Shell 50 session (Ubuntu, 7680×2160) through the harness's real-session runner. Every other scenario is unchanged. prettier@2.7.1 --check is clean.

Merging note. #557 (stale tab bars) renames parentNode to existParent in the auto-exit block of removeNode(). Whichever PR merges second needs the one-line existParent.restoreSplitLayout(...) there.

🤖 Generated with Claude Code

Toggling a split container to tabbed or stacked and back (Super+Shift+T / S)
changed its direction: windows above each other came back side by side, and
the other way round. Leaving a group always took a direction from the
monitor's shape (determineSplitLayout()), not from the container.

A container now remembers its split direction when it becomes a tabbed or
stacked group (Node.setGroupLayout()), and every way back to a split
restores it (Node.restoreSplitLayout()): both toggles, auto-exit of a tab
group left with one window, a group left with one child, and turning the
tabbed/stacked features off. The monitor's shape is still the fallback for
a group that never was a split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Bug: Toggling stacked or tabbed layout off changes the container's split direction

1 participant