Skip to content

fix(ios): open and close the sidebar drawer without a pause or chat scrolling - #200677

Merged
vyctorbrzezowski merged 3 commits into
openclaw:mainfrom
mikengyn:fix/ios-drawer-interaction
Nov 17, 2026
Merged

vyctorbrzezowski merged 3 commits into
openclaw:mainfrom
mikengyn:fix/ios-drawer-interaction

Conversation

@mikengyn

@mikengyn mikengyn commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

On iPhone, opening or closing the sidebar drawer pauses for about a tenth of a second before the drawer starts to move, so the swipe feels laggy. While you swipe the drawer open, the chat behind it also scrolls along with any up-or-down drift of your thumb.

User Impact

User impact: the drawer starts moving as soon as you release or tap, and the chat stays put while you swipe the drawer. The layout is unchanged; the header's menu button still leaves while the drawer is open, now with a fade.

Why This Change Was Made

Every open or close re-ran the whole root screen, which rebuilt the chat, the composer and the sidebar before the animation could begin. Sidebar visibility now lives in a small observable object that only the views that need it read: the card position, the sidebar layer, the tap-to-close area, the header menu button and the navigation bar visibility of pages that depend on it. Work that pauses content behind the drawer (the chat's covered state, the sidebar's dismiss button, the session observer) follows a settled copy that updates after the animation ends, so it never delays the motion. In the shared chat view, only a small modifier reads the covered state, so covering or revealing the chat no longer re-runs the transcript.

Once the drawer claims a swipe, any scroll view under the finger has its current pan cancelled. A few points of drift before the drawer recognizes the swipe can still move the chat; stopping that would mean delaying every scroll that starts at the left edge.

Evidence

Maintainer verification

Additional repair in c9d2ba3d538223dfe9e51ab409ec7f1070f879c1: the invisible session-observer background occupied the navigation area for native accessibility hit testing. The existing Settings screenshot test could see “Reset Onboarding” but considered it non-hittable after scrolling. Giving that observation-only background a zero-size frame keeps its task mounted and fixes the obstruction.

The unchanged testReleaseSettingsScreenshot passed on baseline f1d40db4d99bca224aac35d4f71a7d5dc925c216, failed on incoming head 843a8c596d41c6cc0be7c1576406347ae3ce0cc3, and passes with the repair. Swapping the two simulator devices repeated the baseline pass and incoming failure. No assertion was weakened and no new permanent test was needed.

  • Eliminated work: a baseline-only adaptation of the shell regression to its old constructor recorded detail and sidebar body counts of 1 → 5 over four toggles. Baseline production code was unchanged. The candidate keeps both counts unchanged.
  • Focused validation: 68 tests passed on the incoming head. After the repair, all 64 affected invalidation, continuity, and RootTabs presentation tests passed again; unchanged gesture tests were reused. The previously failing Settings UI test also passed. Swift format, iOS lint, and the native build passed.
  • Native interactions: checked drawer taps, horizontal drags, short-drag cancellation, drag dismissal, vertical chat scrolling, rapid toggles, and an Overview → Home round trip preserving the exact draft. Five repeated open/dismiss cycles at the latest reply and while reading older content retained the text position. The final corrected app was opened, dismissed, and visually inspected again.
  • Review: the complete corrected candidate received a fresh review; the reviewed source bytes match the committed repair.

These checks used the actual iOS app on isolated iPhone 18 Pro / iOS 27.2 simulators with its built-in synthetic conversation transport. The simulator drags did not independently reproduce the contributor's unwanted-scroll symptom on the baseline, so they establish interaction compatibility, not a new before/after claim for that symptom. Physical-device latency was not remeasured; the contributor's measurements and their limits remain below.

Before/after on the final candidate

Same built-in long-conversation fixture, drawer open. The model label alone is redacted. These static frames demonstrate preserved layout, not animation latency.

Baseline Corrected candidate
Baseline drawer Corrected drawer

Contributor evidence

Layout is unchanged

Before (main) After (this PR)
Before: drawer open, the menu button is gone and the agent avatar sits in its slot After: drawer open, the same layout, menu button gone and avatar in its slot

Drawer open on the iPhone 18 Pro simulator, light mode, built-in demo chat (--openclaw-screenshot-mode). Before: main at f1d40db. After: 843a8c5. With the drawer closed the two captures are pixel-identical; with it open they differ only in the animated mascot's frame. There is no layout change to annotate; the visible difference is that the menu button now fades instead of disappearing abruptly.

