Skip to content

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

Python

Add Editor tab to icon strip and reorder before History

Abi Raja9adc824dd0be
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index f6e20c54..5e5e176a 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -542,22 +542,23 @@ function App() {
)}
{/* Icon strip - always visible */}
- <div className="lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-14 lg:flex-col">
+ <div className="lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-16 lg:flex-col">
<IconStrip
isHistoryOpen={isHistoryOpen}
+ isEditorOpen={!isHistoryOpen}
showHistory={appState === AppState.CODING || appState === AppState.CODE_READY}
+ showEditor={appState === AppState.CODING || appState === AppState.CODE_READY}
onToggleHistory={() => setIsHistoryOpen((prev) => !prev)}
- onLogoClick={() => {
- setIsHistoryOpen(false);
- }}
+ onToggleEditor={() => setIsHistoryOpen(false)}
+ onLogoClick={() => setIsHistoryOpen(false)}
settings={settings}
setSettings={setSettings}
/>
</div>
- {/* Content panel - shows sidebar or history */}
+ {/* Content panel - shows sidebar, history, or editor */}
{showContentPanel && (
- <div className="lg:fixed lg:inset-y-0 lg:left-14 lg:z-40 lg:flex lg:w-[calc(28rem-3.5rem)] lg:flex-col border-r border-gray-200 bg-white dark:bg-zinc-950 dark:text-white">
+ <div className="lg:fixed lg:inset-y-0 lg:left-16 lg:z-40 lg:flex lg:w-[calc(28rem-4rem)] lg:flex-col border-r border-gray-200 bg-white dark:bg-zinc-950 dark:text-white">
{isHistoryOpen ? (
<div className="flex-1 overflow-y-auto sidebar-scrollbar-stable px-6">
<div className="mt-4">
@@ -598,7 +599,7 @@ function App() {
)}
<main
- className={`py-2 ${showContentPanel ? "lg:pl-[28rem]" : "lg:pl-14"}`}
+ className={`py-2 ${showContentPanel ? "lg:pl-[28rem]" : "lg:pl-16"}`}
>
{appState === AppState.INITIAL && (
<StartPane
diff --git a/frontend/src/components/sidebar/IconStrip.tsx b/frontend/src/components/sidebar/IconStrip.tsx
index 62cad0c0..3245e1c7 100644
--- a/frontend/src/components/sidebar/IconStrip.tsx
+++ b/frontend/src/components/sidebar/IconStrip.tsx
@@ -1,11 +1,14 @@
-import { LuClock, LuSettings } from "react-icons/lu";
+import { LuClock, LuCode, LuSettings } from "react-icons/lu";
import SettingsDialog from "../settings/SettingsDialog";
import { Settings } from "../../types";
interface IconStripProps {
isHistoryOpen: boolean;
+ isEditorOpen: boolean;
showHistory: boolean;
+ showEditor: boolean;
onToggleHistory: () => void;
+ onToggleEditor: () => void;
onLogoClick: () => void;
settings: Settings;
setSettings: React.Dispatch<React.SetStateAction<Settings>>;
@@ -13,19 +16,21 @@ interface IconStripProps {
function IconStrip({
isHistoryOpen,
+ isEditorOpen,
showHistory,
+ showEditor,
onToggleHistory,
+ onToggleEditor,
onLogoClick,
settings,
setSettings,
}: IconStripProps) {
return (
- <div className="flex h-full flex-col items-center w-14 py-5 gap-y-1 border-r border-gray-200 bg-gray-50 dark:bg-zinc-900 dark:border-zinc-800">
+ <div className="flex h-full flex-col items-center w-16 py-4 gap-y-3 border-r border-gray-200 bg-gray-50 dark:bg-zinc-900 dark:border-zinc-800">
{/* Logo */}
<button
onClick={onLogoClick}
- className="mb-4 rounded-lg p-1 transition-colors hover:bg-gray-200/70 dark:hover:bg-zinc-800"
- title="Home"
+ className="mb-2 rounded-lg p-1 transition-colors hover:bg-gray-200/70 dark:hover:bg-zinc-800"
>
<img
src="/favicon/main.png"
@@ -34,18 +39,33 @@ function IconStrip({
/>
</button>
+ {/* Editor */}
+ {showEditor && (
+ <button
+ onClick={onToggleEditor}
+ className={`flex flex-col items-center gap-1 rounded-lg px-2 py-1.5 transition-colors ${
+ isEditorOpen
+ ? "bg-gray-200 dark:bg-zinc-700 text-gray-900 dark:text-white"
+ : "text-gray-500 dark:text-gray-400 hover:bg-gray-200/70 dark:hover:bg-zinc-800 hover:text-gray-700 dark:hover:text-gray-200"
+ }`}
+ >
+ <LuCode className="w-[18px] h-[18px]" />
+ <span className="text-[10px] leading-none">Editor</span>
+ </button>
+ )}
+
{/* History */}
{showHistory && (
<button
onClick={onToggleHistory}
- className={`p-2.5 rounded-lg transition-colors ${
+ className={`flex flex-col items-center gap-1 rounded-lg px-2 py-1.5 transition-colors ${
isHistoryOpen
? "bg-gray-200 dark:bg-zinc-700 text-gray-900 dark:text-white"
: "text-gray-500 dark:text-gray-400 hover:bg-gray-200/70 dark:hover:bg-zinc-800 hover:text-gray-700 dark:hover:text-gray-200"
}`}
- title="History"
>
<LuClock className="w-[18px] h-[18px]" />
+ <span className="text-[10px] leading-none">History</span>
</button>
)}
@@ -58,10 +78,10 @@ function IconStrip({
setSettings={setSettings}
trigger={
<button
- className="p-2.5 rounded-lg transition-colors text-gray-500 dark:text-gray-400 hover:bg-gray-200/70 dark:hover:bg-zinc-800 hover:text-gray-700 dark:hover:text-gray-200"
- title="Settings"
+ className="flex flex-col items-center gap-1 rounded-lg px-2 py-1.5 transition-colors text-gray-500 dark:text-gray-400 hover:bg-gray-200/70 dark:hover:bg-zinc-800 hover:text-gray-700 dark:hover:text-gray-200"
>
<LuSettings className="w-[18px] h-[18px]" />
+ <span className="text-[10px] leading-none">Settings</span>
</button>
}
/>