/** * Progress Throttle Helper * * Byte-level download/sync progress callbacks fire on EVERY network chunk * (16-64 KB) with no throttle. The progress objects live in App.tsx state, so * each chunk re-rendered the whole AppContent tree, rebuilt every context * value, and — because progress is a dep of WorkflowContext — re-rendered the * active view and all mounted dialogs. With concurrency 2 that's two * interleaved per-chunk streams. * * This pure helper decides at the dispatch site whether a progress event is * worth a React state update, capping forwarding at ~10fps while always * letting identity/status transitions and the 100% edge through immediately. * * @since Phase 6 (2026-06) — TUI correctness batch */ /** Minimum interval between forwarded same-item, same-status events (~10fps). */ export declare const PROGRESS_THROTTLE_MS = 100; /** The fields the throttle decision needs, mapped from any progress shape. */ export interface ThrottledProgressEvent { /** Identity of the work item (e.g. plugin name) — a change always forwards. */ itemKey: string; /** Status/phase/action — a change always forwards. */ statusKey: string; /** Progress percent (0-100) for the current item+status. */ percent: number; } /** Snapshot of the last FORWARDED event (store in a ref at the dispatch site). */ export interface ProgressThrottleState extends ThrottledProgressEvent { /** Timestamp (ms) when the event was forwarded. */ at: number; } /** * Decide whether a progress event should be forwarded to React state. * * Rules: * - First event always forwards. * - Item or status change always forwards (start/verify/done/error edges must * never be dropped). * - Reaching 100% always forwards (the bar must land full). * - Backward percent within the same item+status is dropped (visual flicker — * preserves the pre-existing backward-jump suppression). * - Otherwise forwards only if PROGRESS_THROTTLE_MS elapsed since the last * forwarded event. */ export declare function shouldForwardProgress(last: ProgressThrottleState | null, event: ThrottledProgressEvent, now: number): boolean; /** Build the ref snapshot for a just-forwarded event. */ export declare function toThrottleState(event: ThrottledProgressEvent, now: number): ProgressThrottleState; //# sourceMappingURL=progress-throttle.d.ts.map