Skip to content

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

Python

remove Include screenshot of current version?

Abi Raja91bb50a6d3cf
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 5afba170..ed4b2868 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -21,7 +21,6 @@ import PreviewPane from "./components/preview/PreviewPane";
import DeprecationMessage from "./components/messages/DeprecationMessage";
import { GenerationSettings } from "./components/settings/GenerationSettings";
import StartPane from "./components/start-pane/StartPane";
-import { takeScreenshot } from "./lib/takeScreenshot";
import { Commit } from "./components/commits/types";
import { createCommit } from "./components/commits/utils";
@@ -55,8 +54,6 @@ function App() {
setUpdateInstruction,
appState,
setAppState,
- shouldIncludeResultImage,
- setShouldIncludeResultImage,
} = useAppStore();
// Settings
@@ -111,7 +108,6 @@ function App() {
// Functions
const reset = () => {
setAppState(AppState.INITIAL);
- setShouldIncludeResultImage(false);
setUpdateInstruction("");
disableInSelectAndEditMode();
resetExecutionConsoles();
@@ -289,15 +285,11 @@ function App() {
}
const updatedHistory = [...historyTree, modifiedUpdateInstruction];
- const resultImage = shouldIncludeResultImage
- ? await takeScreenshot()
- : undefined;
doGenerateCode({
generationType: "update",
inputMode,
image: referenceImages[0],
- resultImage,
history: updatedHistory,
isImportedFromCode,
});
diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx
index f06dabc1..bf0230cd 100644
--- a/frontend/src/components/sidebar/Sidebar.tsx
+++ b/frontend/src/components/sidebar/Sidebar.tsx
@@ -1,4 +1,3 @@
-import { Switch } from "@radix-ui/react-switch";
import classNames from "classnames";
import { useAppStore } from "../../store/app-store";
import { useProjectStore } from "../../store/project-store";
@@ -29,13 +28,7 @@ function Sidebar({
}: SidebarProps) {
const textareaRef = useRef<HTMLTextAreaElement>(null);
- const {
- appState,
- updateInstruction,
- setUpdateInstruction,
- shouldIncludeResultImage,
- setShouldIncludeResultImage,
- } = useAppStore();
+ const { appState, updateInstruction, setUpdateInstruction } = useAppStore();
const { inputMode, referenceImages, executionConsoles, head, commits } =
useProjectStore();
@@ -105,16 +98,6 @@ function Sidebar({
}}
value={updateInstruction}
/>
- <div className="flex justify-between items-center gap-x-2">
- <div className="font-500 text-xs text-slate-700 dark:text-white">
- Include screenshot of current version?
- </div>
- <Switch
- checked={shouldIncludeResultImage}
- onCheckedChange={setShouldIncludeResultImage}
- className="dark:bg-gray-700"
- />
- </div>
<Button
onClick={() => doUpdate(updateInstruction)}
className="dark:text-white dark:bg-gray-700 update-btn"
diff --git a/frontend/src/store/app-store.ts b/frontend/src/store/app-store.ts
index cf2048a1..e9afce6b 100644
--- a/frontend/src/store/app-store.ts
+++ b/frontend/src/store/app-store.ts
@@ -9,8 +9,6 @@ interface AppStore {
// UI state
updateInstruction: string;
setUpdateInstruction: (instruction: string) => void;
- shouldIncludeResultImage: boolean;
- setShouldIncludeResultImage: (shouldInclude: boolean) => void;
inSelectAndEditMode: boolean;
toggleInSelectAndEditMode: () => void;
@@ -25,9 +23,6 @@ export const useAppStore = create<AppStore>((set) => ({
updateInstruction: "",
setUpdateInstruction: (instruction: string) =>
set({ updateInstruction: instruction }),
- shouldIncludeResultImage: true,
- setShouldIncludeResultImage: (shouldInclude: boolean) =>
- set({ shouldIncludeResultImage: shouldInclude }),
inSelectAndEditMode: false,
toggleInSelectAndEditMode: () =>
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index dbe10adf..909bfdc8 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -35,7 +35,6 @@ export interface CodeGenerationParams {
generationType: "create" | "update";
inputMode: "image" | "video";
image: string;
- resultImage?: string;
history?: string[];
isImportedFromCode?: boolean;
}