import { Disposable } from "../../../../../base/common/lifecycle.js"; import { Event } from "../../../../../base/common/event.js"; import { URI } from "../../../../../base/common/uri.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { ISessionsService } from "../../../../services/sessions/browser/sessionsService.service.js"; import { ISessionFileChange } from "../../../../services/sessions/common/session.js"; import { IFileDiffViewData } from "@codingame/monaco-vscode-chat-service-override/vscode/vs/sessions/browser/parts/mobile/contributions/mobileDiffView"; /** * Command id for opening the {@link MobileChangesView}. * * Takes no arguments. The view reads the active chat's changes from * {@link ISessionsService}. Phone-only. */ export declare const MOBILE_OPEN_CHANGES_VIEW_COMMAND_ID = "sessions.mobile.openChangesView"; /** * Visual change-type for a mobile changes-list row. */ type MobileChangeType = "added" | "modified" | "deleted"; /** * Normalised view-model for a single row in {@link MobileChangesView}. We * read the live `ISessionFileChange` observable on every render and reduce * each entry into this minimal shape so the row template stays pure DOM. */ interface IMobileChangesRow { readonly displayUri: URI; readonly originalUri: URI | undefined; readonly modifiedUri: URI | undefined; readonly changeType: MobileChangeType; readonly added: number; readonly removed: number; } /** * Callback invoked when the user taps a row. Receives the per-file * payload along with the full sibling list and the tapped index — these * are forwarded to the diff overlay so it can render prev/next chevrons. */ export type MobileChangesOpenHandler = (diff: IFileDiffViewData, siblings: readonly IFileDiffViewData[], index: number) => void; export declare function toRow(change: ISessionFileChange): IMobileChangesRow; export declare function rowToDiffData(row: IMobileChangesRow): IFileDiffViewData; /** * Full-screen overlay listing every file changed in the active session. * * Visually matches {@link MobileDiffView}: uses the same `mobile-overlay-*` * chrome (header with back button + title, scrollable body). Each row is * a tap target showing a themed file icon, filename, relative path, * change-type pill, and `+N -N` counters. * * Tapping a row invokes the supplied {@link MobileChangesOpenHandler} * with the row's diff payload along with the sibling list — used by the * diff overlay to support prev/next navigation. */ export declare class MobileChangesView extends Disposable { private readonly onOpen; private readonly sessionsService; private readonly _onDidDispose; /** * Fires when this view has been disposed (either externally or because * the user tapped Back). Used by the mobile overlay contribution to * clear its `MutableDisposable` slot so it doesn't * keep a stale reference around — preserving the "value === undefined * <=> no overlay open" invariant. */ readonly onDidDispose: Event; private readonly viewStore; /** * Disposables that belong to the rows currently rendered in the list. * `renderList` runs on every reactive change to the active session * (potentially many times per session) — each render registers * per-row gesture targets and click/tap listeners. We hold those in a * dedicated store and `clear()` it at the top of every render so the * disposable count and gesture-target list don't grow unbounded. */ private readonly rowsStore; private readonly listContainer; private readonly subtitleEl; private readonly emptyEl; constructor(workbenchContainer: HTMLElement, onOpen: MobileChangesOpenHandler, _instantiationService: IInstantiationService, sessionsService: ISessionsService); private renderList; private renderRow; dispose(): void; } /** * Opens a {@link MobileChangesView}. Returns the view instance — dispose * to close (the view also disposes itself when the user taps Back). */ export declare function openMobileChangesView(instantiationService: IInstantiationService, workbenchContainer: HTMLElement, onOpen: MobileChangesOpenHandler): MobileChangesView; export {};