mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: show message instead of empty popover for current checkpoint restore button
- Added message display when trying to restore the current checkpoint - Fixed empty popover issue reported in #8646 - Added 'alreadyCurrent' translation key to English locale
This commit is contained in:
parent
6b8c21f873
commit
5b11885afb
2 changed files with 55 additions and 52 deletions
|
|
@ -88,59 +88,61 @@ export const CheckpointMenu = ({
|
|||
</StandardTooltip>
|
||||
<PopoverContent align="end" container={portalContainer}>
|
||||
<div className="flex flex-col gap-2">
|
||||
{!isCurrent && (
|
||||
<div className="flex flex-col gap-1 group hover:text-foreground">
|
||||
<Button variant="secondary" onClick={onPreview} data-testid="restore-files-btn">
|
||||
{t("chat:checkpoint.menu.restoreFiles")}
|
||||
</Button>
|
||||
<div className="text-muted transition-colors group-hover:text-foreground">
|
||||
{t("chat:checkpoint.menu.restoreFilesDescription")}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!isCurrent && (
|
||||
<div className="flex flex-col gap-1 group hover:text-foreground">
|
||||
{isCurrent ? (
|
||||
<div className="text-muted p-2 text-center">{t("chat:checkpoint.menu.alreadyCurrent")}</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="flex flex-col gap-1 group hover:text-foreground">
|
||||
{!isConfirming ? (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => setIsConfirming(true)}
|
||||
data-testid="restore-files-and-task-btn">
|
||||
{t("chat:checkpoint.menu.restoreFilesAndTask")}
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
<Button
|
||||
variant="default"
|
||||
onClick={onRestore}
|
||||
className="grow"
|
||||
data-testid="confirm-restore-btn">
|
||||
<div className="flex flex-row gap-1">
|
||||
<CheckIcon />
|
||||
<div>{t("chat:checkpoint.menu.confirm")}</div>
|
||||
</div>
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={() => setIsConfirming(false)}>
|
||||
<div className="flex flex-row gap-1">
|
||||
<Cross2Icon />
|
||||
<div>{t("chat:checkpoint.menu.cancel")}</div>
|
||||
</div>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{isConfirming ? (
|
||||
<div
|
||||
data-testid="checkpoint-confirm-warning"
|
||||
className="text-destructive font-bold">
|
||||
{t("chat:checkpoint.menu.cannotUndo")}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-muted transition-colors group-hover:text-foreground">
|
||||
{t("chat:checkpoint.menu.restoreFilesAndTaskDescription")}
|
||||
</div>
|
||||
)}
|
||||
<Button variant="secondary" onClick={onPreview} data-testid="restore-files-btn">
|
||||
{t("chat:checkpoint.menu.restoreFiles")}
|
||||
</Button>
|
||||
<div className="text-muted transition-colors group-hover:text-foreground">
|
||||
{t("chat:checkpoint.menu.restoreFilesDescription")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1 group hover:text-foreground">
|
||||
<div className="flex flex-col gap-1 group hover:text-foreground">
|
||||
{!isConfirming ? (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => setIsConfirming(true)}
|
||||
data-testid="restore-files-and-task-btn">
|
||||
{t("chat:checkpoint.menu.restoreFilesAndTask")}
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
<Button
|
||||
variant="default"
|
||||
onClick={onRestore}
|
||||
className="grow"
|
||||
data-testid="confirm-restore-btn">
|
||||
<div className="flex flex-row gap-1">
|
||||
<CheckIcon />
|
||||
<div>{t("chat:checkpoint.menu.confirm")}</div>
|
||||
</div>
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={() => setIsConfirming(false)}>
|
||||
<div className="flex flex-row gap-1">
|
||||
<Cross2Icon />
|
||||
<div>{t("chat:checkpoint.menu.cancel")}</div>
|
||||
</div>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{isConfirming ? (
|
||||
<div
|
||||
data-testid="checkpoint-confirm-warning"
|
||||
className="text-destructive font-bold">
|
||||
{t("chat:checkpoint.menu.cannotUndo")}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-muted transition-colors group-hover:text-foreground">
|
||||
{t("chat:checkpoint.menu.restoreFilesAndTaskDescription")}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</PopoverContent>
|
||||
|
|
|
|||
|
|
@ -161,7 +161,8 @@
|
|||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"cannotUndo": "This action cannot be undone.",
|
||||
"restoreFilesAndTaskDescription": "Restores your project's files back to a snapshot taken at this point and deletes all messages after this point."
|
||||
"restoreFilesAndTaskDescription": "Restores your project's files back to a snapshot taken at this point and deletes all messages after this point.",
|
||||
"alreadyCurrent": "This checkpoint is already current"
|
||||
},
|
||||
"current": "Current"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue