Class: PersistenceUiController
Defined in: application/services/persistence/persistence-ui-controller.ts:83
Framework-independent controller for a storage settings UI. It registers all built-in providers (Google Drive, local files, Tauri local, S3) from env, tracks the active provider, connection status and snapshot list, and exposes the state through PersistenceUiController.getViewModel. Action methods do not throw; failures are reported in the view model status.
Constructors
Constructor
new PersistenceUiController(config): PersistenceUiController;Defined in: application/services/persistence/persistence-ui-controller.ts:99
Creates the controller and registers the built-in providers. Call PersistenceUiController.initialize afterwards to restore a previous session.
Parameters
| Parameter | Type |
|---|---|
config | PersistenceUiControllerConfig |
Returns
PersistenceUiController
Methods
connectProvider()
connectProvider(): Promise<void>;Defined in: application/services/persistence/persistence-ui-controller.ts:265
Connects the active provider with the entered S3 fields (local files always opens the folder picker), then refreshes the snapshot list.
Returns
Promise<void>
copyBackupsFrom()
copyBackupsFrom(fromProviderId): Promise<boolean>;Defined in: application/services/persistence/persistence-ui-controller.ts:370
Parameters
| Parameter | Type |
|---|---|
fromProviderId | string |
Returns
Promise<boolean>
disconnectProvider()
disconnectProvider(): void;Defined in: application/services/persistence/persistence-ui-controller.ts:473
Disconnects the active provider and clears the snapshot list and selection.
Returns
void
getViewModel()
getViewModel(): PersistenceUiControllerViewModel;Defined in: application/services/persistence/persistence-ui-controller.ts:204
Returns a fresh view model for the current state.
Returns
PersistenceUiControllerViewModel
initialize()
initialize(): Promise<void>;Defined in: application/services/persistence/persistence-ui-controller.ts:225
Activates the configured provider and tries to restore its previous session.
Returns
Promise<void>
loadWorkspaceSnapshot()
loadWorkspaceSnapshot(): Promise<void>;Defined in: application/services/persistence/persistence-ui-controller.ts:430
Loads the selected snapshot (or the latest one), passes its workspace to hydrateWorkspaceSnapshot, then calls beforeWorkspaceHydrate and loadPersistedData.
Returns
Promise<void>
refreshSnapshots()
refreshSnapshots(): Promise<void>;Defined in: application/services/persistence/persistence-ui-controller.ts:456
Reloads the snapshot list from the active provider and clears the selection if the selected snapshot no longer exists.
Returns
Promise<void>
runLocalFsDiagnostics()
runLocalFsDiagnostics(): void;Defined in: application/services/persistence/persistence-ui-controller.ts:299
Writes File System Access API diagnostics (secure context, picker availability, embedding, user agent) to the status message.
Returns
void
saveWorkspaceSnapshot()
saveWorkspaceSnapshot(kind?): Promise<boolean>;Defined in: application/services/persistence/persistence-ui-controller.ts:340
Parameters
| Parameter | Type | Default value |
|---|---|---|
kind? | SnapshotKind | 'manual' |
Returns
Promise<boolean>
selectStorageDirectory()
selectStorageDirectory(): Promise<void>;Defined in: application/services/persistence/persistence-ui-controller.ts:286
Opens the folder picker for the active provider and refreshes the snapshot list. Intended for the local files provider.
Returns
Promise<void>
setActiveProviderId()
setActiveProviderId(providerId): void;Defined in: application/services/persistence/persistence-ui-controller.ts:236
Switches the active provider, clears the snapshot list and selection, and tries to restore a session in the background. Ignores an empty id.
Parameters
| Parameter | Type |
|---|---|
providerId | string |
Returns
void
Throws
Error when the provider id is not registered.
setS3Credentials()
setS3Credentials(partial): void;Defined in: application/services/persistence/persistence-ui-controller.ts:257
Merges S3 connection fields used by the next PersistenceUiController.connectProvider call.
Parameters
| Parameter | Type |
|---|---|
partial | Partial<S3ConnectOptions> |
Returns
void
setSelectedSnapshotId()
setSelectedSnapshotId(snapshotId): void;Defined in: application/services/persistence/persistence-ui-controller.ts:252
Sets the snapshot to load with PersistenceUiController.loadWorkspaceSnapshot. An empty value means the latest one.
Parameters
| Parameter | Type |
|---|---|
snapshotId | string |
Returns
void