diff --git a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx index d2fb8606681d..c6948e5ce325 100644 --- a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx +++ b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx @@ -11,7 +11,6 @@ import { Checkpoint } from "./schema" type CheckpointMenuBaseProps = { ts: number commitHash: string - currentHash?: string checkpoint: Checkpoint } type CheckpointMenuControlledProps = { @@ -24,21 +23,12 @@ type CheckpointMenuUncontrolledProps = { } type CheckpointMenuProps = CheckpointMenuBaseProps & (CheckpointMenuControlledProps | CheckpointMenuUncontrolledProps) -export const CheckpointMenu = ({ - ts, - commitHash, - currentHash, - checkpoint, - open, - onOpenChange, -}: CheckpointMenuProps) => { +export const CheckpointMenu = ({ ts, commitHash, checkpoint, open, onOpenChange }: CheckpointMenuProps) => { const { t } = useTranslation() const [internalOpen, setInternalOpen] = useState(false) const [isConfirming, setIsConfirming] = useState(false) const portalContainer = useRooPortal("roo-portal") - const isCurrent = currentHash === commitHash - const previousCommitHash = checkpoint?.from const isOpen = open ?? internalOpen @@ -88,60 +78,52 @@ export const CheckpointMenu = ({
- {!isCurrent && ( -
- -
- {t("chat:checkpoint.menu.restoreFilesDescription")} -
+
+ +
+ {t("chat:checkpoint.menu.restoreFilesDescription")}
- )} - {!isCurrent && ( -
-
- {!isConfirming ? ( - - ) : ( - <> - - - - )} - {isConfirming ? ( -
- {t("chat:checkpoint.menu.cannotUndo")} +
+
+ {!isConfirming ? ( + + ) : ( + <> + + + + )} + {isConfirming ? ( +
+ {t("chat:checkpoint.menu.cannotUndo")}
-
- )} + ) : ( +
+ {t("chat:checkpoint.menu.restoreFilesAndTaskDescription")} +
+ )} +
diff --git a/webview-ui/src/components/chat/checkpoints/CheckpointSaved.tsx b/webview-ui/src/components/chat/checkpoints/CheckpointSaved.tsx index da16904e4c08..710c2b3287c7 100644 --- a/webview-ui/src/components/chat/checkpoints/CheckpointSaved.tsx +++ b/webview-ui/src/components/chat/checkpoints/CheckpointSaved.tsx @@ -13,9 +13,9 @@ type CheckpointSavedProps = { checkpoint?: Record } -export const CheckpointSaved = ({ checkpoint, ...props }: CheckpointSavedProps) => { +export const CheckpointSaved = ({ checkpoint, currentHash, ...props }: CheckpointSavedProps) => { const { t } = useTranslation() - const isCurrent = props.currentHash === props.commitHash + const isCurrent = currentHash === props.commitHash const [isPopoverOpen, setIsPopoverOpen] = useState(false) const [isClosing, setIsClosing] = useState(false) const closeTimer = useRef(null)