Submissions draft editor: preview pane overlaid by form on mobile — stack below or tab-toggle #91
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
m's report (2026-05-25 14:52)
Scope
On the submission-draft editor (
/submissions/draft/{id}for project-less drafts and/projects/{id}/submissions/{code}/draft/{id}for project-scoped drafts) the layout at mobile widths fails: the preview pane gets overlaid by the variable-editor form rather than reflowing to below it or switching to a tab.What to do
frontend/src/submission-draft.tsx+frontend/src/client/submission-draft.ts— likely two-column flex/grid with no responsive collapse. The overlay is probably anposition: absoluteor shared-stacking-context that collapses incorrectly when columns wrap.<button>row at top with "Variablen" / "Vorschau" that swaps which pane is visible. Closer to a native-app feel.position: absoluteor layered z-indexing that pushes one pane over another on narrow screens.Files most likely touched
frontend/src/submission-draft.tsxfrontend/src/client/submission-draft.tsfrontend/src/styles/global.css— mobile breakpoint rules for.submission-draft-*classesHard rules
go build ./... && go test ./internal/... && cd frontend && bun run buildclean.mai/<worker>/submission-draft-mobile-layout.Out of scope
Reporting
mai report completedwith branch + SHAs + chosen approach (A/B) + verification path on paliad.de mobile viewport: open /submissions/draft/47599031-dfd3-4294-afac-ba643195a141 at 375px → confirm preview is visible (below or via tab), no overlap with variable editor.Done — chose Approach A (stack vertically).
Root cause
.submission-draft-gridalready collapsed to one column at≤900px, but.submission-draft-sidebarkeptposition: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: autoat all widths. On mobile that meant: variable editor pinned to the top of the viewport, occupying almost full viewport height, scrolling along with the user — so as the user scrolled down to read the preview, the form visually overlaid the preview pane.Not an
position: absoluteissue, not a z-index issue — just sticky behaviour misapplied below the column-collapse breakpoint.Fix
One CSS block appended after the unscoped
.submission-draft-sidebarrule (source-order needed to win at equal specificity), inside the same@media (max-width: 900px)where the grid already collapses:Sidebar now reflows above the preview, takes its natural height, and scrolls away as the user moves down. Desktop layout (≥901px) untouched.
Verification
Static repro from
frontend/dist/submission-draft.htmlwith the populated editor body injected (tall variable form + 30 preview paragraphs), Playwright at four widths:staticstaticstaticsticky360px 648pxScroll-behaviour check at 375px: after
window.scrollTo(0, 3400), sidebarbottom: -292px(fully out of viewport), previewtop: -268px(in viewport). Sidebar scrolls away, preview reads.Same renderer serves both URL shapes (
/submissions/draft/{id}for project-less drafts and/projects/{id}/submissions/{code}/draft/{id}for project-scoped), so the fix applies to both.Build status
cd frontend && bun run build— cleango build ./...— cleango test -short ./internal/...— clean (all packages pass)Branch / commit
Branch:
mai/hermes/gitster-submissionsCommit:
4cb99fb627Ready for review / merge.