@@ -17,18 +17,19 @@ export function SubagentFooter() {
1717
1818 const subagentInfo = createMemo ( ( ) => {
1919 const s = session ( )
20- if ( ! s ) return { label : "Subagent" , index : 0 , total : 0 }
20+ if ( ! s ) return { label : "Subagent" , index : 0 , total : 0 , hasChildren : false }
2121 const agentMatch = s . title . match ( / @ ( \w + ) s u b a g e n t / )
2222 const label = agentMatch ? Locale . titlecase ( agentMatch [ 1 ] ) : "Subagent"
2323
24- if ( ! s . parentID ) return { label, index : 0 , total : 0 }
24+ if ( ! s . parentID ) return { label, index : 0 , total : 0 , hasChildren : false }
2525
2626 const siblings = sync . data . session
2727 . filter ( ( x ) => x . parentID === s . parentID )
2828 . toSorted ( ( a , b ) => a . time . created - b . time . created )
2929 const index = siblings . findIndex ( ( x ) => x . id === s . id )
30+ const hasChildren = sync . data . session . some ( ( x ) => x . parentID === s . id )
3031
31- return { label, index : index + 1 , total : siblings . length }
32+ return { label, index : index + 1 , total : siblings . length , hasChildren }
3233 } )
3334
3435 const usage = createMemo ( ( ) => {
@@ -58,8 +59,8 @@ export function SubagentFooter() {
5859 const { theme } = useTheme ( )
5960 const keybind = useKeybind ( )
6061 const command = useCommandDialog ( )
61- const [ hover , setHover ] = createSignal < "parent" | "prev" | "next" | null > ( null )
62- useTerminalDimensions ( )
62+ const [ hover , setHover ] = createSignal < "parent" | "prev" | "next" | "child" | null > ( null )
63+ const dimensions = useTerminalDimensions ( )
6364
6465 return (
6566 < box flexShrink = { 0 } >
@@ -123,6 +124,18 @@ export function SubagentFooter() {
123124 Next < span style = { { fg : theme . textMuted } } > { keybind . print ( "session_child_cycle" ) } </ span >
124125 </ text >
125126 </ box >
127+ < Show when = { subagentInfo ( ) . hasChildren } >
128+ < box
129+ onMouseOver = { ( ) => setHover ( "child" ) }
130+ onMouseOut = { ( ) => setHover ( null ) }
131+ onMouseUp = { ( ) => command . trigger ( "session.child.first" ) }
132+ backgroundColor = { hover ( ) === "child" ? theme . backgroundElement : theme . backgroundPanel }
133+ >
134+ < text fg = { theme . text } >
135+ Child < span style = { { fg : theme . textMuted } } > { keybind . print ( "session_child_first" ) } </ span >
136+ </ text >
137+ </ box >
138+ </ Show >
126139 </ box >
127140 </ box >
128141 </ box >
0 commit comments