Drawer responsiveness on a device

Main-thread stalls while repeatedly opening and closing the drawer, Time Profiler on an iPhone 16 Pro (iOS 27.2.1), Debug build:

While swiping Before After
Stalls of 100 ms or more 13 in 15 s (0.85/s) 2 in 28 s (0.07/s)
Stalls of 50 ms or more 1.24/s 0.50/s
99th-percentile stall 113 ms 43 ms

In the before trace, each toggle stalled 106–177 ms rebuilding the root screen, sidebar, chat and composer and re-measuring chat text. Limits: one recording per build rather than repeated alternating runs; the before build was an earlier branch state whose stall is in code this PR changes, not a clean main build; the after trace is of f807f45, before the header-layout commit; the two remaining long stalls in it could not be attributed because the app launched after recording started. Both commits were also checked by hand on the device: the drawer settles without a pause, the chat no longer scrolls during the swipe, and the menu button fades out and back in.

Tests and checks

  • New RootSidebarShellInvalidationTests:
    • Toggling the drawer four times re-runs neither a sidebar-like view (focus and stored state) nor a chat-like view (environment reads). It fails when the shell body reads the drawer position again (the chat-like view re-ran on every toggle).
    • Hiding the menu button in a destination toolbar does not re-run that destination.
  • iOS simulator: sidebar shell, root-tab presentation, source guard, sidebar stability, performance, equality, typography and render smoke suites: 104 passed, 1 failed. The failure, SwiftUIRenderSmokeTests "managed assistant media starts its artifact load with the playback route", times out the same way with main's versions of every file this PR touches, so it is not caused by this change.
  • macOS: ChatObscuredStreamPacingTests passed (covered chat still slows live text and recovers when revealed).
  • scripts/format-swift.sh ios and scripts/lint-swift.sh ios clean; pnpm native:i18n:verify reports changed=false.
  • Local review: autoreview with Codex, branch mode origin/main (f1d40db) to 843a8c5, findings up to P1: scoped-clean, no findings. The reviewer saw the diff only, without running the app.

Follow-ups, not in this PR

  • Switching chats from the sidebar still stalls for up to about 200 ms; that will be a separate PR.
  • The composer recomputes its model-patch target and capability owner on every redraw; worth measuring while typing.

…during swipes

Toggling the iPhone drawer re-evaluated the sidebar shell and RootTabs, which
re-ran the chat, composer and sidebar before the animation could start (about
115 ms per toggle on an iPhone 16 Pro). Sidebar visibility now lives in an
observable that only small leaf views and modifiers read, and content that
pauses behind the drawer follows a settled copy after the animation ends.

The drawer gesture also cancels scrolling under the finger once it claims a
swipe, so the transcript no longer follows the swipe's vertical drift. The
header menu button stays mounted and dims while the drawer is open.
@clawsweeper

clawsweeper Bot commented Nov 17, 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.

@mikengyn
mikengyn marked this pull request as draft November 17, 2026 15:52
The previous commit kept the destination's sidebar control mounted and dimmed
while the drawer was open, which changed the header layout and the navigation
bar visibility of Desktop, Terminal, Agent and Files pages. The control now
hides itself, and those pages read whether it is shown in small views and
modifiers, so the layout matches main again without re-evaluating the
destination on every toggle.
@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 17, 2026
@mikengyn

Copy link
Copy Markdown
Contributor Author

Updated after the header-layout fix (843a8c5): drawer open, same layout as main.

After: drawer open, menu button gone and avatar in its slot, same as main

@mikengyn
mikengyn marked this pull request as ready for review November 17, 2026 16:14
@vyctorbrzezowski vyctorbrzezowski self-assigned this Nov 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR isolates sidebar visibility updates and cancels underlying scrolling when the drawer claims a swipe.

Example: Swipe right from the left edge of an iPhone chat with slight vertical thumb drift.

  • Before: The drawer can pause before settling while the chat also scrolls.
  • After: Drawer updates avoid rebuilding the destination, and claimed drawer swipes cancel underlying scrolling.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source change is coherent and has focused invalidation coverage, but supplied visual evidence establishes only the static layout.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Opening and closing the iPhone sidebar feels delayed, and vertical thumb drift can scroll the chat during a drawer swipe.
