Skip to content

Commit 3eaa8c7

Browse files
jahoomaclaude
andcommitted
Tighten session-ended banner layout
Move the premium-session quota into the box title and drop the redundant "Your freebuff session has ended" line — the title already says it. Border goes amber when the cap is hit so the warning signal survives the move (titles can't carry per-char color). Press Enter becomes bold foreground instead of green primary, and "Change model (ESC)" relaxes to "Change model Esc" with Esc muted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 485b618 commit 3eaa8c7

1 file changed

Lines changed: 19 additions & 23 deletions

File tree

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

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
4141
const premiumQuota = useFreebuffSessionStore(
4242
(s) => Object.values(getRateLimitsByModel(s.session) ?? {})[0] ?? null,
4343
)
44+
const isQuotaExhausted = premiumQuota
45+
? premiumQuota.recentCount >= premiumQuota.limit
46+
: false
47+
const bannerTitle = premiumQuota
48+
? `Session ended · ${formatSessionUnits(premiumQuota.recentCount)} of ${premiumQuota.limit} premium sessions used today`
49+
: 'Session ended'
4450

4551
// While a request is still streaming, restart is disabled: it would
4652
// unmount <Chat> and abort the in-flight agent run. The promise is "we
@@ -88,12 +94,15 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
8894

8995
return (
9096
<box
91-
title="Session ended"
97+
title={bannerTitle}
9298
titleAlignment="center"
9399
style={{
94100
width: '100%',
95101
borderStyle: 'single',
96-
borderColor: theme.muted,
102+
// Amber border doubles as the "you've hit the cap" signal now that
103+
// the quota count lives in the title (which can't carry per-char
104+
// color); muted otherwise.
105+
borderColor: isQuotaExhausted ? theme.secondary : theme.muted,
97106
customBorderChars: BORDER_CHARS,
98107
paddingLeft: 1,
99108
paddingRight: 1,
@@ -103,22 +112,6 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
103112
gap: 0,
104113
}}
105114
>
106-
<text style={{ fg: theme.foreground, wrapMode: 'word' }}>
107-
Your freebuff session has ended.
108-
{premiumQuota && (
109-
<span
110-
fg={
111-
premiumQuota.recentCount >= premiumQuota.limit
112-
? theme.secondary
113-
: theme.muted
114-
}
115-
>
116-
{' · '}
117-
{formatSessionUnits(premiumQuota.recentCount)} of{' '}
118-
{premiumQuota.limit} premium sessions used today
119-
</span>
120-
)}
121-
</text>
122115
{isStreaming ? (
123116
<text style={{ fg: theme.muted, wrapMode: 'word' }}>
124117
Agent is wrapping up. Rejoin the wait room after it's finished.
@@ -138,7 +131,7 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
138131
fg:
139132
pendingAction === 'same-chat'
140133
? theme.muted
141-
: theme.primary,
134+
: theme.foreground,
142135
}}
143136
attributes={TextAttributes.BOLD}
144137
>
@@ -167,11 +160,14 @@ export const SessionEndedBanner: React.FC<SessionEndedBannerProps> = ({
167160
? theme.muted
168161
: theme.foreground,
169162
}}
170-
attributes={TextAttributes.BOLD}
171163
>
172-
{pendingAction === 'waiting-room'
173-
? 'Opening model selection…'
174-
: 'Change model (ESC)'}
164+
{pendingAction === 'waiting-room' ? (
165+
'Opening model selection…'
166+
) : (
167+
<>
168+
Change model<span fg={theme.muted}>{' Esc'}</span>
169+
</>
170+
)}
175171
</text>
176172
</Button>
177173
</box>

0 commit comments

Comments
 (0)