@@ -126,9 +126,10 @@ export function FloatingWorkingControl(props: {
126126 return null ;
127127 }
128128
129- // Only the connection label is a button (tap to reconnect); the others
130- // pass touches through to the feed like before.
131- const statusInteractive = props . status ?. kind === "connection" ;
129+ // The connection label is a button (tap to reconnect) and the background
130+ // label carries a Stop button; the others pass touches through to the feed.
131+ const statusInteractive =
132+ props . status ?. kind === "connection" || props . status ?. kind === "background" ;
132133 const capsuleInteractive = statusInteractive || props . devicePreview !== null ;
133134 // The host stays centered on the capsule, but its measurement constraint
134135 // comes from the overlay, independent of the capsule's current width.
@@ -137,7 +138,7 @@ export function FloatingWorkingControl(props: {
137138 < DevicePreviewButton { ...props . devicePreview } compact = { false } />
138139 ) : props . status !== null ? (
139140 < >
140- < Animated . View className = "h-11" style = { capsuleSizerStyle } />
141+ < Animated . View pointerEvents = "none" className = "h-11" style = { capsuleSizerStyle } />
141142 < View
142143 pointerEvents = { statusInteractive ? "box-none" : "none" }
143144 className = "absolute h-11 items-center justify-center"
@@ -147,7 +148,9 @@ export function FloatingWorkingControl(props: {
147148 key = {
148149 props . status . kind === "working" || props . status . kind === "compacting"
149150 ? props . status . kind
150- : `${ props . status . kind } :${ props . status . label } `
151+ : props . status . kind === "background"
152+ ? `background:${ props . status . liveness } `
153+ : `${ props . status . kind } :${ props . status . label } `
151154 }
152155 status = { props . status }
153156 onLayout = { handleLabelLayout }
@@ -295,6 +298,9 @@ function FloatingStatusLabel(props: {
295298 if ( props . status . kind === "compacting" ) {
296299 return < CompactingLabel key = "compacting" onLayout = { props . onLayout } /> ;
297300 }
301+ if ( props . status . kind === "background" ) {
302+ return < BackgroundWorkLabel key = "background" status = { props . status } onLayout = { props . onLayout } /> ;
303+ }
298304 if ( props . status . kind === "connection" ) {
299305 return (
300306 < StatusLabelRow
@@ -385,6 +391,55 @@ function StatusLabelRow(props: {
385391 ) ;
386392}
387393
394+ // Stop is its own button inside the row rather than the whole pill, so a
395+ // stray tap on the label cannot end background work. Everything but Stop
396+ // passes touches through to the feed, like the non-interactive labels.
397+ function BackgroundWorkLabel ( props : {
398+ readonly status : Extract < FloatingWorkingStatus , { kind : "background" } > ;
399+ readonly onLayout : ( event : LayoutChangeEvent ) => void ;
400+ } ) {
401+ const label = props . status . liveness === "monitoring" ? "Monitoring" : "Working" ;
402+ return (
403+ < Animated . View
404+ pointerEvents = "box-none"
405+ className = "absolute max-w-full"
406+ entering = { LABEL_ENTERING }
407+ exiting = { LABEL_EXITING }
408+ onLayout = { props . onLayout }
409+ >
410+ < View pointerEvents = "box-none" className = "h-11 flex-row items-center pl-4" >
411+ < View
412+ pointerEvents = "none"
413+ accessible
414+ accessibilityLabel = { label }
415+ className = "flex-row items-center gap-2"
416+ >
417+ { /* Monitoring is a calm watch state, matching the web banner (no pulse). */ }
418+ { props . status . liveness === "working" ? (
419+ < ActivityIndicator size = "small" colorClassName = "accent-icon-muted" />
420+ ) : null }
421+ < Text className = "font-t3-medium text-xs text-foreground" numberOfLines = { 1 } >
422+ { label }
423+ </ Text >
424+ </ View >
425+ < View pointerEvents = "none" className = "ml-3 h-4 w-px bg-border" />
426+ < Pressable
427+ accessibilityLabel = { props . status . stopping ? "Stopping" : "Stop background work" }
428+ accessibilityRole = "button"
429+ accessibilityState = { { disabled : props . status . stopping } }
430+ className = "h-11 justify-center pl-3 pr-4 active:opacity-70"
431+ disabled = { props . status . stopping }
432+ onPress = { props . status . onStop }
433+ >
434+ < Text className = "font-t3-medium text-xs text-danger-foreground" >
435+ { props . status . stopping ? "Stopping…" : "Stop" }
436+ </ Text >
437+ </ Pressable >
438+ </ View >
439+ </ Animated . View >
440+ ) ;
441+ }
442+
388443function WorkingDuration ( props : {
389444 readonly startedAt : string ;
390445 readonly onLayout : ( event : LayoutChangeEvent ) => void ;
0 commit comments