Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit babd7cd

Browse files
committed
Delete modal
1 parent 1f7be76 commit babd7cd

5 files changed

Lines changed: 36 additions & 33 deletions

File tree

src/package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,14 @@
244244
"when": "view == roo-cline.SidebarProvider"
245245
},
246246
{
247-
"command": "roo-cline.popoutButtonClicked",
247+
"command": "roo-cline.worktreesButtonClicked",
248248
"group": "overflow@2",
249249
"when": "view == roo-cline.SidebarProvider"
250+
},
251+
{
252+
"command": "roo-cline.popoutButtonClicked",
253+
"group": "overflow@3",
254+
"when": "view == roo-cline.SidebarProvider"
250255
}
251256
],
252257
"editor/title": [
@@ -276,9 +281,14 @@
276281
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
277282
},
278283
{
279-
"command": "roo-cline.popoutButtonClicked",
284+
"command": "roo-cline.worktreesButtonClicked",
280285
"group": "overflow@2",
281286
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
287+
},
288+
{
289+
"command": "roo-cline.popoutButtonClicked",
290+
"group": "overflow@3",
291+
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
282292
}
283293
]
284294
},

webview-ui/src/components/ui/dialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ function DialogContent({ className, children, ...props }: React.ComponentProps<t
4040
<DialogPrimitive.Content
4141
data-slot="dialog-content"
4242
className={cn(
43-
"bg-vscode-editor-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
43+
"bg-vscode-editor-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border p-6 shadow-lg duration-200 sm:max-w-lg",
4444
className,
4545
)}
4646
{...props}>
4747
{children}
48-
<DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
48+
<DialogPrimitive.Close className="ring-offset-background cursor-pointer focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
4949
<XIcon />
5050
<span className="sr-only">Close</span>
5151
</DialogPrimitive.Close>
@@ -68,7 +68,7 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
6868
return (
6969
<div
7070
data-slot="dialog-footer"
71-
className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
71+
className={cn("flex justify-end gap-2 sm:flex-row sm:justify-end", className)}
7272
{...props}
7373
/>
7474
)

webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,8 @@ import type { Worktree } from "@roo-code/types"
44

55
import { vscode } from "@/utils/vscode"
66
import { useAppTranslation } from "@/i18n/TranslationContext"
7-
import {
8-
Dialog,
9-
DialogContent,
10-
DialogDescription,
11-
DialogFooter,
12-
DialogHeader,
13-
DialogTitle,
14-
Button,
15-
Checkbox,
16-
} from "@/components/ui"
7+
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Button, Checkbox } from "@/components/ui"
8+
import { Folder, GitBranch, TriangleAlert } from "lucide-react"
179

1810
interface DeleteWorktreeModalProps {
1911
open: boolean
@@ -63,33 +55,35 @@ export const DeleteWorktreeModal = ({ open, onClose, worktree, onSuccess }: Dele
6355
<Dialog open={open} onOpenChange={(isOpen: boolean) => !isOpen && onClose()}>
6456
<DialogContent>
6557
<DialogHeader>
66-
<div className="flex items-center gap-2">
67-
<span className="codicon codicon-warning text-vscode-charts-yellow text-xl" />
68-
<DialogTitle>{t("worktrees:deleteWorktree")}</DialogTitle>
69-
</div>
70-
<DialogDescription>{t("worktrees:deleteWorktreeDescription")}</DialogDescription>
58+
<DialogTitle>{t("worktrees:deleteWorktree")}</DialogTitle>
7159
</DialogHeader>
7260

7361
<div className="flex flex-col gap-3 overflow-hidden">
7462
{/* Worktree info */}
75-
<div className="px-2 py-1.5 rounded bg-vscode-input-background border border-vscode-input-border">
76-
<div className="flex items-center gap-2">
77-
<span className="codicon codicon-git-branch flex-shrink-0" />
78-
<span className="font-medium text-vscode-foreground truncate">
63+
<div className="flex flex-col p-3 gap-1 cursor-default rounded-xl text-vscode-foreground bg-vscode-input-background">
64+
<p className="flex items-center gap-2 m-0">
65+
<GitBranch className="size-4 shrink-0" />
66+
<span className="font-medium truncate">
7967
{worktree.branch ||
8068
(worktree.isDetached ? t("worktrees:detachedHead") : t("worktrees:noBranch"))}
8169
</span>
82-
</div>
83-
<div className="text-xs text-vscode-descriptionForeground mt-0.5 truncate">{worktree.path}</div>
70+
</p>
71+
72+
<p className="flex items-center gap-2 m-0">
73+
<Folder className="size-4 shrink-0" />
74+
<span className="m-0 text-sm font-mono font-medium text-vscode-descriptionForeground truncate">
75+
{worktree.path}
76+
</span>
77+
</p>
8478
</div>
8579

8680
{/* Warning message */}
87-
<div className="flex items-start gap-2 p-2 rounded bg-vscode-inputValidation-warningBackground border border-vscode-inputValidation-warningBorder text-sm">
88-
<span className="codicon codicon-warning text-vscode-charts-yellow flex-shrink-0 mt-0.5" />
81+
<div className="flex items-start gap-2 p-3 rounded-xl bg-vscode-inputValidation-warningBackground border border-vscode-inputValidation-warningBorder">
82+
<TriangleAlert className="size-4 text-vscode-charts-yellow flex-shrink-0" />
8983
<div className="min-w-0">
9084
<p className="text-vscode-foreground m-0">{t("worktrees:deleteWarning")}</p>
9185
<ul className="mt-1 mb-0 pl-0 list-none space-y-0.5 text-vscode-descriptionForeground">
92-
<li>{t("worktrees:deleteWarningBranch", { branch: worktree.branch || "HEAD" })}</li>
86+
<li>{t("worktrees:deleteWarningBranch")}</li>
9387
<li>{t("worktrees:deleteWarningFiles")}</li>
9488
</ul>
9589
</div>

webview-ui/src/i18n/locales/en/worktrees.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@
4747
"cancel": "Cancel",
4848

4949
"deleteWorktree": "Delete Worktree",
50-
"deleteWorktreeDescription": "This will remove the worktree and all its files.",
51-
"deleteWarning": "This action cannot be undone. The following will be deleted:",
52-
"deleteWarningBranch": "The branch '{{branch}}' and all uncommitted changes",
50+
"deleteWarning": "This can't be undone. It will delete:",
51+
"deleteWarningBranch": "The branch and any uncommitted changes",
5352
"deleteWarningFiles": "All files in the worktree directory",
5453
"forceDelete": "Force delete",
5554
"worktreeIsLocked": "worktree is locked",

webview-ui/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
--accent: var(--vscode-list-hoverBackground);
164164
--accent-foreground: var(--vscode-list-hoverForeground);
165165
--destructive: var(--vscode-errorForeground);
166-
--destructive-foreground: var(--vscode-button-foreground);
166+
--destructive-foreground: var(--vscode-editor-background);
167167
--border: var(--vscode-input-border, transparent); /* --border gets theme value or transparent fallback */
168168
--input: var(--vscode-input-background);
169169
--ring: var(--vscode-input-border);

0 commit comments

Comments
 (0)