import "./ExecutorStatusBar.css"; import { useEffect, useMemo, useRef, useState, type ReactNode } from "react"; import { createPortal } from "react-dom"; import type { TFunction } from "i18next"; import { useTranslation } from "react-i18next"; import { HIGH_FANOUT_BLOCKER_TODO_THRESHOLD, STALE_HIGH_FANOUT_BLOCKER_AGE_THRESHOLD_MS, type Task, } from "@fusion/core"; import { AlertTriangle, Clock, Folder, MessageSquare, Pause, Play, Square, Zap } from "lucide-react"; import { computeBlockerFanoutMap } from "../hooks/useBlockerFanout"; import { useExecutorStats, type ExecutorColumnFlags } from "../hooks/useExecutorStats"; import { isLikelyTabSuspensionError } from "../hooks/visibilitySuspension"; import { LoadingSpinner } from "./LoadingSpinner"; import type { ExecutorState } from "../api"; import { EngineControlMenu, type EngineControlMenuHandle } from "./EngineControlMenu"; import { TerminalLauncher } from "./TerminalLauncher"; import { useViewportMode } from "../hooks/useViewportMode"; /* FNXC:StuckTagRemoval 2026-08-17-22:30: Operator removed stuck-task tagging from the dashboard; engine recovery sweeps still consume taskStuckTimeoutMs server-side. The footer no longer renders a Stuck segment or takes taskStuckTimeoutMs. */ type FooterStatId = "queued" | "running" | "blocked" | "fanout"; interface OpenStatTooltip { id: FooterStatId; label: string; rect: DOMRect; } interface MobileStatSegmentProps { className?: string; id: FooterStatId; isMobile: boolean; isOpen: boolean; label: string; onToggle: (id: FooterStatId, label: string, rect: DOMRect) => void; children: ReactNode; } function MobileStatSegment({ className = "", id, isMobile, isOpen, label, onToggle, children }: MobileStatSegmentProps) { const segmentClassName = `executor-status-bar__segment executor-status-bar__segment--stat ${className}`.trim(); if (!isMobile) return