@@ -69,6 +69,7 @@ export const FLOATING_WORKING_CONTROL_COVERAGE = CONTROL_OVERLAY_OFFSET + CONTRO
6969export function FloatingWorkingControl ( props : {
7070 readonly colorScheme : "light" | "dark" ;
7171 readonly status : FloatingWorkingStatus | null ;
72+ readonly extensionStatus ?: { readonly label : string ; readonly onPress : ( ) => void } | null ;
7273 readonly devicePreview : { readonly count : number ; readonly onPress : ( ) => void } | null ;
7374 readonly browserPreview : { readonly count : number ; readonly onPress : ( ) => void } | null ;
7475 readonly showScrollToEnd : boolean ;
@@ -84,6 +85,10 @@ export function FloatingWorkingControl(props: {
8485 const [ overlayWidth , setOverlayWidth ] = useState ( windowWidth ) ;
8586 const [ queueWidth , setQueueWidth ] = useState ( 0 ) ;
8687 const [ actionWidth , setActionWidth ] = useState ( 0 ) ;
88+ const [ extensionWidth , setExtensionWidth ] = useState ( 0 ) ;
89+ const extensionStatus = props . extensionStatus ?? null ;
90+ const extensionOnly = props . status ?. kind === "extension" ;
91+ const useGlass = NATIVE_LIQUID_GLASS_SUPPORTED && ! extensionOnly ;
8792 const action =
8893 props . status ?. kind === "background" ||
8994 props . status ?. kind === "lifecycle" ||
@@ -96,7 +101,7 @@ export function FloatingWorkingControl(props: {
96101 const [ previewWidth , setPreviewWidth ] = useState ( 0 ) ;
97102 const agents = props . agents ;
98103 const hasAgents = agents !== null ;
99- const labelWidth = Math . max (
104+ const availableLabelWidth = Math . max (
100105 0 ,
101106 Math . min ( overlayWidth , windowWidth ) -
102107 CONTROL_HEIGHT -
@@ -106,6 +111,10 @@ export function FloatingWorkingControl(props: {
106111 ( hasAgents ? agentsWidth : 0 ) -
107112 ( hasPreview ? previewWidth : 0 ) ,
108113 ) ;
114+ const labelWidth = Math . max (
115+ 0 ,
116+ availableLabelWidth - ( extensionStatus === null ? 0 : extensionWidth ) ,
117+ ) ;
109118 const separationProgress = useSharedValue ( props . showScrollToEnd ? 1 : 0 ) ;
110119
111120 // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- animates the Reanimated separation value when scroll-to-end visibility changes
@@ -163,10 +172,16 @@ export function FloatingWorkingControl(props: {
163172 ( props . devicePreview !== null && props . browserPreview !== null ) ;
164173 const statusInteractive =
165174 props . status ?. kind === "connection" ||
175+ props . status ?. kind === "extension" ||
166176 props . status ?. kind === "child-input" ||
167177 props . status ?. kind === "background" ;
168178 const capsuleInteractive =
169- statusInteractive || action !== null || hasQueue || hasAgents || hasPreview ;
179+ statusInteractive ||
180+ extensionStatus !== null ||
181+ action !== null ||
182+ hasQueue ||
183+ hasAgents ||
184+ hasPreview ;
170185 const statusContent =
171186 props . status !== null ? (
172187 < View
@@ -181,7 +196,9 @@ export function FloatingWorkingControl(props: {
181196 >
182197 < FloatingStatusLabel
183198 key = {
184- props . status . kind === "working" || props . status . kind === "compacting"
199+ props . status . kind === "working" ||
200+ props . status . kind === "compacting" ||
201+ props . status . kind === "extension"
185202 ? props . status . kind
186203 : `${ props . status . kind } :${ props . status . label } `
187204 }
@@ -195,6 +212,22 @@ export function FloatingWorkingControl(props: {
195212 const capsuleContent = (
196213 < View className = "flex-row items-center" >
197214 { statusContent }
215+ { extensionStatus !== null ? (
216+ < Pressable
217+ accessibilityRole = "button"
218+ accessibilityLabel = { extensionStatus . label }
219+ accessibilityHint = "Shows the full Pi status"
220+ onPress = { extensionStatus . onPress }
221+ onLayout = { ( event ) => setExtensionWidth ( settleWidth ( event . nativeEvent . layout . width ) ) }
222+ style = { { maxWidth : availableLabelWidth * 0.5 } }
223+ className = "h-11 flex-row items-center px-3 active:opacity-70"
224+ >
225+ { hasStatus ? < View className = "absolute left-0 h-4 w-px bg-border" /> : null }
226+ < Text className = "shrink font-t3-medium text-xs text-foreground" numberOfLines = { 1 } >
227+ { extensionStatus . label }
228+ </ Text >
229+ </ Pressable >
230+ ) : null }
198231 { action !== null ? (
199232 < View
200233 onLayout = { ( event ) => setActionWidth ( settleWidth ( event . nativeEvent . layout . width ) ) }
@@ -273,10 +306,10 @@ export function FloatingWorkingControl(props: {
273306 className = "absolute left-0 right-0 z-20 items-center"
274307 style = { [ { top : - CONTROL_OVERLAY_OFFSET } , liftStyle ] }
275308 onLayout = { ( event ) => setOverlayWidth ( event . nativeEvent . layout . width ) }
276- entering = { NATIVE_LIQUID_GLASS_SUPPORTED || reducedMotion ? undefined : CONTROL_ENTERING }
277- exiting = { NATIVE_LIQUID_GLASS_SUPPORTED || reducedMotion ? undefined : CONTROL_EXITING }
309+ entering = { useGlass || extensionOnly || reducedMotion ? undefined : CONTROL_ENTERING }
310+ exiting = { useGlass || extensionOnly || reducedMotion ? undefined : CONTROL_EXITING }
278311 >
279- { hasCapsule && NATIVE_LIQUID_GLASS_SUPPORTED ? (
312+ { hasCapsule && useGlass ? (
280313 < UniwindGlassContainer
281314 spacing = { GLASS_MERGE_SPACING }
282315 pointerEvents = "box-none"
@@ -374,6 +407,23 @@ function FloatingStatusLabel(props: {
374407 readonly status : FloatingWorkingStatus ;
375408 readonly onLayout : ( event : LayoutChangeEvent ) => void ;
376409} ) {
410+ if ( props . status . kind === "extension" ) {
411+ return (
412+ < StatusLabelRow
413+ accessibilityLabel = { props . status . label }
414+ accessibilityRole = "button"
415+ onPress = { props . status . onPress }
416+ onLayout = { props . onLayout }
417+ className = "gap-1.5"
418+ animated = { false }
419+ >
420+ < Text className = "shrink font-t3-medium text-xs text-foreground" numberOfLines = { 1 } >
421+ { props . status . label }
422+ </ Text >
423+ < SymbolView name = "chevron.down" size = { 10 } tintColorClassName = "accent-foreground" />
424+ </ StatusLabelRow >
425+ ) ;
426+ }
377427 if ( props . status . kind === "syncing" ) {
378428 return (
379429 < StatusLabelRow
@@ -546,6 +596,7 @@ function FloatingStatusLabel(props: {
546596}
547597
548598function StatusLabelRow ( props : {
599+ readonly animated ?: boolean ;
549600 readonly accessibilityLabel ?: string ;
550601 readonly accessibilityRole ?: "button" ;
551602 readonly className ?: string ;
@@ -558,8 +609,8 @@ function StatusLabelRow(props: {
558609 return (
559610 < Animated . View
560611 className = "absolute max-w-full"
561- entering = { reducedMotion ? undefined : LABEL_ENTERING }
562- exiting = { reducedMotion ? undefined : LABEL_EXITING }
612+ entering = { props . animated === false || reducedMotion ? undefined : LABEL_ENTERING }
613+ exiting = { props . animated === false || reducedMotion ? undefined : LABEL_EXITING }
563614 onLayout = { props . onLayout }
564615 >
565616 { props . onPress ? (
0 commit comments