import { Disposable } from "../../../../../base/common/lifecycle.js"; import { URI } from "../../../../../base/common/uri.js"; import { IHoverService } from "../../../../../platform/hover/browser/hover.service.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { IOpenerService } from "../../../../../platform/opener/common/opener.service.js"; import { PromptsType } from "../../common/promptSyntax/promptTypes.js"; import { PromptsStorage } from "../../common/promptSyntax/service/promptsService.js"; import { CustomizationMigrationCategoryId } from "./customizationMigrationCategories.js"; export interface ICustomizationMigrationDashboardItem { readonly id: string; readonly label: string; readonly scopeLabel: string; readonly sourceLabel: string; readonly changesLabel?: string; readonly manualReviewReason?: string; readonly resource?: URI; readonly promptType?: PromptsType; readonly mcpServerId?: string; readonly candidateKey?: string; readonly selected?: boolean; readonly extensionId?: string; } export interface ICustomizationMigrationDashboardDestination { readonly targetType: PromptsType; readonly storage: PromptsStorage; readonly contextLabel: string; readonly label: string; readonly ariaLabel: string; } export interface ICustomizationMigrationDashboardCategory { readonly id: CustomizationMigrationCategoryId; readonly label: string; readonly description: string; readonly count: number; readonly countLabel: string; readonly highRisk?: boolean; readonly migrationInProgress?: boolean; readonly migrateDisabled?: boolean; readonly selectedCount?: number; readonly destinationLabel?: string; readonly destinationAriaLabel?: string; readonly actionLabel?: string; readonly learnMoreUrl?: string; readonly items: readonly ICustomizationMigrationDashboardItem[]; } export interface ICustomizationMigrationDashboardScope { readonly storage: PromptsStorage; readonly label: string; readonly count: number; readonly hasConfigurableDestinations: boolean; readonly categories: readonly ICustomizationMigrationDashboardCategory[]; } export interface ICustomizationMigrationDashboardOverview { readonly scopes: readonly ICustomizationMigrationDashboardScope[]; readonly manualReviewItems?: readonly (ICustomizationMigrationDashboardItem & { readonly storage: PromptsStorage; })[]; readonly recoveries?: readonly ICustomizationMigrationDashboardRecovery[]; readonly categoryErrors?: readonly ICustomizationMigrationDashboardCategoryError[]; readonly hasIgnoredGroups?: boolean; readonly supportsAgentMigration?: boolean; readonly migrationInProgress?: boolean; } export interface ICustomizationMigrationDashboardRecovery { readonly id: string; readonly label: string; readonly description: string; readonly canModify: boolean; } export interface ICustomizationMigrationDashboardCategoryError { readonly id: CustomizationMigrationCategoryId; readonly label: string; readonly description: string; } export interface ICustomizationMigrationDashboardCallbacks { readonly actionClicked: (action: "retryClicked" | "destinationsClicked" | "migrationCategoryClicked" | "agentMigrationClicked", categoryId?: CustomizationMigrationCategoryId) => void; readonly configureLocations: (id: CustomizationMigrationCategoryId, storage: PromptsStorage) => void; readonly migrateWithAgent: () => void; readonly migrateCategory: (id: CustomizationMigrationCategoryId, storage: PromptsStorage) => void; readonly setItemSelected: (item: ICustomizationMigrationDashboardItem, selected: boolean) => void; readonly showItemActions: (item: ICustomizationMigrationDashboardItem, storage: PromptsStorage, anchor: HTMLElement) => void; readonly ignoreCategory: (id: CustomizationMigrationCategoryId, storage: PromptsStorage) => void; readonly restoreIgnoredCategories: () => void; readonly restoreAgentMigration: (recovery: ICustomizationMigrationDashboardRecovery) => void; readonly deleteAgentMigrationRecovery: (recovery: ICustomizationMigrationDashboardRecovery) => void; readonly retryCategory: (id: CustomizationMigrationCategoryId) => void; readonly openCustomization: (item: ICustomizationMigrationDashboardItem, storage: PromptsStorage) => void; readonly openGuidanceSource: (item: ICustomizationMigrationDashboardItem) => void; readonly onDidChangeContent?: () => void; } interface IMigrationItemEntry extends ICustomizationMigrationDashboardItem { readonly type: "migration-item"; readonly categoryId: CustomizationMigrationCategoryId; readonly storage: PromptsStorage; readonly groupKey: string; readonly readOnly?: boolean; readonly learnMoreUrl?: string; selected: boolean; } export declare class CustomizationMigrationDashboard extends Disposable { private readonly callbacks; private readonly hoverService; private readonly instantiationService; private readonly openerService; readonly element: HTMLElement; private readonly renderDisposables; private readonly focusTargets; private readonly collapsedMigrationGroups; private readonly migrationGroups; private readonly migrateButtons; private pendingFocus; private pendingTreeFocus; private guidanceDetail; private lastOverview; private allMigrationsComplete; private layoutTree; private availableHeight; constructor(parent: HTMLElement, callbacks: ICustomizationMigrationDashboardCallbacks, hoverService: IHoverService, instantiationService: IInstantiationService, openerService: IOpenerService); showLoading(title: string, description: string, retry?: () => void): void; showOverview(overview: ICustomizationMigrationDashboardOverview): void; /** * Shows a read-only guidance item with the same header, back affordance and migration warning card * as the other customization migration details. */ showGuidanceDetail(item: IMigrationItemEntry, focus?: boolean): void; getGuidanceDetailAccessibilityContent(): string | undefined; private getGuidanceDetailContent; private closeGuidanceDetail; /** Returns the refreshed guidance item that is open in the detail, if the refreshed overview still contains it. */ private findGuidanceItem; private renderCategoryErrors; /** * Sizes the migration tree to the space left below the sticky page header so that the tree owns * its own scrolling, matching the other customization pages. */ layout(height: number): void; focus(): void; focusDestination(storage: PromptsStorage): void; /** * Resolves the matching focus target that appears first in the rendered document, * because tree rows are virtualized and may be registered out of visual order. */ private findFirstTarget; private prepareRender; private getFocusedKey; private renderHeader; private renderRecoveries; private getMigrationGroups; private renderMigrationWarnings; /** Renders the migration tree and returns a function that moves keyboard focus to a rendered item. */ private renderMigrationTree; private getMigrationGroupIcon; private renderMigrationGroupActions; private renderMigrationGroupDescription; private migrateMigrationGroup; private openMigrationItem; private setMigrationItemSelected; private updateMigrateButton; private button; private hover; } export {};