Reason: The repair improves routine navigation while retaining the existing layout, gesture thresholds, split-navigation policy, and chat pacing values.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this useful iOS repair open; current main retains the reported invalidation path, and source review found no definite introduced defect.

Priority: P2
Reviewed head: 843a8c596d41c6cc0be7c1576406347ae3ce0cc3

Before merge

  • Add real behavior proof - Inspected current-head simulator screenshots establish matching open-drawer layout, but cannot demonstrate responsiveness, scroll cancellation, or fading; device checks and profiler results are described without an inspectable recording or linked trace. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a redacted current-head iPhone recording showing drawer taps and swipes, stationary chat after gesture claim, and the menu-button fade; the body reports a shell regression negative control but does not show the toolbar test failing on the base.
Agent review details

How this fits together

The native iOS navigation shell receives menu taps and drag gestures, positions the sidebar and destination, and supplies covered-chat and session-observer visibility.

flowchart LR
  A[Menu taps and swipes] --> B[RootTabs presentation state]
  B --> C[Sidebar shell modifiers]
  C --> D[Drawer and destination]
  A --> E[Scroll cancellation]
  B --> F[Settled visibility readers]
  F --> G[Chat pacing and session observer]
Loading

Technical review

Best possible solution:

Keep presentation reads at small observation boundaries within the existing sidebar owner, while preserving destination identity and established gesture arbitration.

Do we have a high-confidence way to reproduce the issue?

Current-main source supports both mechanisms: visibility changes invalidate the root presentation, and the simultaneous drawer gesture permits underlying scrolling; device observations are contributor-reported rather than independently reproduced.

Is this the best way to solve the issue?

The change addresses those mechanisms at their existing owners, and the extracted views serve necessary observation boundaries rather than parallel implementations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7b0a97a4c96e.

Provenance checked

  • Stable sidebar shell and gesture ownership keeps the original intent (26165bb: Keep transient drawer gestures in one stable shell, preserve destination backgrounds, and latch gesture direction for each touch.)
  • Adaptive layout and destination continuity keeps the original intent (c2c070b: Preserve the active detail view and drafts across drawer/split transitions while retaining the sidebar width budget.)
  • Native toolbar visibility and clipping keeps the original intent (91ee230: Keep native controls visible across adaptive layouts and include safe-area margins in the closed-card mask.)
  • Covered-chat pacing keeps the original intent (437b157: Reduce covered-chat publications without changing transport input or flushing pending updates immediately on reveal.)
  • Composer presentation handling keeps the original intent (21479e2: Restore definitely rejected messages only into the visible, active composer's eligible draft.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 26165bb adds apps/ios/Sources/RootSidebarDrawer.swift:30 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 26165bbe8075; files: apps/ios/Sources/RootSidebarDrawer.swift)

PR surface

Source +188, Tests +113. Total +301 across 12 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 9 330 142 +188
Tests 3 133 20 +113
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 463 162 +301

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +330/-142; tests +133/-20 Production growth chiefly creates SwiftUI observation boundaries and the UIKit scroll-cancellation bridge; the tests cover distinct shell and toolbar invalidation paths.

Labels

Label changes:

  • add P2: Drawer latency and unintended transcript scrolling affect routine iPhone navigation without blocking the app.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Drawer latency and unintended transcript scrolling affect routine iPhone navigation without blocking the app.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 17, 2026, 11:32 AM ET / 16:32 UTC.

@vyctorbrzezowski

Copy link
Copy Markdown
Member

Fixed a native accessibility regression in c9d2ba3: the observation-only background now has zero size. The unchanged Settings UI test passes on main, fails on the incoming PR, and passes with this fix; crossed simulator controls confirmed the comparison. The 64 affected tests still pass, including the no-rebuild checks. The body now includes the final inspected before/after captures, native interaction results, and the limits of the simulator/performance evidence. @clawsweeper re-review

@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) November 17, 2026 17:25
@vyctorbrzezowski
vyctorbrzezowski merged commit bab767e into openclaw:main Nov 17, 2026
92 of 96 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…crolling (openclaw#200677)

Isolate drawer presentation reads and cancel underlying pan scrolling after a drawer gesture is claimed. Keep the settled visibility observer outside native accessibility hit targets.

Co-authored-by: Michael N <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants