Skip to content

fix(ui): keep mobile layouts inside safe areas with consistent margins - #160388

Merged
roboclaw-bot merged 6 commits into
mainfrom
openclaw/glow-lobster
Sep 28, 2026
Merged

roboclaw-bot merged 6 commits into
mainfrom
openclaw/glow-lobster

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • 11 viewport/lifecycle unit tests passed (2.11s wrapper wall; viewport cases approximately 19ms).
  • 38 focused browser tests passed: 7 desktop/mobile/PWA geometry scenarios, 22 login cases, and 9 approval cases. The seven-scenario lane took 26.75s; the login lane took 33.23s. Existing focused footer-layout sibling also passed (148ms test / 2.03s wrapper wall).
  • The same seven geometry scenarios on frozen main failed six mobile cases and passed desktop, establishing regression coverage.
  • Independent autoreview of the final candidate found no actionable P0–P2 findings. UI typecheck, targeted TypeScript lint, stylesheet lint, formatting, and diff checks passed. Testbox was used because the local browser HTTP preflight was blocked; no security controls were disabled.
  • At 390×844 with zero insets, Chat/progress side insets change from 16px to 20px and New Session from 36px to 20px; the composer bottom remains 838px. At 1440×900, New Session, generating, and progress PNGs are byte-identical; idle chat has two background-pixel differences with identical measured boxes.
  • The requested self-contained comparison HTML was delivered in the originating conversation, with slider, keyboard controls, scene switching, and persisted/exportable feedback verified.

Production candidate verification

After resolving the single stylesheet conflict with main, the exact candidate tree 3540c176785a7f6796a66da59518223294653db2 (head 97eb43604a0415d7e8a932c909e96e4bc2414ddd) 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 a5da44cb804b321b6698469688b738c1c37ab064 changes 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.

  • Exact-a5 replay: 19 failures and 60 passes reproduced in 135.50s (three genuine compact-layout failures; sixteen stale fixture assertions).
  • Fixed tree 0418e89cf76fbbf0c97835841c8ab78a033c9584: 87 browser tests across 9 files passed in 98.98s, covering desktop, zero-inset phones, portrait/landscape, simulated standalone/keyboard, LTR/RTL, and model/effort controls with Files narrowing the composer. Verified Testbox run; lease stopped.
  • 11 static siblings passed (2.89s wrapper), UI and canonical UI-E2E typechecks, typed lint, stylelint, formatting, diff checks, and fresh independent P0–P2 review passed. The inherited token definition was also inspected directly.
  • Full required CI remains a separate admission gate. The remaining snapshot-clock/theme/hovercard failures were investigated rather than silently skipped; the clock-contract correction and final proof are below.
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.

Before After
Before: 320px compact control group After: compact spacing with 44px targets preserved

Final projection-clock verification

Head 006e87baf4192f7c7d7dedce181a9cc2657e72ec, tree 41637ca138c5280479a591696b042dbd8443eefa, 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 values t, t+1, and t+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.

  • 15/15 selected browser cases passed on the exact tree: 3 standalone preview cases (45s command wall; changed case 2.549s) plus 5 rename-composition and 7 mobile-geometry cases (37s command wall). The real standalone UI/client/server startup accounts for most preview-command cost; the other 14 cases in that file were not selected, not claimed passed.
  • Fixture unit 1/1, canonical UI-E2E typecheck, changed-file typed lint, formatting, whitespace checks, and independent P0–P2 review passed.
  • Testbox admission stayed queued without a machine. The documented owned-AWS fallback passed preflight and used a standard instance, with exact source/tree verification before and after execution. Crabbox proof run. Its lease is released, confirmed by native readback. No permission changes or CI-gate bypass were used.
  • The unchanged font-readiness and tooltip cases passed focused candidate replay and the matching scheduled-main cases. The earlier resource delay was not recorded; the supported lazy-upgrade race was not reproduced, so those passing replays are not presented as fixes.

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.

Before After
Before: mobile progress and composer After: shared mobile margins

Worked on by

Work sessions


View the OpenClaw team session

roboclaw-bot and others added 2 commits September 28, 2026 11:14
Worked on by:
- @hxy91819

Co-authored-by: hxy91819 <[email protected]>
OpenClaw-Publication: 9abfad1b-0da3-4087-86a5-3bff3d0cd997
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 10:06 AM ET / 14:06 UTC (Revision 5).

ClawSweeper review

What this changes

The 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
Reviewed head: 006e87baf4192f7c7d7dedce181a9cc2657e72ec
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has coherent ownership and substantial browser and visual evidence, with one material platform-proof decision outstanding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before-and-after screenshots show the changed mobile margins and compact controls, and the PR reports after-fix Chromium app-entry runs across Chat, New Session, and simulated viewport states. Those observations support the browser layout change, while native iPhone PWA behavior remains a separate merge risk. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before-and-after screenshots show the changed mobile margins and compact controls, and the PR reports after-fix Chromium app-entry runs across Chat, New Session, and simulated viewport states. Those observations support the browser layout change, while native iPhone PWA behavior remains a separate merge risk. No stored-data contract changes.
Evidence reviewed 7 items Current main still needs the change: Current main retains the 12px mobile inset and percentage-height app root, and has no shell viewport owner; the PR's changed UI paths have no intervening main-branch changes.
Introduced viewport owner: The app root connects the viewport observer, which updates canvas height and bottom safe-area handling on visual viewport changes.
Shared safe-area geometry: The proposed CSS gives the app root physical safe-area padding and derives its canvas from dynamic or standalone viewport units.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Is the simulated browser-contract evidence sufficient to merge this installed-PWA layout change without an iPhone keyboard and safe-area capture? Require device proof: Capture the installed iPhone PWA with the keyboard open and closed, showing the composer and fixed controls inside the physical safe areas.

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

  • Resolve merge risk (P1) - Installed iPhone Safari or WKWebView PWA keyboard transitions and physical safe-area placement remain unverified; a device-specific shift could leave the composer or fixed controls misplaced after merge.
  • Complete next step (P2) - Have a Control UI owner resolve the installed-iPhone PWA proof gap before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +99, Tests +667, Docs +2. Total +768 across 37 files.

View PR surface stats
Area Files Added Removed Net
Source 21 229 130 +99
Tests 15 825 158 +667
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 37 1056 288 +768

Review metrics

Metric Value Why it matters
Production and test lines production +229/−130; tests +825/−158 The production growth introduces one shared viewport owner and replaces scattered inset calculations; the larger test change exercises its app-entry behavior.

Merge-risk options

Maintainer options:

  1. Prove the installed layout (recommended)
    Provide inspected iPhone PWA captures with the keyboard open and closed and with physical safe-area insets.
  2. Own the device uncertainty
    A Control UI owner may accept the simulated coverage and record the remaining device-specific risk before landing.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a user-visible mobile layout repair with limited blast radius and no demonstrated runtime outage.
  • merge-risk: 🚨 compatibility: The PR changes viewport sizing and safe-area handling across existing routes and native embeds, while installed-iPhone behavior remains unverified.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before-and-after screenshots show the changed mobile margins and compact controls, and the PR reports after-fix Chromium app-entry runs across Chat, New Session, and simulated viewport states. Those observations support the browser layout change, while native iPhone PWA behavior remains a separate merge risk. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before-and-after screenshots show the changed mobile margins and compact controls, and the PR reports after-fix Chromium app-entry runs across Chat, New Session, and simulated viewport states. Those observations support the browser layout change, while native iPhone PWA behavior remains a separate merge risk. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before-and-after screenshots show the changed mobile margins and compact controls, and the PR reports after-fix Chromium app-entry runs across Chat, New Session, and simulated viewport states. Those observations support the browser layout change, while native iPhone PWA behavior remains a separate merge risk. No stored-data contract changes.

Evidence

What I checked:

  • Current main still needs the change: Current main retains the 12px mobile inset and percentage-height app root, and has no shell viewport owner; the PR's changed UI paths have no intervening main-branch changes. (ui/src/styles/base.css:273, 3e0def1451b3)
  • Introduced viewport owner: The app root connects the viewport observer, which updates canvas height and bottom safe-area handling on visual viewport changes. (ui/src/app/shell-viewport.ts:33, 006e87baf419)
  • Shared safe-area geometry: The proposed CSS gives the app root physical safe-area padding and derives its canvas from dynamic or standalone viewport units. (ui/src/styles/base.css:815, 006e87baf419)
  • Browser coverage and its limit: The added seven-scenario app-entry suite checks desktop, phone, landscape, and simulated standalone geometry, including keyboard open, pan, and dismissal. Its source explicitly identifies the keyboard behavior as a simulated VisualViewport contract rather than native input-method proof. (ui/src/e2e/mobile-shell-geometry.e2e.test.ts:254, 006e87baf419)
  • Inspected visual proof: The PR body's downloaded before-and-after images visibly show a more consistent mobile chat margin and a compact 320px control arrangement. The PR body reports real Chromium app-entry runs and explicitly says physical iPhone proof was unavailable. (006e87baf419)
  • Prior review continuity: The completed review at the earlier head had no code findings and requested installed-iPhone PWA keyboard and safe-area evidence. The current PR body acknowledges that request without claiming to have fulfilled it. (429f33dc345e)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture the resolved layout on an installed iPhone PWA with the keyboard open and closed, including physical safe-area placement.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-28T11:23:30.761Z sha e1c028b :: blocked before merge. :: none
  • reviewed 2026-09-28T11:35:17.729Z sha 97eb436 :: blocked before merge. :: none
  • reviewed 2026-09-28T12:18:35.407Z sha a5da44c :: blocked before merge. :: none
  • reviewed 2026-09-28T13:20:49.355Z sha 429f33d :: blocked before merge. :: none

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]>
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 28, 2026 11:27
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]>
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) September 28, 2026 12:15
roboclaw-bot and others added 2 commits September 28, 2026 13:08
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]>
@roboclaw-bot
roboclaw-bot merged commit cbc0f01 into main Sep 28, 2026
100 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/glow-lobster branch September 28, 2026 14:32
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant