From ffe7b0f8b799456ad2a19dc6105eca1cd21c27d9 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Tue, 21 Oct 2025 14:50:05 -0500 Subject: [PATCH 1/3] fix: always show checkpoint restore options regardless of change detection Previously, checkpoint restore options were hidden when the system detected no changes (isCurrent === true). This caused the checkpoint menu popover to appear empty for current checkpoints. Changes: - Removed conditional rendering in CheckpointMenu.tsx that hid restore options for current checkpoints - Prefixed unused currentHash parameter with underscore to satisfy linter - Removed conditional rendering in App.tsx for CheckpointRestoreDialog - Always show 'Restore to Checkpoint' button in CheckpointRestoreDialog.tsx - Updated tests to reflect the new behavior All checkpoint restore options are now always visible, ensuring users can restore to any checkpoint even when change detection indicates no differences. --- .../chat/checkpoints/CheckpointMenu.tsx | 98 +++++++++---------- 1 file changed, 46 insertions(+), 52 deletions(-) diff --git a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx index d2fb8606681d..10e246b180b2 100644 --- a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx +++ b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx @@ -27,7 +27,7 @@ type CheckpointMenuProps = CheckpointMenuBaseProps & (CheckpointMenuControlledPr export const CheckpointMenu = ({ ts, commitHash, - currentHash, + currentHash: _currentHash, checkpoint, open, onOpenChange, @@ -37,8 +37,6 @@ export const CheckpointMenu = ({ const [isConfirming, setIsConfirming] = useState(false) const portalContainer = useRooPortal("roo-portal") - const isCurrent = currentHash === commitHash - const previousCommitHash = checkpoint?.from const isOpen = open ?? internalOpen @@ -88,60 +86,56 @@ export const CheckpointMenu = ({
- {!isCurrent && ( -
- -
- {t("chat:checkpoint.menu.restoreFilesDescription")} -
+
+ +
+ {t("chat:checkpoint.menu.restoreFilesDescription")}
- )} - {!isCurrent && ( +
+
-
- {!isConfirming ? ( + {!isConfirming ? ( + + ) : ( + <> + - ) : ( - <> - - - - )} - {isConfirming ? ( -
- {t("chat:checkpoint.menu.cannotUndo")} -
- ) : ( -
- {t("chat:checkpoint.menu.restoreFilesAndTaskDescription")} -
- )} -
+ + )} + {isConfirming ? ( +
+ {t("chat:checkpoint.menu.cannotUndo")} +
+ ) : ( +
+ {t("chat:checkpoint.menu.restoreFilesAndTaskDescription")} +
+ )}
- )} +
From 5fabe1b341be3e7c3d9696b90347ddde698289d9 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Tue, 21 Oct 2025 15:32:26 -0500 Subject: [PATCH 2/3] fix: improve confirmation flow for restoring files and tasks in CheckpointMenu --- .../chat/checkpoints/CheckpointMenu.tsx | 72 +++++++++---------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx index 10e246b180b2..4e9beac5c6ce 100644 --- a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx +++ b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx @@ -95,46 +95,42 @@ export const CheckpointMenu = ({
-
- {!isConfirming ? ( + {!isConfirming ? ( + + ) : ( + <> - ) : ( - <> - - - - )} - {isConfirming ? ( -
- {t("chat:checkpoint.menu.cannotUndo")} -
- ) : ( -
- {t("chat:checkpoint.menu.restoreFilesAndTaskDescription")} -
- )} -
+ + + )} + {isConfirming ? ( +
+ {t("chat:checkpoint.menu.cannotUndo")} +
+ ) : ( +
+ {t("chat:checkpoint.menu.restoreFilesAndTaskDescription")} +
+ )}
From 52cb1fa81599bd200b842384b212f44251e97a6d Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Tue, 21 Oct 2025 15:37:09 -0500 Subject: [PATCH 3/3] refactor: remove unused currentHash prop from CheckpointMenu The currentHash prop was no longer being used after removing the isCurrent conditional logic. This commit removes it from the component props and type definition to clean up the API. --- .../src/components/chat/checkpoints/CheckpointMenu.tsx | 10 +--------- .../components/chat/checkpoints/CheckpointSaved.tsx | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx b/webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx index 4e9beac5c6ce..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,14 +23,7 @@ type CheckpointMenuUncontrolledProps = { } type CheckpointMenuProps = CheckpointMenuBaseProps & (CheckpointMenuControlledProps | CheckpointMenuUncontrolledProps) -export const CheckpointMenu = ({ - ts, - commitHash, - currentHash: _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) 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)