Skip to content

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

Python

Use color-only selection for icon strip, auto-expand prompt textarea

Abi Raja55d4d496c285
diff --git a/frontend/src/components/sidebar/IconStrip.tsx b/frontend/src/components/sidebar/IconStrip.tsx
index 3245e1c7..fae96a51 100644
--- a/frontend/src/components/sidebar/IconStrip.tsx
+++ b/frontend/src/components/sidebar/IconStrip.tsx
@@ -45,8 +45,8 @@ function IconStrip({
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"
+ ? "text-gray-900 dark:text-white"
+ : "text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300"
}`}
>
<LuCode className="w-[18px] h-[18px]" />
@@ -60,8 +60,8 @@ function IconStrip({
onClick={onToggleHistory}
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"
+ ? "text-gray-900 dark:text-white"
+ : "text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300"
}`}
>
<LuClock className="w-[18px] h-[18px]" />
@@ -78,7 +78,7 @@ function IconStrip({
setSettings={setSettings}
trigger={
<button
- 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"
+ className="flex flex-col items-center gap-1 rounded-lg px-2 py-1.5 transition-colors text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300"
>
<LuSettings className="w-[18px] h-[18px]" />
<span className="text-[10px] leading-none">Settings</span>
diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx
index 9d6e920d..b27e6a48 100644
--- a/frontend/src/components/sidebar/Sidebar.tsx
+++ b/frontend/src/components/sidebar/Sidebar.tsx
@@ -83,6 +83,15 @@ function Sidebar({
commits[head] &&
commits[head].variants[commits[head].selectedVariantIndex].errorMessage;
+ // Auto-resize textarea to fit content
+ const autoResize = useCallback(() => {
+ const textarea = textareaRef.current;
+ if (textarea) {
+ textarea.style.height = "auto";
+ textarea.style.height = textarea.scrollHeight + "px";
+ }
+ }, []);
+
// Focus on the update instruction textarea when a variant is complete
useEffect(() => {
if (
@@ -93,6 +102,11 @@ function Sidebar({
}
}, [appState, isSelectedVariantComplete]);
+ // Reset textarea height when instruction changes externally (e.g., cleared after submit)
+ useEffect(() => {
+ autoResize();
+ }, [updateInstruction, autoResize]);
+
// Reset error expanded state when variant changes
useEffect(() => {
setIsErrorExpanded(false);
@@ -198,7 +212,10 @@ function Sidebar({
<textarea
ref={textareaRef}
placeholder="Tell the AI what to change..."
- onChange={(e) => setUpdateInstruction(e.target.value)}
+ onChange={(e) => {
+ setUpdateInstruction(e.target.value);
+ autoResize();
+ }}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
@@ -208,7 +225,7 @@ function Sidebar({
value={updateInstruction}
data-testid="update-input"
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"
+ 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 max-h-40"
/>
<div className="flex items-center justify-between px-3 pb-2">
<div className="flex items-center gap-1">
diff --git a/yarn.lock b/yarn.lock
index de6014d8..8c2a21b6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -254,6 +254,11 @@
dependencies:
"@babel/helper-plugin-utils" "^7.27.1"
+"@babel/runtime@^7.28.4":
+ version "7.28.6"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.28.6.tgz#d267a43cb1836dc4d182cce93ae75ba954ef6d2b"
+ integrity sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==
+
"@babel/template@^7.28.6", "@babel/template@^7.3.3":
version "7.28.6"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57"
@@ -1762,6 +1767,11 @@
dependencies:
undici-types "~6.21.0"
+"@types/prismjs@^1.0.0":
+ version "1.26.6"
+ resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.26.6.tgz#6ea27c126d645319ae4f7055eda63a9e835c0187"
+ integrity sha512-vqlvI7qlMvcCBbVe0AKAb4f97//Hy0EBTaiW8AalRnG/xAN5zOiWWyrNqNXeq8+KAuvRewjCVY1+IPxk4RdNYw==
+
"@types/prop-types@*":
version "15.7.15"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.15.tgz#e6e5a86d602beaca71ce5163fadf5f95d70931c7"
@@ -1779,6 +1789,20 @@
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.7.tgz#b89ddf2cd83b4feafcc4e2ea41afdfb95a0d194f"
integrity sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==
+"@types/react-syntax-highlighter@^15.5.13":
+ version "15.5.13"
+ resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-15.5.13.tgz#c5baf62a3219b3bf28d39cfea55d0a49a263d1f2"
+ integrity sha512-uLGJ87j6Sz8UaBAooU0T6lWJ0dBmjZgN1PZTrj05TNql2/XpC6+4HhMT5syIdFUUt+FASfCeLLv4kBygNU+8qA==
+ dependencies:
+ "@types/react" "*"
+
+"@types/react@*":
+ version "19.2.14"
+ resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.14.tgz#39604929b5e3957e3a6fa0001dafb17c7af70bad"
+ integrity sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==
+ dependencies:
+ csstype "^3.2.2"
+
"@types/react@^18.2.15":
version "18.3.27"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.27.tgz#74a3b590ea183983dc65a474dc17553ae1415c34"
@@ -3199,6 +3223,13 @@ fastq@^1.6.0:
dependencies:
reusify "^1.0.4"
+fault@^1.0.0:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13"
+ integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==
+ dependencies:
+ format "^0.2.0"
+
fb-watchman@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c"
@@ -3276,6 +3307,11 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358"
integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==
+format@^0.2.0:
+ version "0.2.2"
+ resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b"
+ integrity sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==
+
fraction.js@^5.3.4:
version "5.3.4"
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-5.3.4.tgz#8c0fcc6a9908262df4ed197427bdeef563e0699a"
@@ -3440,6 +3476,13 @@ hasown@^2.0.2:
dependencies:
function-bind "^1.1.2"
+hast-util-parse-selector@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz#352879fa86e25616036037dd8931fb5f34cb4a27"
+ integrity sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==
+ dependencies:
+ "@types/hast" "^3.0.0"
+
hast-util-to-jsx-runtime@^2.0.0:
version "2.3.6"
resolved "https://registry.yarnpkg.com/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz#ff31897aae59f62232e21594eac7ef6b63333e98"
@@ -3468,11 +3511,32 @@ hast-util-whitespace@^3.0.0:
dependencies:
"@types/hast" "^3.0.0"
+hastscript@^9.0.0:
+ version "9.0.1"
+ resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-9.0.1.tgz#dbc84bef6051d40084342c229c451cd9dc567dff"
+ integrity sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==
+ dependencies:
+ "@types/hast" "^3.0.0"
+ comma-separated-tokens "^2.0.0"
+ hast-util-parse-selector "^4.0.0"
+ property-information "^7.0.0"
+ space-separated-tokens "^2.0.0"
+
[email protected], he@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
+highlight.js@^10.4.1, highlight.js@~10.7.0:
+ version "10.7.3"
+ resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531"
+ integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==
+
+highlightjs-vue@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/highlightjs-vue/-/highlightjs-vue-1.0.0.tgz#fdfe97fbea6354e70ee44e3a955875e114db086d"
+ integrity sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==
+
html-escaper@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
@@ -4265,6 +4329,14 @@ lower-case@^2.0.2:
dependencies:
tslib "^2.0.3"
+lowlight@^1.17.0:
+ version "1.20.0"
+ resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.20.0.tgz#ddb197d33462ad0d93bf19d17b6c301aa3941888"
+ integrity sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==
+ dependencies:
+ fault "^1.0.0"
+ highlight.js "~10.7.0"
+
lru-cache@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
@@ -5083,6 +5155,11 @@ pretty-format@^29.0.0, pretty-format@^29.7.0:
ansi-styles "^5.0.0"
react-is "^18.0.0"
+prismjs@^1.30.0:
+ version "1.30.0"
+ resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.30.0.tgz#d9709969d9d4e16403f6f348c63553b19f0975a9"
+ integrity sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==
+
progress@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
@@ -5302,6 +5379,18 @@ react-style-singleton@^2.2.2, react-style-singleton@^2.2.3:
get-nonce "^1.0.0"
tslib "^2.0.0"
+react-syntax-highlighter@^16.1.0:
+ version "16.1.0"
+ resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-16.1.0.tgz#ebe0bb5ae7a3540859212cedafd767f0189c516c"
+ integrity sha512-E40/hBiP5rCNwkeBN1vRP+xow1X0pndinO+z3h7HLsHyjztbyjfzNWNKuAsJj+7DLam9iT4AaaOZnueCU+Nplg==
+ dependencies:
+ "@babel/runtime" "^7.28.4"
+ highlight.js "^10.4.1"
+ highlightjs-vue "^1.0.0"
+ lowlight "^1.17.0"
+ prismjs "^1.30.0"
+ refractor "^5.0.0"
+
react@^18.2.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
@@ -5328,6 +5417,16 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
+refractor@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/refractor/-/refractor-5.0.0.tgz#85daf0448a6d947f5361796eb22c31733d61d904"
+ integrity sha512-QXOrHQF5jOpjjLfiNk5GFnWhRXvxjUVnlFxkeDmewR5sXkr3iM46Zo+CnRR8B+MDVqkULW4EcLVcRBNOPXHosw==
+ dependencies:
+ "@types/hast" "^3.0.0"
+ "@types/prismjs" "^1.0.0"
+ hastscript "^9.0.0"
+ parse-entities "^4.0.0"
+
relateurl@^0.2.7:
version "0.2.7"
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"