Repository navigation
fix(ui): keep mobile layouts inside safe areas with consistent margins - #160388
Conversation
Co-authored-by: hxy91819 <[email protected]>
Worked on by: - @hxy91819 Co-authored-by: hxy91819 <[email protected]> OpenClaw-Publication: 9abfad1b-0da3-4087-86a5-3bff3d0cd997
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 28, 2026, 10:06 AM ET / 14:06 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch makes the Control UI app root manage safe-area and viewport sizing, aligns mobile Chat and New Session margins and overlays, and updates related documentation and tests. Merge readiness⛔ Blocked before merge - 3 items remain Current main still has the inconsistent mobile layout, and the proposed fix has credible browser and visual evidence. The earlier review’s installed-iPhone proof concern remains unresolved, so a Control UI owner should decide whether device evidence is required before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI app root receives browser viewport dimensions and device safe-area insets. It sets the usable canvas for chat, setup, approval pages, navigation, and overlays. flowchart LR
A[Browser viewport] --> B[Control UI app root]
C[Device safe areas] --> B
B --> D[Usable canvas]
D --> E[Chat and New Session]
D --> F[Login and approvals]
D --> G[Menus and overlays]
Decision needed
Why: The earlier review requested device evidence, and the PR explicitly states that the author could not obtain it; deciding whether to accept that platform uncertainty requires maintainer judgment. Before merge
Agent review detailsSecurityNone. PR surfaceSource +99, Tests +667, Docs +2. Total +768 across 37 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the app root as the single viewport and safe-area owner, and establish the installed-iPhone behavior before treating the PWA layout as verified. Do we have a high-confidence way to reproduce the issue? Yes, at the source and browser-contract level: current main retains the mismatched layout rules, and the PR supplies baseline captures and a failing-before, passing-after geometry suite. This read-only review did not run the suite. Is this the best way to solve the issue? Yes, a single app-root geometry owner is a maintainable fit for the affected routes. Installed-iPhone behavior still needs a proof decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3e0def1451b3. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Preserve the shared mobile gutter and the current main owner-set chat shell selectors. Verified the exact merged tree with 38 browser tests, 11 unit/lifecycle tests, root-class transition coverage, UI typecheck, stylesheet lint, and independent autoreview. Co-authored-by: hxy91819 <[email protected]>
Keep the toast safe-bottom assertion at 800px, inject physical insets at their root owner, and cover keyboard canvas shortening and restoration. Update the expanded composer assertion to the accepted 20px mobile gutter. No production changes. Co-authored-by: hxy91819 <[email protected]>
Use the existing compact chip-gap token instead of forcing the desktop gap on 320px model and effort controls. Preserve both 44px targets and all overlap/reachability assertions. Update sibling fixtures to physical safe-area emulation and actual geometry; 87 browser cases and 11 static siblings pass. Co-authored-by: hxy91819 <[email protected]>
Integrate the exact main snapshot-clock owner already present in the failing CI merge, then drive distinct per-read Date values in the existing preview test. Preserve all stable metadata, transcript contents and ordering comparisons. Fixture unit, canonical E2E typecheck, typed lint, independent review and all 15 selected browser cases pass; mobile styles and app lifecycle are unchanged. Co-authored-by: hxy91819 <[email protected]>
|
Merged via squash.
|
openclaw#160388) * fix(ui): keep mobile layouts inside safe areas with consistent margins Co-authored-by: hxy91819 <[email protected]> * fix(ui): keep mobile layouts inside safe areas with consistent margins Worked on by: - @hxy91819 Co-authored-by: hxy91819 <[email protected]> OpenClaw-Publication: 9abfad1b-0da3-4087-86a5-3bff3d0cd997 * test(ui): align sibling layout checks with shared safe-area ownership Keep the toast safe-bottom assertion at 800px, inject physical insets at their root owner, and cover keyboard canvas shortening and restoration. Update the expanded composer assertion to the accepted 20px mobile gutter. No production changes. Co-authored-by: hxy91819 <[email protected]> * fix(ui): preserve compact composer targets within shared mobile gutters Use the existing compact chip-gap token instead of forcing the desktop gap on 320px model and effort controls. Preserve both 44px targets and all overlap/reachability assertions. Update sibling fixtures to physical safe-area emulation and actual geometry; 87 browser cases and 11 static siblings pass. Co-authored-by: hxy91819 <[email protected]> --------- Co-authored-by: hxy91819 <[email protected]>
What Problem This Solves
Fixes inconsistent mobile side margins and controls extending into device safe areas in the installed Control UI, especially when the keyboard opens or closes.
User Impact
Chat and New Session use the same mobile reading column, with controls kept inside the browser-reported safe area. Phones with zero insets do not gain an extra bottom band, and tested desktop layouts remain unchanged. No configuration changes or migration are needed.
Known limit: iPhone PWA, safe-inset, and keyboard cases are simulated browser contracts, not physical iPhone/Safari/WKWebView certification.
Why This Change Was Made
The application root now consumes physical safe areas once and owns visual-viewport observation, including login and approval/question routes. Ordinary tabs follow the dynamic viewport; installed PWAs use the full standalone canvas. Keyboard-sized viewport reductions adjust available height without treating input focus alone as an open keyboard. Mobile content and fixed/popover surfaces share the same geometry instead of adding independent offsets.
Evidence
Production candidate verification
After resolving the single stylesheet conflict with main, the exact candidate tree
3540c176785a7f6796a66da59518223294653db2(head97eb43604a0415d7e8a932c909e96e4bc2414ddd) passed all 38 browser tests again (65.04s), 11 viewport/lifecycle tests (3.84s), and the root-class transition regression (2.18s). UI typecheck (9.03s), all 18 changed stylesheets (0.88s), and fresh independent autoreview passed. The resolution retains both the shared mobile gutter and main's owner-set chat-shell classes. Testbox run; its source capsule and all changed UI bytes were verified, and the lease is stopped. Representative merged-candidate captures were inspected without clipping. The platform-proof limitation above still applies.CI correction and review follow-up
The first required CI run exposed two stale sibling-test contracts. Commit
a5da44cb804b321b6698469688b738c1c37ab064changes tests only: the expanded composer now expects the accepted 20px gutter, and the toast test injects the physical inset at its root owner rather than on an unrelated descendant. The toast still must end at 800px with a 24px inset; new assertions also require 580px while the shared canvas is 600px with keyboard inset zero, then restoration to 800px. Both failing cases now pass locally (5.08s across two focused runners), the complete four-test toast suite passes (4.05s), targeted lint and fresh independent autoreview pass. Production code in that test-only commit was byte-identical to the tested candidate above. The later narrow-screen correction is described below.ClawSweeper found no actionable code/security issue but requested installed-iPhone captures. That native-device request is acknowledged, not claimed fulfilled: no physical iPhone/Mac is available in this verification environment. We retain it as follow-up platform validation rather than asserting Safari/WKWebView certification. The landing assessment uses the exercised browser contracts and actual app-entry tests, with the device-specific uncertainty disclosed above; no new platform-support guarantee is introduced.
Narrow-screen regression follow-up
Head 429f33d fixes the remaining task-related layout failures. At 320px, two 44px model/effort targets plus a forced 4px gap needed 92px inside a 90px group. The sole production adjustment uses the existing compact 2px spacing token while retaining the desktop 4px seam. The non-overlap/reachability assertions and both 44px targets are unchanged. Six fixture/support files now measure actual screen bounds and physical CDP insets rather than expecting the retired consumer-owned padding.
320px compact-control comparison
Same 320×900 synthetic Chromium scene: a5da44c before → 429f33d after. The after image includes focus returned to the model control after Escape; the ring is keyboard focus, not a new control. These are not physical iPhone captures.
Final projection-clock verification
Head
006e87baf4192f7c7d7dedce181a9cc2657e72ec, tree41637ca138c5280479a591696b042dbd8443eefa, integrates the exact main commit that introduced mock per-read sampling (b7e2666) because it was already part of the failing CI merge. The only newly authored delta is the existing preview test: describe/history/startup read at controlled Date valuest,t+1, andt+2, while timers keep running. All stable metadata, session identity, transcript contents/order, and final endpoint parity remain checked. The production sampler is not frozen or changed. Mobile styles and app lifecycle bytes remain unchanged from the verified narrow-screen revision.Required GitHub checks remain authoritative for landing this exact head. The iPhone/Safari/WKWebView limitation above is unchanged.
Before / after
Same frozen main baseline (6d8d777), 390×844 responsive Chromium viewport, zero safe-area insets, synthetic conversation. These are not npm 2026.9.5 or the user's original iPhone screenshots. Only the model label is redacted; layout and capture dimensions are unchanged.
Worked on by
Work sessions
View the OpenClaw team session