From 29c4f076a7079982fc6e22f7bba07dc63379a68b Mon Sep 17 00:00:00 2001 From: Sahaj Chugh <135018977+sahajiscoding@users.noreply.github.com> Date: Thu, 24 Sep 2026 13:50:28 +0000 Subject: [PATCH] Dock the composer on the bottom edge of the studio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prompt bar sat ~260px above the bottom of the window on a 1440x900 display, over a band of dead ground, and on a 1366x768 laptop it floated across the middle of the third row of runs. Root cause: `.of-studio-app > .ohf` was a plain block. `.ohf-shell` asks for 100dvh, but inside the studio frame the frame owns the height — the surface fell back to its own content height (~620px) and the absolutely positioned dock pinned itself to the bottom of *that* box, not the window. Nothing in the dock knew where the window ended. Fix, two halves: - The studio surface is now the frame's elastic column (`.of-studio-app > .ohf`, with `min-height: 0` on `.ohf` and `.ohf-main`), so the shell stretches to the frame and the gallery takes everything left over. - The dock is the last row of that column instead of a layer over it. The composer now stands on the bottom edge by layout at every viewport size, and the last row of runs can never be buried behind an opaque plate — so the whole `--ohf-dock-h` measurement goes away: no ResizeObserver in Composer, no measured padding or scroll-padding-bottom in the gallery (24px of breathing room, 20px on phones), no `pointer-events` juggling in the selection states. Verified in a headless browser at 1920x1080, 1440x900, 1366x768, 1280x600, 1024x768 and 390x844: dock top equals gallery bottom exactly, the last fully-scrolled row of tiles is fully visible, a long prompt growing the composer takes its height from the gallery, and the model picker / selection toolbar / long-prompt states all stay on the bottom edge. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> --- src/app/studio/studio.css | 10 +++++ src/openhiggsfield/composer.tsx | 16 +------ src/openhiggsfield/openhiggsfield.css | 62 +++++++++++++-------------- 3 files changed, 41 insertions(+), 47 deletions(-) diff --git a/src/app/studio/studio.css b/src/app/studio/studio.css index 8a2ee49..2aef548 100644 --- a/src/app/studio/studio.css +++ b/src/app/studio/studio.css @@ -31,9 +31,19 @@ display: flex; } +/* The studio surface is the frame's last elastic row, and a column of its own: + top bar, gallery, composer. It has to be told so — a plain block here left + `.ohf-shell` at its content height, which collapsed the surface to ~620px on + a 1440×900 window and stranded the bottom-pinned composer ~260px above the + real bottom edge, over a band of empty ground. As a column flex container the + shell stretches to the frame, the gallery takes what is left over it, and the + composer lands on the bottom edge at every viewport size. */ .of-studio-app > .ohf { flex: 1 1 auto; min-width: 0; + min-height: 0; + display: flex; + flex-direction: column; } .of-studio-workspace > .ohf { diff --git a/src/openhiggsfield/composer.tsx b/src/openhiggsfield/composer.tsx index 41e9bf1..5adcaba 100644 --- a/src/openhiggsfield/composer.tsx +++ b/src/openhiggsfield/composer.tsx @@ -93,7 +93,6 @@ export function Composer({ const [overlay, setOverlay] = useState(null); const [anchor, setAnchor] = useState({ x: 0, y: 0 }); const [shortcut, setShortcut] = useState(null); - const dockRef = useRef(null); const wrapRef = useRef(null); const promptRef = useRef(null); /* A run in flight is not a lock: it holds its own tile in the grid, so the @@ -120,19 +119,6 @@ export function Composer({ settings.set(model.id, { [native.key]: native.kind === "enum" ? String(next) : next }); } - /* The dock floats over the gallery, so the gallery cannot reserve its height - from layout. It reads it from here instead, and the last row keeps clearing - a composer that grew — a long prompt, a media strip, the undo receipt. */ - useEffect(() => { - const dock = dockRef.current; - if (!dock) return; - const observer = new ResizeObserver(() => { - dock.parentElement?.style.setProperty("--ohf-dock-h", `${dock.offsetHeight}px`); - }); - observer.observe(dock); - return () => observer.disconnect(); - }, []); - useEffect(() => { if (!overlay) return; const onPointerDown = (event: PointerEvent) => { @@ -225,7 +211,7 @@ export function Composer({ : `${generateLabel} · ${shortcut ?? "⌘↵"}`; return ( -
+