fix: LayoutToggle silent no-op when parent is not HSPLIT/VSPLIT#527
Open
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
Open
fix: LayoutToggle silent no-op when parent is not HSPLIT/VSPLIT#527mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
Conversation
`LayoutToggle` swaps HSPLIT↔VSPLIT but ignores every other parent layout. In a tree with monitor-attached windows or tabbed/stacked containers, the focused window's parent may not be a split — and Super+G then does nothing without any feedback to the user. Reproduced with three windows where the middle one sits inside a tabbed sub-container: Super+G works on the first and last (their parent is HSPLIT) but silently fails on the middle one (parent is TABBED). Fall back to `determineSplitLayout()` (HSPLIT or VSPLIT depending on monitor orientation) when the current layout is anything else, so the binding always has a visible effect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LayoutToggle(the action behindcon-split-layout-toggle, defaultSuper+G) only swaps betweenHSPLITandVSPLIT. Every other parent layout (TABBED,STACKED, or the bareMONITORcontainer) hits the implicit fallthrough and the action is a silent no-op — same shortcut, no feedback, no error.Reproducible case
Three windows side-by-side where Forge nested them as:
Reported on a multi-monitor setup as "the middle window won't toggle."
Fix
Fall back to
determineSplitLayout()(which returnsHSPLITorVSPLITdepending on monitor orientation) when the current layout is anything other than a split. The binding then always has a visible effect — toggling out of tabbed/stacked/monitor mode into a sensible split.case "LayoutToggle": if (!focusNodeWindow) return; currentLayout = focusNodeWindow.parentNode.layout; if (currentLayout === LAYOUT_TYPES.HSPLIT) { focusNodeWindow.parentNode.layout = LAYOUT_TYPES.VSPLIT; } else if (currentLayout === LAYOUT_TYPES.VSPLIT) { focusNodeWindow.parentNode.layout = LAYOUT_TYPES.HSPLIT; + } else { + focusNodeWindow.parentNode.layout = this.determineSplitLayout(); }Test plan
node --checkSuper+G→ container becomes HSPLIT/VSPLIT.