@@ -213,7 +213,11 @@ import { PanelLayoutControls, RightPanelMaximizeControl } from "./chat/PanelLayo
213213import { type ExpandedImagePreview } from "./chat/ExpandedImagePreview" ;
214214import { NoActiveThreadState } from "./NoActiveThreadState" ;
215215import { resolveEffectiveEnvMode , resolveLocalCheckoutBranchMismatch } from "./BranchToolbar.logic" ;
216- import { ProviderStatusBanner } from "./chat/ProviderStatusBanner" ;
216+ import {
217+ getProviderStatusBannerKey ,
218+ ProviderStatusBanner ,
219+ shouldShowProviderStatusBanner ,
220+ } from "./chat/ProviderStatusBanner" ;
217221import { ThreadErrorBanner } from "./chat/ThreadErrorBanner" ;
218222import { ComposerBannerStack , type ComposerBannerStackItem } from "./chat/ComposerBannerStack" ;
219223import {
@@ -2320,11 +2324,22 @@ function ChatViewContent(props: ChatViewProps) {
23202324 const defaultInstanceId = defaultInstanceIdForDriver ( selectedProvider ) ;
23212325 return providerStatuses . find ( ( status ) => status . instanceId === defaultInstanceId ) ?? null ;
23222326 } , [ activeProviderInstanceId , providerStatuses , selectedProvider ] ) ;
2323- const hasTimelineTopBanner =
2324- Boolean ( threadError ) ||
2325- ( activeProviderStatus !== null &&
2326- activeProviderStatus . status !== "ready" &&
2327- activeProviderStatus . status !== "disabled" ) ;
2327+ const providerStatusBannerKey = getProviderStatusBannerKey ( activeProviderStatus ) ;
2328+ const [ dismissedProviderStatusBannerKey , setDismissedProviderStatusBannerKey ] = useState <
2329+ string | null
2330+ > ( null ) ;
2331+ useEffect ( ( ) => {
2332+ if ( providerStatusBannerKey === null && dismissedProviderStatusBannerKey !== null ) {
2333+ setDismissedProviderStatusBannerKey ( null ) ;
2334+ }
2335+ } , [ dismissedProviderStatusBannerKey , providerStatusBannerKey ] ) ;
2336+ const visibleProviderStatus = shouldShowProviderStatusBanner (
2337+ activeProviderStatus ,
2338+ dismissedProviderStatusBannerKey ,
2339+ )
2340+ ? activeProviderStatus
2341+ : null ;
2342+ const hasTimelineTopBanner = Boolean ( threadError ) || visibleProviderStatus !== null ;
23282343 const activeProjectCwd = activeProject ?. workspaceRoot ?? null ;
23292344 const activeThreadWorktreePath = activeThread ?. worktreePath ?? null ;
23302345 const activeWorkspaceRoot = activeThreadWorktreePath ?? activeProjectCwd ?? undefined ;
@@ -5463,7 +5478,10 @@ function ChatViewContent(props: ChatViewProps) {
54635478 < div className = "relative flex min-h-0 min-w-0 flex-1 flex-col" >
54645479 { /* Provider status overlays the timeline without changing its content height. */ }
54655480 < div className = "pointer-events-none absolute inset-x-0 top-0 z-20" >
5466- < ProviderStatusBanner status = { activeProviderStatus } />
5481+ < ProviderStatusBanner
5482+ status = { visibleProviderStatus }
5483+ onDismiss = { ( ) => setDismissedProviderStatusBannerKey ( providerStatusBannerKey ) }
5484+ />
54675485 </ div >
54685486 { /* Messages Wrapper */ }
54695487 < div className = "relative flex min-h-0 flex-1 flex-col" >
0 commit comments