Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Only show Retry button on the latest commit

Abi Rajaf55bfb672cf8
diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx
index 988fff1c..a335969d 100644
--- a/frontend/src/components/sidebar/Sidebar.tsx
+++ b/frontend/src/components/sidebar/Sidebar.tsx
@@ -107,7 +107,7 @@ function Sidebar({
[updateImages, setUpdateImages]
);
- const { head, commits } = useProjectStore();
+ const { head, commits, latestCommitHash } = useProjectStore();
const currentCommit = head ? commits[head] : null;
const latestChangeSummary = summarizeLatestChange(currentCommit);
@@ -268,7 +268,7 @@ function Sidebar({
<AgentActivity />
{/* Regenerate button for first generation */}
- {isFirstGeneration && (appState === AppState.CODE_READY || isSelectedVariantComplete) && !isSelectedVariantError && (
+ {isFirstGeneration && head === latestCommitHash && (appState === AppState.CODE_READY || isSelectedVariantComplete) && !isSelectedVariantError && (
<div className="flex justify-end mb-3">
<button
onClick={regenerate}