Skip to content

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

Python

Pin prompt box to bottom of sidebar, reduce vertical space

Abi Raja8c6b1a53ddce
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 4ca0a405..a8fa93f4 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -557,27 +557,28 @@ function App() {
{/* Content panel - shows sidebar or history */}
{showContentPanel && (
- <div className="lg:fixed lg:inset-y-0 lg:left-14 lg:z-40 lg:flex lg:w-[calc(24rem-3.5rem)] lg:flex-col">
- <div className="sidebar-scrollbar-stable flex grow flex-col gap-y-2 overflow-y-auto border-r border-gray-200 bg-white px-6 dark:bg-zinc-950 dark:text-white">
+ <div className="lg:fixed lg:inset-y-0 lg:left-14 lg:z-40 lg:flex lg:w-[calc(24rem-3.5rem)] lg:flex-col border-r border-gray-200 bg-white dark:bg-zinc-950 dark:text-white">
{isHistoryOpen ? (
- <div className="mt-4">
- <div className="flex items-center justify-between mb-2">
- <h1 className="text-lg font-semibold">History</h1>
- <button
- onClick={() => setIsHistoryOpen(false)}
- className="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm"
- >
- Close
- </button>
+ <div className="flex-1 overflow-y-auto sidebar-scrollbar-stable px-6">
+ <div className="mt-4">
+ <div className="flex items-center justify-between mb-2">
+ <h1 className="text-lg font-semibold">History</h1>
+ <button
+ onClick={() => setIsHistoryOpen(false)}
+ className="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm"
+ >
+ Close
+ </button>
+ </div>
+ <HistoryDisplay
+ shouldDisableReverts={appState === AppState.CODING}
+ />
</div>
- <HistoryDisplay
- shouldDisableReverts={appState === AppState.CODING}
- />
</div>
) : (
<>
{IS_RUNNING_ON_CLOUD && !settings.openAiApiKey && (
- <div className="mt-4">
+ <div className="px-6 mt-4">
<OnboardingNote />
</div>
)}
@@ -593,7 +594,6 @@ function App() {
)}
</>
)}
- </div>
</div>
)}
diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx
index 43820f77..63cc660f 100644
--- a/frontend/src/components/sidebar/Sidebar.tsx
+++ b/frontend/src/components/sidebar/Sidebar.tsx
@@ -106,60 +106,64 @@ function Sidebar({
return (
- <>
- <Variants />
+ <div className="flex flex-col h-full">
+ {/* Scrollable content */}
+ <div className="flex-1 overflow-y-auto sidebar-scrollbar-stable px-6">
+ <Variants />
- <AgentActivity />
+ <AgentActivity />
- {/* Show code preview when coding and the selected variant is not complete */}
- {appState === AppState.CODING && !isSelectedVariantComplete && (
- <div className="flex flex-col">
- <CodePreview code={viewedCode} />
+ {/* Show code preview when coding and the selected variant is not complete */}
+ {appState === AppState.CODING && !isSelectedVariantComplete && (
+ <div className="flex flex-col">
+ <CodePreview code={viewedCode} />
- <div className="flex w-full">
- <Button
- onClick={cancelCodeGeneration}
- className="w-full dark:text-white dark:bg-gray-700"
- >
- Cancel All Generations
- </Button>
+ <div className="flex w-full">
+ <Button
+ onClick={cancelCodeGeneration}
+ className="w-full dark:text-white dark:bg-gray-700"
+ >
+ Cancel All Generations
+ </Button>
+ </div>
</div>
- </div>
- )}
+ )}
- {/* Show error message when selected option has an error */}
- {isSelectedVariantError && (
- <div className="bg-red-50 border border-red-200 rounded-md p-3 mb-2">
- <div className="text-red-800 text-sm">
- <div className="font-medium mb-1">
- This option failed to generate because
- </div>
- {selectedVariantErrorMessage && (
- <div className="mb-2">
- <div className="text-red-700 bg-red-100 border border-red-300 rounded px-2 py-1 text-xs font-mono break-words">
- {selectedVariantErrorMessage.length > 200 && !isErrorExpanded
- ? `${selectedVariantErrorMessage.slice(0, 200)}...`
- : selectedVariantErrorMessage}
- </div>
- {selectedVariantErrorMessage.length > 200 && (
- <button
- onClick={() => setIsErrorExpanded(!isErrorExpanded)}
- className="text-red-600 text-xs underline mt-1 hover:text-red-800"
- >
- {isErrorExpanded ? "Show less" : "Show more"}
- </button>
- )}
+ {/* Show error message when selected option has an error */}
+ {isSelectedVariantError && (
+ <div className="bg-red-50 border border-red-200 rounded-md p-3 mb-2">
+ <div className="text-red-800 text-sm">
+ <div className="font-medium mb-1">
+ This option failed to generate because
</div>
- )}
- <div>Switch to another option above to make updates.</div>
+ {selectedVariantErrorMessage && (
+ <div className="mb-2">
+ <div className="text-red-700 bg-red-100 border border-red-300 rounded px-2 py-1 text-xs font-mono break-words">
+ {selectedVariantErrorMessage.length > 200 && !isErrorExpanded
+ ? `${selectedVariantErrorMessage.slice(0, 200)}...`
+ : selectedVariantErrorMessage}
+ </div>
+ {selectedVariantErrorMessage.length > 200 && (
+ <button
+ onClick={() => setIsErrorExpanded(!isErrorExpanded)}
+ className="text-red-600 text-xs underline mt-1 hover:text-red-800"
+ >
+ {isErrorExpanded ? "Show less" : "Show more"}
+ </button>
+ )}
+ </div>
+ )}
+ <div>Switch to another option above to make updates.</div>
+ </div>
</div>
- </div>
- )}
+ )}
+ </div>
- {/* Show update UI when app state is ready OR the selected variant is complete (but not errored) */}
+ {/* Pinned prompt box at bottom */}
{(appState === AppState.CODE_READY || isSelectedVariantComplete) &&
!isSelectedVariantError && (
<div
+ className="shrink-0 border-t border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-2"
onDragEnter={() => setIsDragging(true)}
onDragLeave={(e) => {
if (!e.currentTarget.contains(e.relatedTarget as Node)) {
@@ -186,8 +190,8 @@ function Sidebar({
}}
value={updateInstruction}
data-testid="update-input"
- rows={3}
- className="w-full resize-none border-0 bg-transparent px-4 pt-3 pb-2 text-sm placeholder:text-gray-400 dark:placeholder:text-zinc-500 focus:outline-none"
+ rows={1}
+ className="w-full resize-none border-0 bg-transparent px-4 pt-2.5 pb-1 text-sm placeholder:text-gray-400 dark:placeholder:text-zinc-500 focus:outline-none"
/>
<div className="flex items-center justify-between px-3 pb-2">
<div className="flex items-center gap-1">
@@ -247,9 +251,7 @@ function Sidebar({
</div>
</div>
)}
-
-
- </>
+ </div>
);
}