mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-06 08:24:46 +00:00
feat(app): archive a workspace from its sidebar row and undo it
Hovering a workspace row on desktop shows an archive button next to the row menu. Archiving shows a toast with Undo and a Cmd/Ctrl+Z shortcut so a mis-click costs one keystroke instead of a trip through History. The daemon serializes archive and undo per workspace across every connection. An undo that lands while an archive is still tearing down aborts it at the next checkpoint and restores only the agents that archive took down; deleting the worktree directory is the point of no return, after which undo recreates the worktree.
This commit is contained in:
@@ -3628,6 +3628,23 @@ export class DaemonClient {
|
||||
}
|
||||
}
|
||||
|
||||
/** Rejects when the host could not put the workspace back; an old host has no such RPC. */
|
||||
async undoWorkspaceArchive(workspaceId: string, requestId?: string): Promise<void> {
|
||||
const payload =
|
||||
await this.sendNamespacedCorrelatedSessionRequest<"workspace.archive.undo.response">({
|
||||
requestId,
|
||||
message: {
|
||||
type: "workspace.archive.undo.request",
|
||||
workspaceId,
|
||||
},
|
||||
// Undoing a finished worktree archive recreates the worktree, like recovery does.
|
||||
timeout: 150_000,
|
||||
});
|
||||
if (!payload.accepted) {
|
||||
throw new Error(payload.error ?? "The host could not undo the workspace archive");
|
||||
}
|
||||
}
|
||||
|
||||
async resumeAgent(
|
||||
handle: AgentPersistenceHandle,
|
||||
overrides?: Partial<AgentSessionConfig>,
|
||||
|
||||
Reference in New Issue
Block a user