Skip to content

fix(ui): lock the app root scroll in every host, not just standalone PWAs - #107102

Merged
steipete merged 2 commits into
mainfrom
claude/macos-settings-scroll-fix-cad2f2
Jul 14, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/macos-settings-scroll-fix-cad2f2

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

In the macOS app (Settings takeover, e.g. Settings → About), scrolling the content pane could drag the whole page up — settings sidebar, titlebar clearance, everything — leaving the sidebar header stranded under the traffic lights. The page-level scroll should never move; only the settings content pane or the sidebar nav list should scroll.

Why This Change Was Made

ui/src/styles/base.css already documents the contract — "inner panes scroll, the root never should" — but the actual root scroll lock (overflow: hidden on html/body/openclaw-app) was gated behind @media (display-mode: standalone). The macOS app's WKWebView is native web chrome (html.openclaw-native-web-chrome), not PWA-standalone, so the document stayed scrollable and WKWebView happily scrolled/rubber-banded the whole shell.

Fix: hoist the root lock out of the standalone gate so it applies in every host (browser tab, PWA, Mac app WKWebView):

  • html, body { overflow: clip } — clip instead of hidden because hidden roots can still be displaced programmatically (focus/scrollIntoView), which would strand the shell off-screen with no way to scroll back; clip forbids all root scrolling.
  • openclaw-app becomes height: 100% (was min-height: 100vh), matching what the standalone block already did.
  • The standalone media block keeps only what is genuinely standalone-specific (dvh sizing, fixed body + safe-area insets); its duplicate overflow/size rules are deleted.
  • The pre-app .mount-fallback error surface in ui/index.html gets its own scroller since the body no longer scrolls for it.

All top-level surfaces already own their scrolling (.shell is 100dvh/overflow: hidden with .content and .settings-sidebar__nav as scrollers; login gate and approval page are self-contained 100dvh boxes with overflow-y: auto), so nothing legitimately relied on document scroll. The two window-level scroll listeners (github-link-hovercard, chat-selection-popup) use capture and keep hearing inner-scroller events.

User Impact

macOS app users can no longer scroll the whole Settings page (or any page) as one unit; the settings sidebar stays pinned while the content pane and sidebar nav scroll independently. Same guarantee now holds for browser tabs and PWA installs.

Evidence

  • Live repro in the Control UI mock harness (pnpm dev:ui:mock) with the Mac app's native web chrome injection simulated (classes + 52px titlebar CSS from DashboardWindowController.installNativeChromeScript), on /settings/about:
    • Before: root had no lock outside standalone (html computed overflow-y: visible).
    • After: html/body compute overflow-y: clip; window.scrollTo(0, 999) + scrollIntoView leave window.scrollY, documentElement.scrollTop, body.scrollTop all 0, while .content (scrollTop 229/229 max) and .settings-sidebar__nav (200/274) scroll independently with the sidebar header pinned.
    • Chat route and 375×812 mobile viewport verified visually — thread scrolls, composer pinned, no layout regressions.
  • New regression test in ui/src/e2e/native-nav-sidebar-toggle.e2e.test.ts: forces document overflow in the Settings takeover under web chrome and asserts the root refuses to scroll (fails before this fix, passes after).
  • pnpm check:changed + focused e2e run on Blacksmith Testbox (IDs in comments below).

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 51b84e3:

  • pnpm check:changed on Blacksmith Testbox tbx_01kxfd0a3hhpp5zcsdgjkm1yrx: exit 0 (all changed lanes incl. oxlint ui/packages/src) — actions run 29305239026.
  • Focused e2e pnpm test ui/src/e2e/native-nav-sidebar-toggle.e2e.test.ts on Testbox tbx_01kxfdrp7vwmvwksxzr6vm63jm: 8/8 passed, including the new "keeps the document root scroll-locked in the Settings takeover" regression test — actions run 29305802835.
  • Autoreview (Codex gpt-5.6-sol, xhigh): clean after one accepted finding (mount-fallback needed 100dvh sizing on mobile; fixed in 51b84e3).
  • Live verification in the Control UI mock harness with the Mac app's native web chrome injection simulated: root refuses displacement (scrollY/scrollTop stay 0 after scrollTo/scrollIntoView), while .content and .settings-sidebar__nav scroll independently; chat route and 375×812 mobile checked visually.
  • PR CI on head: 77/77 checks green.

Known gap: not exercised inside an actual WKWebView app build; behavior verified in Chromium with the injected native classes/CSS from DashboardWindowController.installNativeChromeScript replicated.

@steipete
steipete merged commit 861d1d5 into main Jul 14, 2026
77 checks passed
@steipete
steipete deleted the claude/macos-settings-scroll-fix-cad2f2 branch July 14, 2026 04:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
…PWAs (openclaw#107102)

* fix(ui): lock the app root scroll in every host, not just standalone PWAs

* fix(ui): size mount fallback scroller to the visible viewport
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 maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant