Skip to content

fix(tui): allow navigation into grandchild sessions from subagent view#23783

Open
areyouok wants to merge 2 commits intoanomalyco:devfrom
areyouok:fix_subagent_view
Open

fix(tui): allow navigation into grandchild sessions from subagent view#23783
areyouok wants to merge 2 commits intoanomalyco:devfrom
areyouok:fix_subagent_view

Conversation

@areyouok
Copy link
Copy Markdown

Issue for this PR

Closes #23782

Type of change

  • Bug fix

What does this PR do?

The bug: moveFirstChild() and moveChild() use children() to find child sessions, but children() 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 searches sync.data.session for sessions whose parentID matches the current session's ID, instead of relying on children(). moveChild() also filters by the current session's parentID to correctly cycle siblings at any depth. Adds a "Child" button to the subagent footer when the current sub-agent has children. Uses <leader>down for consistency with the root session's keybind.

Commit 2 changes the subagent view to use bare down key to enter child sessions (via a separate command session.child.first.subagent), matching the existing subagent navigation style where up/left/right all 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
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.

fix(tui): cannot navigate into grandchild sessions from subagent view

1 participant