diff --git a/src/renderer/src/components/cloud-workspaces/CloudWorkspacesStates.tsx b/src/renderer/src/components/cloud-workspaces/CloudWorkspacesStates.tsx index 51619f9045e..e383d7f6f0f 100644 --- a/src/renderer/src/components/cloud-workspaces/CloudWorkspacesStates.tsx +++ b/src/renderer/src/components/cloud-workspaces/CloudWorkspacesStates.tsx @@ -1,5 +1,6 @@ // Loading, empty and error states for the cloud workspaces list, and the new-section dialog. import React, { useState } from 'react' +import { List } from 'lucide-react' import { Button } from '@/components/ui/button' import { Dialog, @@ -42,13 +43,21 @@ export function ErrorState({ openCloudWorkspacesHome({ running: true }) : onRetry} + onRetry={atLimit ? undefined : onRetry} + action={ + atLimit ? ( + + ) : undefined + } /> ) } diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx index 5d1d3d88393..b598300b42f 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteCloudWorkspaceParts.tsx @@ -8,14 +8,33 @@ import { DialogDescription, DialogTitle } from '@/components/ui/dialog' import { useTranslate } from '@/i18n/use-translate' import type { CloudSshWorktree } from '../cloud-ssh/use-cloud-ssh-status' import { DeleteCloudSandboxAgentsNote } from './DeleteCloudSandboxAgentsNote' +import { useAppStore } from '@/store' +import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' +import { CloudStateDot } from '@/components/orca-cloud/CloudStateDot' +import { cloudStateLabel } from '@/components/orca-cloud/cloud-state-copy' +import { useCloudWorkspaceView } from '@/components/orca-cloud/use-cloud-workspace-view' import { runArchiveCloudWorkspace } from '@/components/orca-cloud/cloud-workspace-actions' export function DeleteCloudWorkspaceHeader({ - worktree + worktree, + dirtyCounts }: { - worktree: CloudSshWorktree & { displayName?: string } + worktree: CloudSshWorktree & { displayName?: string; repoId?: string; branch?: string } + /** Per-target change counts; only trusted while the sandbox runs (asleep, nothing can be checked). */ + dirtyCounts: ReadonlyMap }): React.JSX.Element { + const uncommittedCount = dirtyCounts.get( + worktree.hostId ? getWorktreeHostIdentity(worktree) : worktree.id + ) const t = useTranslate() + const view = useCloudWorkspaceView(worktree.id) + const repoName = useAppStore( + (s) => s.repos.find((repo) => repo.id === worktree.repoId)?.displayName ?? null + ) + const where = [repoName, worktree.branch?.replace(/^refs\/heads\//, '')] + .filter(Boolean) + .join(' · ') + const running = view.state === 'running' return ( <> @@ -29,6 +48,27 @@ export function DeleteCloudWorkspaceHeader({ "Deletes the sandbox and its disk, including chats, terminals and uncommitted changes. This can't be undone. To keep a snapshot, archive it instead." )} + {/* The files live in the sandbox: name, repo and branch, and its state; no local path. */} +
+
{worktree.displayName}
+
+ + {cloudStateLabel(view.state, t)} + {where ? · {where} : null} +
+ {running && uncommittedCount !== undefined ? ( +
+ {t( + 'auto.components.sidebar.DeleteCloudWorkspace.uncommitted', + '{{count}} uncommitted changes', + { + count: uncommittedCount, + defaultValue_one: '{{count}} uncommitted change' + } + )} +
+ ) : null} +
) @@ -39,31 +79,32 @@ export function DeleteCloudWorkspaceFooter({ onCancel, onArchive, onDelete, - confirmButtonRef + cancelButtonRef }: { isDeleting: boolean onCancel: () => void onArchive: () => void onDelete: () => void - confirmButtonRef: React.RefObject + /** Initial focus: deleting the sandbox is irreversible, so Enter must not do it. */ + cancelButtonRef: React.RefObject }): React.JSX.Element { const t = useTranslate() return ( <> - - diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.tsx index 0eb7f60b5e5..6a3d628299c 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeDialog.tsx @@ -322,7 +322,10 @@ const DeleteWorktreeDialog = React.memo(function DeleteWorktreeDialog() { > {isCloud && worktree ? ( - + ) : (
- + {isCloud ? null : ( + + )} @@ -379,7 +384,7 @@ const DeleteWorktreeDialog = React.memo(function DeleteWorktreeDialog() { onArchive={() => cloudDelete.archiveInsteadOfDelete(worktree, closeModal)} // The dialog is the consent: an asleep sandbox is deleted without waking it. onDelete={() => handleDelete(true)} - confirmButtonRef={confirmButtonRef} + cancelButtonRef={confirmButtonRef} /> ) : ( {{count}} workspace from Orca. Project folders on disk will not be deleted.", "removeBatchFolder_other": "Remove {{count}} workspaces from Orca. Project folders on disk will not be deleted.", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 60deb2b3ebc..c1a04773b03 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -7986,7 +7986,9 @@ "body": "Deletes the sandbox and its disk, including chats, terminals and uncommitted changes. This can't be undone. To keep a snapshot, archive it instead.", "cancel": "Cancel", "archiveInstead": "Archive instead", - "delete": "Delete workspace" + "delete": "Delete workspace", + "uncommitted_one": "{{count}} uncommitted change", + "uncommitted_other": "{{count}} uncommitted changes" } }, "shared": {