diff --git a/frontend/src/index.css b/frontend/src/index.css index ae3e31d..81b202a 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -339,6 +339,10 @@ body { max-width: 100%; } +.canvas-area--relative { + position: relative; +} + canvas { display: block; max-width: 100%; @@ -1003,33 +1007,76 @@ select:focus { } /* ===================================================== - PROMPT EDITOR + PROMPT BAR (collapsible bottom panel in canvas-area) ===================================================== */ -.prompt-editor { - width: 100%; - display: flex; - flex-direction: column; - gap: 6px; +.prompt-bar { + position: absolute; + bottom: 0; + left: 0; + right: 0; background: var(--surface); - border: 1px solid var(--border); - border-radius: var(--r-lg); - padding: 10px; - flex: 1; - min-height: 0; + border-top: 1px solid var(--border); + z-index: 10; + box-shadow: 0 -4px 16px rgba(13,21,38,.08); } -.prompt-editor-toolbar { +.prompt-bar-header { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 14px; + cursor: pointer; + user-select: none; + min-height: 40px; +} + +.prompt-bar-header:hover { + background: var(--surface-2); +} + +.prompt-bar-chevron { + font-size: 11px; + color: var(--text-3); + flex-shrink: 0; + width: 12px; +} + +.prompt-bar-title { + font-size: 11px; + font-weight: 700; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--text-3); +} + +.prompt-bar-layout-name { + font-size: 12px; + color: var(--text-2); + background: var(--surface-2); + border: 1px solid var(--border); + border-radius: var(--r-full); + padding: 1px 8px; +} + +.prompt-bar-actions { display: flex; align-items: center; gap: 6px; - flex-wrap: wrap; + margin-left: auto; +} + +.prompt-bar-body { + padding: 0 14px 12px; + display: flex; + flex-direction: column; + gap: 8px; } .prompt-layout-select { width: auto !important; - min-width: 120px; - max-width: 200px; - font-size: 12.5px !important; + min-width: 110px; + max-width: 180px; + font-size: 12px !important; padding: 4px 8px !important; } @@ -1037,7 +1084,7 @@ select:focus { display: flex; align-items: center; gap: 6px; - padding: 8px 10px; + padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); @@ -1051,8 +1098,8 @@ select:focus { .prompt-textarea { width: 100%; - flex: 1; - min-height: 180px; + min-height: 160px; + max-height: 40vh; resize: vertical; padding: 10px 12px; background: var(--surface-2); diff --git a/frontend/src/pages/GenerateIt.tsx b/frontend/src/pages/GenerateIt.tsx index d414b65..658b533 100644 --- a/frontend/src/pages/GenerateIt.tsx +++ b/frontend/src/pages/GenerateIt.tsx @@ -139,6 +139,7 @@ export default function GenerateIt() { const [promptText, setPromptText] = useState(() => loadLayouts()[0]?.prompt ?? DEFAULT_PROMPT) const [showSaveDialog, setShowSaveDialog] = useState(false) const [newLayoutName, setNewLayoutName] = useState('') + const [promptOpen, setPromptOpen] = useState(false) const currentPicture: DirectusPicture | null = currentIndex >= 0 && currentIndex < pictureList.length ? pictureList[currentIndex] : null @@ -288,78 +289,81 @@ export default function GenerateIt() { - {/* Center: Canvas + Prompt Editor */} -
-
-
- {}} - readOnly - /> -
+ {/* Center: Canvas + Prompt Bar */} +
+
+ {}} + readOnly + />
- {/* Prompt Editor */} -
-
- - {selectedLayoutName !== 'Standard' && ( - + )} + - +
+
+ + {promptOpen && ( +
+ {showSaveDialog && ( +
+ setNewLayoutName(e.target.value)} + onKeyDown={e => { if (e.key === 'Enter') handleSaveLayout(); if (e.key === 'Escape') setShowSaveDialog(false) }} + autoFocus + /> + + +
+ )} +