fix(tui): allow navigation into grandchild sessions from subagent view#23783
Open
areyouok wants to merge 2 commits intoanomalyco:devfrom
Open
fix(tui): allow navigation into grandchild sessions from subagent view#23783areyouok wants to merge 2 commits intoanomalyco:devfrom
areyouok wants to merge 2 commits intoanomalyco:devfrom
Conversation
7441c38 to
90388d2
Compare
Match the pattern of up/left/right navigation in subagent view by using a bare down key instead of <leader>down to navigate into child sessions. Only the root session view still requires <leader>down.
0cdd831 to
2e574ac
Compare
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.
Issue for this PR
Closes #23782
Type of change
What does this PR do?
The bug:
moveFirstChild()andmoveChild()usechildren()to find child sessions, butchildren()only returns the root session's direct children. From a sub-agent view, grandchild sessions don't appear in that list, so pressing down or any navigation key to enter a grandchild does nothing.Commit 1 fixes the core issue:
moveFirstChild()now searchessync.data.sessionfor sessions whoseparentIDmatches the current session's ID, instead of relying onchildren().moveChild()also filters by the current session'sparentIDto correctly cycle siblings at any depth. Adds a "Child" button to the subagent footer when the current sub-agent has children. Uses<leader>downfor consistency with the root session's keybind.Commit 2 changes the subagent view to use bare
downkey to enter child sessions (via a separate commandsession.child.first.subagent), matching the existing subagent navigation style whereup/left/rightall use bare keys. The root session still uses<leader>down.How did you verify your code works?
Manual testing in the TUI: navigated through a 3-level deep session hierarchy (root → sub-agent → grandchild) confirming that down navigation works at every level. Also verified sibling cycling (left/right) still works correctly within each level.
Screenshots / recordings
N/A — no visual changes, only keybind behavior fix.
Checklist