Skip to content

Commit c923f05

Browse files
committed
Refine Freebuff ended session actions
1 parent 0a4b66e commit c923f05

1 file changed

Lines changed: 35 additions & 9 deletions

File tree

cli/src/components/session-ended-banner.tsx

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ interface SessionEndedBannerProps {
2121

2222
/**
2323
* Replaces the chat input when the freebuff session has ended. Captures
24-
* Enter to re-queue the user; Esc keeps falling through to the global
25-
* stream-interrupt handler so in-flight work can be cancelled.
24+
* Enter to start a new same-chat session. Esc returns to model selection
25+
* once no in-flight work needs the global stream-interrupt handler.
2626
*/
2727
export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
2828
isStreaming,
@@ -65,9 +65,14 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
6565
if (key.name === 'return' || key.name === 'enter') {
6666
key.preventDefault?.()
6767
startSameChatSession()
68+
return
69+
}
70+
if (key.name === 'escape') {
71+
key.preventDefault?.()
72+
pickNewModel()
6873
}
6974
},
70-
[startSameChatSession, canRestart],
75+
[startSameChatSession, pickNewModel, canRestart],
7176
),
7277
)
7378

@@ -96,7 +101,14 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
96101
Agent is wrapping up. Rejoin the wait room after it's finished.
97102
</text>
98103
) : (
99-
<box style={{ flexDirection: 'row', gap: 2, flexWrap: 'wrap' }}>
104+
<box
105+
style={{
106+
width: '100%',
107+
flexDirection: 'row',
108+
alignItems: 'center',
109+
gap: 2,
110+
}}
111+
>
100112
<Button onClick={startSameChatSession}>
101113
<text
102114
style={{
@@ -109,20 +121,34 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
109121
>
110122
{pendingAction === 'same-chat'
111123
? 'Starting…'
112-
: 'Press Enter to start new session (same model + chat)'}
124+
: 'Press Enter to continue with a new session'}
113125
</text>
114126
</Button>
115-
<Button onClick={pickNewModel}>
127+
<box style={{ flexGrow: 1 }} />
128+
<Button
129+
onClick={pickNewModel}
130+
style={{
131+
borderStyle: 'single',
132+
borderColor:
133+
pendingAction === 'waiting-room' ? theme.muted : theme.border,
134+
customBorderChars: BORDER_CHARS,
135+
paddingLeft: 1,
136+
paddingRight: 1,
137+
}}
138+
border={['top', 'bottom', 'left', 'right']}
139+
>
116140
<text
117141
style={{
118142
fg:
119-
pendingAction === 'waiting-room' ? theme.muted : theme.info,
143+
pendingAction === 'waiting-room'
144+
? theme.muted
145+
: theme.foreground,
120146
}}
121147
attributes={TextAttributes.BOLD}
122148
>
123149
{pendingAction === 'waiting-room'
124-
? 'Opening model picker…'
125-
: 'Pick a new model'}
150+
? 'Opening model selection…'
151+
: 'Back to model selection (ESC)'}
126152
</text>
127153
</Button>
128154
</box>

0 commit comments

Comments
 (0)