import { Disposable } from "../../base/common/lifecycle.js"; import { ThemeIcon } from "../../base/common/themables.js"; import { URI } from "../../base/common/uri.js"; import { IAccessibilityService } from "../../platform/accessibility/common/accessibility.service.js"; import { SessionStatus } from "../services/sessions/common/session.js"; import { ISessionsListModelService } from "../services/sessions/browser/sessionsListModelService.service.js"; /** * Renders a session's status indicator into a host-provided container and keeps it * up to date. In-progress sessions get the animated pixel spinner when motion is * allowed; other states render the codicon from * {@link ISessionsListModelService.getStatusIcon}. * * The widget owns all rendering concerns so every surface (sessions list, session * header, …) stays in sync by simply hosting it: * - caches the current glyph/variant so re-renders only rebuild the DOM when it * changes (keeping the spinner animation from restarting), * - cross-fades between glyphs/variants, * - re-renders automatically when the reduced-motion preference changes. * * Call {@link setStatus} on every status/read/archive change. Reusable hosts pass * the session resource so rebinding snaps instead of cross-fading stale content. */ export declare class SessionStatusIcon extends Disposable { private readonly _container; private readonly _accessibilityService; private readonly _sessionsListModelService; private _currentCacheKey; private _currentSessionResource; private _lastInputs; /** Owns the removal timers for outgoing icons mid cross-fade. */ private readonly _swapStore; private readonly _iconDisposables; constructor(_container: HTMLElement, _accessibilityService: IAccessibilityService, _sessionsListModelService: ISessionsListModelService); /** * Updates the rendered status. Cross-fades when the glyph/variant changes * within one session; a different session resource snaps to the new icon. */ setStatus(status: SessionStatus, isRead: boolean, isArchived: boolean, completedStateIcon?: ThemeIcon, sessionResource?: URI): void; /** * Clears the cached glyph so the next {@link setStatus} renders without a * cross-fade. Use when the host is rebound to a different session. */ reset(): void; private _render; /** Updates the color of the current (non fading-out) icon without rebuilding it. */ private _recolorActiveIcon; /** * Swaps the container contents to `newChild` with a brief opacity cross-fade. * Outgoing children are taken out of normal flow (`position: absolute`) so the * new child can settle into its slot during the fade. Safe to call repeatedly: * each outgoing element is marked so a follow-up swap never re-processes it. */ private _swapIcon; }