fix(builder): fold correctly on OpenStation's phone layer - #56
AllTerrainDeveloper merged 3 commits into
Conversation
On a phone the shell forces the builder full-screen at ~360px and the window still laid itself out for a desktop: the folded rails left a 28px sliver painted over the canvas (a 0px track does not zero the item's own padding), the canvas list's implicit auto track sized itself to a card's min-content so every card ran off the right edge, the tab strip clipped its last tab, and the toolbar ran to 885px with Save cut off. A tap on a palette chip added nothing, because the field was only ever added through the drag manager's click-only callback and the shell refuses every drag on a phone by returning null from start(). - Fold a rail's padding and border with its track; the rail rules now sit above the container queries, since they win only by coming later. - Give the canvas list an explicit minmax(0, 1fr) column, and make the card preview the `atf-form` container form.css asks about, so composite fields and half-width rows fold in a card at the width they fold on the published form. - Scroll the tab strip sideways and wrap the toolbar icon-only (labels stay for assistive tech) below 640px. - Let a chip's own click add the field when the manager declined the press — which also makes keyboard activation work. - Below 640px the inspector takes the whole width and carries Done; the palette opens as a full-width sheet from an "Add a field" button under the canvas, closes on a tap, and is exclusive with a selection. - Raise the builder's own inputs to 16px under the mobile stamp, per the shell's mobile contract (the card preview keeps the theme's size). Tests pin the chip tap under a declining manager and the stylesheet's cascade order; both were watched failing against the old code. Fixes #1. Upstream: AllTerrainDeveloper#55. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Before / after on the phone layerShot with Playwright (Chrome, 390×844 @2x, iPhone UA) against WordPress 7.1 + OpenStation 1.1.9, same Contact form, same Playground instance — only the plugin files were swapped between the two rows.
What to look for, top row → bottom row: the And the one state that did not exist before — adding a field on a phone, where the shell refuses every drag: "Add a field" under the canvas opens the palette as a full-width sheet; a tap on a chip appends the field and closes it. |
|
Oh gosh! I never tested it in mobile 😄 That's great! I'll update the plugin with this awesome change ASAP! |
Publish the mobile builder changelog, add juanml to WordPress.org contributors, and align release versions. Isolate deferred work in the phone tests and regenerate the development bundle.
Cover adding, saving and reopening fields at phone width and returning to desktop. Use consistent CommonJS wrappers so module-loading races cannot change the committed builder bundles in CI.
ac01c63
into
AllTerrainDeveloper:main





Summary
The builder was unusable on OpenStation's phone layer (
data-os-mode="mobile", ≤ 767px). Every item below was reproduced at 375×812 on WordPress 7.1 + OpenStation 1.1.9 before the fix and re-measured after it, and the desktop three-pane layout at 1440px was checked to be unchanged.TE…/CH…fragments painted down the canvas's left edge; a 29px inspector box on the right0pxbut the rails keeppadding: 14px;overflow: hiddenclips at the padding edge.atfb-canvas__listhad an implicitautocolumn sized to the widest card's min-content; the card preview has noatf-formcontainer ancestor, so form.css never stacked the Name field's two inputsgrid-template-columns: minmax(0, 1fr); the preview is theatf-formcontainer, so a card folds at the width the published form foldsConfirmationsclipped.atfb-tabsisnowrap.atfb-bar__rightnever wrapsonClickOnly; on a phone the shell'sdragManager.start()returnsnulland that callback never existsAlso: the builder's own inputs are 16px under the mobile stamp, per
docs/mobile.md(the card preview is exempt so it still shows the theme's size).Theme Studio and Analytics already folded correctly and are untouched. Entries stacks list-over-detail on a phone; usable, left for a follow-up.
Tests
tests/vitest/builder-phone.test.ts: the chip tap under a declining drag manager (and no double-add when the manager takes the press), plus the stylesheet's cascade order and the two container facts. Both behavioural assertions were watched failing against the old code. Full suite: 469 passed.tsc --noEmitclean.Fixes #55.
🤖 Generated with Claude Code