Skip to content

Commit ffad8ba

Browse files
committed
Add waiting room ad spacer
1 parent 0202046 commit ffad8ba

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

cli/src/components/choice-ad-banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ChoiceAdBannerProps {
1414
onImpression?: (impUrl: string) => void
1515
}
1616

17-
const CARD_HEIGHT = 5 // border-top + 2 lines description + spacer + cta row + border-bottom
17+
export const CHOICE_AD_BANNER_HEIGHT = 5 // border-top + 2 lines description + spacer + cta row + border-bottom
1818
const MAX_DESC_LINES = 2
1919
const MIN_CARD_WIDTH = 60 // Minimum width per ad card to remain readable
2020

@@ -121,7 +121,7 @@ export const ChoiceAdBanner: React.FC<ChoiceAdBannerProps> = ({ ads, onImpressio
121121
onMouseOut={() => setHoveredIndex(null)}
122122
style={{
123123
width: widths[i],
124-
height: CARD_HEIGHT,
124+
height: CHOICE_AD_BANNER_HEIGHT,
125125
borderStyle: 'single',
126126
borderColor: isHovered ? hoverBorderColor : theme.muted,
127127
customBorderChars: BORDER_CHARS,

cli/src/components/waiting-room-screen.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { useRenderer } from '@opentui/react'
33
import React, { useMemo, useState } from 'react'
44

55
import { Button } from './button'
6-
import { ChoiceAdBanner } from './choice-ad-banner'
6+
import {
7+
ChoiceAdBanner,
8+
CHOICE_AD_BANNER_HEIGHT,
9+
} from './choice-ad-banner'
710
import { FreebuffModelSelector } from './freebuff-model-selector'
811
import { ShimmerText } from './shimmer-text'
912
import { useFreebuffCtrlCExit } from '../hooks/use-freebuff-ctrl-c-exit'
@@ -368,19 +371,21 @@ export const WaitingRoomScreen: React.FC<WaitingRoomScreenProps> = ({
368371
</box>
369372
</box>
370373

371-
{/* Ad banner pinned to the bottom, same look-and-feel as in chat. */}
372-
{ads && (
373-
<box style={{ flexShrink: 0 }}>
374+
{/* Reserve the ad banner slot before the async ad fetch resolves so the
375+
waiting-room content does not jump when the banner fills. */}
376+
<box
377+
style={{
378+
width: '100%',
379+
flexShrink: 0,
380+
height: CHOICE_AD_BANNER_HEIGHT,
381+
}}
382+
>
383+
{ads ? (
374384
<ChoiceAdBanner ads={ads} onImpression={recordImpression} />
375-
</box>
376-
)}
377-
378-
{/* Horizontal separator (mirrors chat input divider style) */}
379-
{!ads && (
380-
<text style={{ fg: theme.muted, flexShrink: 0 }}>
381-
{'─'.repeat(terminalWidth)}
382-
</text>
383-
)}
385+
) : (
386+
<text style={{ fg: theme.muted }}>{'─'.repeat(terminalWidth)}</text>
387+
)}
388+
</box>
384389
</box>
385390
)
386391
}

0 commit comments

Comments
 (0)