Repository navigation
Dock the composer on the bottom edge of the studio - #5
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -6 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
The PR successfully refactors the layout to use a flexbox model, pinning the composer to the bottom edge of the studio and preventing it from obscuring gallery content. This change removes the previous dependency on ResizeObserver for height calculations, simplifying the codebase. Codacy results confirm the implementation is up to standards with no new issues or complexity regressions.
While the implementation aligns with the requirements, there are several missing test scenarios. These are critical to ensure that the flex layout handles edge cases like auto-growing input fields and various viewport dimensions without overlapping content or breaking the selection toolbar.
Test suggestions
- Verify composer pins to the bottom of the viewport at various heights (e.g., 1440x900, 1366x768)
- Verify that scrolling to the end of the gallery displays the last row of runs completely without overlap
- Verify that increasing the number of lines in the composer (auto-grow) reduces the gallery height instead of overlapping it
- Verify that the selection toolbar correctly displays and functions in the new flex layout
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify composer pins to the bottom of the viewport at various heights (e.g., 1440x900, 1366x768)
2. Verify that scrolling to the end of the gallery displays the last row of runs completely without overlap
3. Verify that increasing the number of lines in the composer (auto-grow) reduces the gallery height instead of overlapping it
4. Verify that the selection toolbar correctly displays and functions in the new flex layout
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
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>
90fd48d to
29c4f07
Compare
The bug
The prompt bar ("chat bar") did not sit at the bottom of the window. On a 1440×900 display it stood ~260px above the bottom edge over a band of dead ground; on a 1366×768 laptop it floated across the middle of the third row of runs.
Root cause:
.of-studio-app > .ohfwas a plain block..ohf-shellasks for100dvh, but inside the studio frame the frame owns the height, so the surface fell back to its own content height (~620px) and the absolutely-positioned dock pinned itself to the bottom of that box rather than the window. Nothing in the dock knew where the window ended.The fix
Two halves, both in the layout rather than in magic numbers:
.of-studio-app > .ohfgetsdisplay:flex; flex-direction:column; min-height:0(plusmin-height:0on.ohfand.ohf-main), so the shell stretches to the frame and the gallery takes everything left over.Because the dock is in flow now, the whole
--ohf-dock-hmeasurement disappears: noResizeObserverinComposer, no measuredpadding/scroll-padding-bottomin the gallery (24px of breathing room, 20px on phones), and nopointer-eventsjuggling for the selection states.Verification
Measured in a headless Chromium at 1920×1080, 1440×900, 1366×768, 1280×600, 1024×768 and 390×844 (phone):
Also exercised: model picker open, selection toolbar (desktop + phone), a 250-character prompt growing the composer (the gallery gives up the height instead of the tiles being covered), and the empty state.
npx tsc --noEmitpasses.