Skip to content

Commit a0993a3

Browse files
committed
Remove "Restore" option on current checkpoint
1 parent 59ddaa9 commit a0993a3

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ export const CheckpointMenu = ({ ts, commitHash, currentCheckpointHash }: Checkp
4646
<Button variant="ghost" size="icon" onClick={onCheckpointDiff}>
4747
<span className="codicon codicon-diff-single" />
4848
</Button>
49-
{!isCurrent && (
50-
<Popover
51-
open={isOpen}
52-
onOpenChange={(open) => {
53-
setIsOpen(open)
54-
setIsConfirming(false)
55-
}}>
56-
<PopoverTrigger asChild>
57-
<Button variant="ghost" size="icon">
58-
<span className="codicon codicon-history" />
59-
</Button>
60-
</PopoverTrigger>
61-
<PopoverContent align="end" container={portalContainer}>
62-
<div className="flex flex-col gap-2">
49+
<Popover
50+
open={isOpen}
51+
onOpenChange={(open) => {
52+
setIsOpen(open)
53+
setIsConfirming(false)
54+
}}>
55+
<PopoverTrigger asChild>
56+
<Button variant="ghost" size="icon">
57+
<span className="codicon codicon-history" />
58+
</Button>
59+
</PopoverTrigger>
60+
<PopoverContent align="end" container={portalContainer}>
61+
<div className="flex flex-col gap-2">
62+
{!isCurrent && (
6363
<div className="flex flex-col gap-1 group hover:text-foreground">
6464
<Button variant="secondary" onClick={onPreview}>
6565
Restore Files
@@ -68,42 +68,42 @@ export const CheckpointMenu = ({ ts, commitHash, currentCheckpointHash }: Checkp
6868
Restores your project's files back to a snapshot taken at this point.
6969
</div>
7070
</div>
71+
)}
72+
<div className="flex flex-col gap-1 group hover:text-foreground">
7173
<div className="flex flex-col gap-1 group hover:text-foreground">
72-
<div className="flex flex-col gap-1 group hover:text-foreground">
73-
{!isConfirming ? (
74-
<Button variant="secondary" onClick={() => setIsConfirming(true)}>
75-
Restore Files & Task
74+
{!isConfirming ? (
75+
<Button variant="secondary" onClick={() => setIsConfirming(true)}>
76+
Restore Files & Task
77+
</Button>
78+
) : (
79+
<>
80+
<Button variant="default" onClick={onRestore} className="grow">
81+
<div className="flex flex-row gap-1">
82+
<CheckIcon />
83+
<div>Confirm</div>
84+
</div>
7685
</Button>
77-
) : (
78-
<>
79-
<Button variant="default" onClick={onRestore} className="grow">
80-
<div className="flex flex-row gap-1">
81-
<CheckIcon />
82-
<div>Confirm</div>
83-
</div>
84-
</Button>
85-
<Button variant="secondary" onClick={() => setIsConfirming(false)}>
86-
<div className="flex flex-row gap-1">
87-
<Cross2Icon />
88-
<div>Cancel</div>
89-
</div>
90-
</Button>
91-
</>
92-
)}
93-
{isConfirming ? (
94-
<div className="text-destructive font-bold">This action cannot be undone.</div>
95-
) : (
96-
<div className="text-muted transition-colors group-hover:text-foreground">
97-
Restores your project's files back to a snapshot taken at this point and
98-
deletes all messages after this point.
99-
</div>
100-
)}
101-
</div>
86+
<Button variant="secondary" onClick={() => setIsConfirming(false)}>
87+
<div className="flex flex-row gap-1">
88+
<Cross2Icon />
89+
<div>Cancel</div>
90+
</div>
91+
</Button>
92+
</>
93+
)}
94+
{isConfirming ? (
95+
<div className="text-destructive font-bold">This action cannot be undone.</div>
96+
) : (
97+
<div className="text-muted transition-colors group-hover:text-foreground">
98+
Restores your project's files back to a snapshot taken at this point and deletes
99+
all messages after this point.
100+
</div>
101+
)}
102102
</div>
103103
</div>
104-
</PopoverContent>
105-
</Popover>
106-
)}
104+
</div>
105+
</PopoverContent>
106+
</Popover>
107107
</div>
108108
)
109109
}

webview-ui/src/components/chat/checkpoints/CheckpointSaved.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const CheckpointSaved = (props: CheckpointSavedProps) => {
1111

1212
return (
1313
<div className="flex items-center justify-between">
14-
<div className="flex items-center gap-2">
14+
<div className="flex gap-2">
1515
<span className="codicon codicon-git-commit text-blue-400" />
1616
<span className="font-bold">Checkpoint</span>
1717
{isCurrent && <span className="text-muted text-sm">Current</span>}

0 commit comments

Comments
 (0)