77 DEFAULT_FREEBUFF_MODEL_ID ,
88 FALLBACK_FREEBUFF_MODEL_ID ,
99 FREEBUFF_MODELS ,
10- FREEBUFF_PREMIUM_SESSION_LIMIT ,
1110 getFreebuffDeploymentAvailabilityLabel ,
1211 isFreebuffModelAvailable ,
1312 isFreebuffPremiumModelId ,
@@ -39,11 +38,12 @@ const FREEBUFF_MODEL_SELECTOR_MODEL_IDS = FREEBUFF_MODEL_SELECTOR_MODELS.map(
3938 ( model ) => model . id ,
4039)
4140
42- // Section grouping: premium models share one quota pool (header carries the
43- // 0/5 counter); the unlimited model has none. Putting the tier on a section
44- // header lets each row drop its redundant "Premium"/"Unlimited" chip. Empty
45- // sections are filtered out so a model set with no premium (or no unlimited)
46- // entries doesn't render an orphan header.
41+ // Section grouping: premium models share one quota pool, unlimited has none.
42+ // Putting the tier on a section header lets each row drop its redundant
43+ // "Premium"/"Unlimited" chip. The shared 0/5 counter lives in the page title
44+ // (rendered by the parent), not the section header — this picker is purely a
45+ // list of choices grouped by tier. Empty sections are filtered so a model set
46+ // with no premium (or no unlimited) entries doesn't render an orphan header.
4747type Section = {
4848 key : 'premium' | 'unlimited'
4949 label : string
@@ -69,10 +69,6 @@ const SECTIONS: readonly Section[] = (
6969 ] satisfies readonly Section [ ]
7070) . filter ( ( section ) => section . models . length > 0 )
7171
72- function formatSessionUnits ( units : number ) : string {
73- return Number . isInteger ( units ) ? String ( units ) : units . toFixed ( 1 )
74- }
75-
7672/**
7773 * Dual-purpose model picker:
7874 * - Pre-chat landing (session 'none'): user hasn't joined any queue. Picking
@@ -136,18 +132,6 @@ export const FreebuffModelSelector: React.FC = () => {
136132 ? session . rateLimitsByModel
137133 : undefined
138134
139- // All premium models share one quota pool: the server replicates the same
140- // snapshot under each premium model id, so any entry has the right count.
141- // Grab the first one (or 0 when the user has no usage and the map is
142- // absent) so the section header can render the single shared counter.
143- const sharedPremiumUsed = useMemo (
144- ( ) =>
145- rateLimitsByModel
146- ? ( Object . values ( rateLimitsByModel ) [ 0 ] ?. recentCount ?? 0 )
147- : 0 ,
148- [ rateLimitsByModel ] ,
149- )
150-
151135 const BUTTON_CHROME = 4 // 2 border + 2 padding
152136 const NAME_GAP = 2 // spaces between name column and details column
153137
@@ -366,11 +350,6 @@ export const FreebuffModelSelector: React.FC = () => {
366350 )
367351 }
368352
369- // Counter goes amber-ish (theme.secondary) when the pool is exhausted so
370- // the limit reads as "you've hit it" rather than just another count.
371- const premiumExhausted = sharedPremiumUsed >= FREEBUFF_PREMIUM_SESSION_LIMIT
372- const counterColor = premiumExhausted ? theme . secondary : theme . muted
373-
374353 return (
375354 < box
376355 style = { {
@@ -389,16 +368,7 @@ export const FreebuffModelSelector: React.FC = () => {
389368 marginTop : sectionIdx === 0 ? 0 : 1 ,
390369 } }
391370 >
392- < text style = { { wrapMode : 'word' } } >
393- < span fg = { theme . muted } > { section . label } </ span >
394- { section . key === 'premium' && (
395- < span fg = { counterColor } >
396- { ' · ' }
397- { formatSessionUnits ( sharedPremiumUsed ) } /{ ' ' }
398- { FREEBUFF_PREMIUM_SESSION_LIMIT } used today
399- </ span >
400- ) }
401- </ text >
371+ < text style = { { fg : theme . muted } } > { section . label } </ text >
402372 { section . models . map ( renderModelButton ) }
403373 </ box >
404374 ) ) }
0 commit comments