diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 3b8f7da..5a51bc6 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -39,7 +39,7 @@ import { CodeGenerationModel } from "./lib/models";
import ModelSettingsSection from "./components/ModelSettingsSection";
import { extractHtml } from "./components/preview/extractHtml";
import useBrowserTabIndicator from "./hooks/useBrowserTabIndicator";
-import { URLS } from "./urls";
+import TipLink from "./components/core/TipLink";
const IS_OPENAI_DOWN = false;
@@ -142,6 +142,25 @@ function App() {
setShouldIncludeResultImage(false);
};
+ const regenerate = () => {
+ if (currentVersion === null) {
+ toast.error(
+ "No current version set. Please open a Github issue as this shouldn't happen."
+ );
+ return;
+ }
+
+ // Retrieve the previous command
+ const previousCommand = appHistory[currentVersion];
+ if (previousCommand.type !== "ai_create") {
+ toast.error("Only the first version can be regenerated.");
+ return;
+ }
+
+ // Re-run the create
+ doCreate(referenceImages, inputMode);
+ };
+
const cancelCodeGeneration = () => {
wsRef.current?.close?.(USER_CLOSE_WEB_SOCKET_CODE);
// make sure stop can correct the state even if the websocket is already closed
@@ -373,14 +392,7 @@ function App() {
}
/>
-
- Tips for better results
-
+ {appState !== AppState.CODE_READY &&