Skip to content

fix(ui): keep chat Send and Stop responsive on mobile - #116104

Merged
steipete merged 2 commits into
openclaw:mainfrom
Ram-G:fix/mobile-composer-pointer-activation
Aug 3, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
Ram-G:fix/mobile-composer-pointer-activation

Conversation

@Ram-G

@Ram-G Ram-G commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #113732

What Problem This Solves

Fixes an issue where users tapping Send or Stop in the narrow/mobile Control UI could have the action silently cancelled when the focused composer changed its bottom inset during the pointer gesture. The same event sequence can affect a narrow desktop viewport, while stable wide layouts are unaffected.

Why This Change Was Made

The primary composer actions now preserve textarea focus only while the focused composer is in its zero-bottom-margin layout, preventing the control from moving between pointer down and release. Stable layouts and unrelated focus keep their existing behavior. Successful pointer submission also clears stale composition state so the next Enter submission is not suppressed.

The fix stays at the shared composer/action boundary and covers Send, Queue, Steer, Interrupt, and Stop. It does not change responsive CSS or Gateway/session behavior.

User Impact

Send and Stop respond on the first mobile/PWA tap without requiring a Workspace-panel toggle. Narrow mouse layouts get the same protection, while wide desktop mouse and keyboard activation remain unchanged.

Evidence

  • Clean current-main baseline with the new regression test: 2 failed / 2 passed. In both Android-like touch and narrow desktop mouse scenarios, losing composer focus moved the action during pointer activation, cancelling the click and emitting no chat.send; the touch scenario measured a 48 px shift and retained the draft. Wide desktop/keyboard and drag-away controls passed.
  • Candidate focused E2E: 4/4 passed for Android-like touch Send/Stop, narrow mouse Send/Stop, wide mouse plus keyboard activation, and drag-away cancellation.
  • Candidate focused unit suite: 36/36 passed, covering focus ownership, stable-layout behavior, all active-run actions, Send/Stop draft lifecycle, and IME composition reset.
  • Full Control UI suite: 492 files / 7,127 tests passed.
  • Full mocked-Gateway Control UI E2E: an earlier sweep passed 117 files / 422 tests. The final exact-patch sweep passed 116 files / 421 tests with one unrelated managed-update reconnect timeout; that isolated file immediately passed 4/4 on rerun.
  • Production Control UI build passed; 680 precompressed sidecars verified and all performance budgets passed.
  • UI typecheck, formatting, i18n, dependency/patch, dead-export, and changed-file structural gates passed.
  • TruffleHog preflight: clean. Repository autoreview: no findings; patch correct (0.90 confidence).
  • Follow-up lint repair at current head 4bb4a1efb35afec4bdc7d596befe0918f57abfbf: extracted the pointer unit cases into a focused sibling test file and made the E2E Promise executor non-returning. Production files are unchanged from the recorded implementation head. Focused unit and E2E runs, file-scoped Oxlint/Stylelint/formatting, and fresh repository autoreview passed; autoreview reported no findings (0.98 confidence).
  • Redacted browser recordings and screenshots were captured against a synthetic mocked Gateway. They contain no production endpoint, IP address, credential, account data, or private conversation content.

Inspectable browser proof

The candidate captures below are from reviewed implementation head d2d6533761cca678b9c2e319407649504e7696b9. Current head 4bb4a1efb35afec4bdc7d596befe0918f57abfbf has identical production files and differs only by the test-only lint repair described above; the focused unit and browser E2E scenarios were rerun on the current tree. The comparison capture is from current-main baseline 97d374b357ebe2d389a9d512d70e689fd1af85cb. The complete immutable artifact set and diagnostic summary are in Ram-G/pr-assets@37754ef.

Scenario Recording Visible diagnostic
Current-main, narrow touch Baseline WebM Focus loss moves the action by 48 px; chat.send=0; draft remains
Recorded implementation head, narrow touch Send then Stop Fixed WebM Send emits chat.send=1; Stop emits chat.abort=1; focused inset remains 0 px
Recorded implementation head, wide mouse and keyboard Control WebM Mouse Send emits chat.send=1; keyboard Stop emits chat.abort=1; keyboard Send increments to chat.send=2

Baseline cancelled activation:

Current-main baseline: activation cancelled, chat.send=0, draft retained, margin moved from 0 px to 48 px

Exact-head narrow touch Send:

Recorded implementation head: narrow touch Send emitted chat.send=1 and retained focus with zero bottom margin

Exact-head narrow touch Stop:

Recorded implementation head: narrow touch Stop emitted chat.abort=1

Exact-head wide mouse and keyboard controls:

Recorded implementation head: wide mouse Send emitted chat.send=1

Recorded implementation head: keyboard Stop emitted chat.abort=1

Recorded implementation head: keyboard Send incremented chat.send to 2

The memory-heavy core-test typecheck could not complete locally because the 8 GiB development VM plus the Go checker exhausted host headroom; the repository's Testbox delegation was unavailable because its selected Crabbox binary failed its own sanity check. Upstream CI remains authoritative for that lane.

Non-goals

  • Queued-message/session-file locking behavior reported separately is not changed here.
  • No responsive-layout redesign or permanent safe-area allocation change.

AI Assistance

This change was developed and reviewed with OpenAI Codex. The final patch was independently checked by the repository's isolated Codex autoreview workflow; all behavior claims above are backed by deterministic tests or captured browser evidence.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 8:47 PM ET / July 30, 2026, 00:47 UTC.

ClawSweeper review

What this changes

The PR prevents narrow Control UI chat actions from losing textarea focus during pointer activation, keeping Send, Stop, Queue, Steer, and Interrupt responsive on mobile-sized layouts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The focused composer repair has credible after-fix browser proof and no concrete patch defect from the reviewed change, but this PR remains behind current main; merge should wait for the normal merge/review refresh so the narrow-layout focus invariant is rechecked against the final merge result.

Priority: P2
Reviewed head: 4bb4a1efb35afec4bdc7d596befe0918f57abfbf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with strong before/after UI evidence and targeted coverage; only the normal current-base refresh remains before landing.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): The PR supplies redacted baseline and after-fix mocked-Gateway browser recordings and screenshots that directly show the failed narrow activation and successful Send/Stop dispatches; the follow-up commit is described as test-only and the focused browser paths were rerun.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR supplies redacted baseline and after-fix mocked-Gateway browser recordings and screenshots that directly show the failed narrow activation and successful Send/Stop dispatches; the follow-up commit is described as test-only and the focused browser paths were rerun.
Evidence reviewed 6 items Changed shared boundary: The branch adds one optional primary-action pointer handler to the shared control props and attaches it to every Send and Stop rendering branch, so the narrow-layout focus guard is not limited to one visible control state.
Focused implementation: The composer prevents only the pointerdown default that would move focus when its own textarea is focused and the computed bottom margin is zero; stable layouts and unrelated focus continue through their existing paths. Successful submission also clears stale IME composition state before dispatching.
Regression coverage: The branch adds focused JSDOM coverage for focus ownership, stable layouts, active-run controls, draft lifecycle, and composition reset, plus Playwright Control UI coverage for narrow touch/mouse activation, wide controls, and drag-away cancellation.
Findings None None.
Security None None.

How this fits together

The Control UI composer holds the chat draft and exposes Send plus active-run actions. Those controls dispatch a chat send or abort through the existing session path; this change prevents a focus-driven mobile layout shift from cancelling the pointer gesture first.

flowchart LR
  A[Chat draft or active run] --> B[Control UI composer]
  B --> C[Primary Send and run actions]
  C --> D[Pointer focus guard]
  D --> E[Send or abort command]
  E --> F[Gateway chat session]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; although GitHub reports it mergeable, the final three-way merge should be refreshed and the narrow-layout Send/Stop scenarios rerun on that exact result before landing.
  • Complete next step (P2) - No mechanical repair is identified; wait for the ordinary base refresh and required-check completion on the exact merge result.
Agent review details

Security

None.

PR surface

Source +20, Tests +606. Total +626 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 20 0 +20
Tests 2 606 0 +606
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 626 0 +626

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #113732
Summary: This PR is a candidate fix for the linked Android/PWA narrow-composer Send failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Mantis proof suggestion

A short redacted web UI chat transcript on the final merge head would directly confirm the mobile Send/Stop behavior after the base refresh. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis web UI chat proof: verify narrow mobile-style Send and Stop emit the expected chat actions on the final merge head, with a redacted transcript or diagnostics.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or refresh the branch onto current main, retain the shared composer-level pointer guard and its focused coverage, then merge once the exact merge head passes the remaining required checks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or refresh the branch onto current main, retain the shared composer-level pointer guard and its focused coverage, then merge once the exact merge head passes the remaining required checks.

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

Yes in source and supplied proof: a focused textarea in the zero-inset narrow layout can lose focus on primary-action pointerdown, move the control before release, and cancel the click. The branch’s dedicated browser coverage records the required narrow touch and mouse paths, though this read-only review could not rerun it.

Is this the best way to solve the issue?

Yes. The guard is at the shared composer/action boundary and narrowly suppresses focus transfer only for the specific focused zero-inset state, avoiding responsive CSS, Gateway, session, or general keyboard-behavior changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against edbb1fca86c4.

Labels

Label justifications:

  • P2: This fixes intermittent Send and Stop failures in the narrow/mobile Control UI without evidence of a broader runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR supplies redacted baseline and after-fix mocked-Gateway browser recordings and screenshots that directly show the failed narrow activation and successful Send/Stop dispatches; the follow-up commit is described as test-only and the focused browser paths were rerun.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies redacted baseline and after-fix mocked-Gateway browser recordings and screenshots that directly show the failed narrow activation and successful Send/Stop dispatches; the follow-up commit is described as test-only and the focused browser paths were rerun.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR supplies redacted baseline and after-fix mocked-Gateway browser recordings and screenshots that directly show the failed narrow activation and successful Send/Stop dispatches; the follow-up commit is described as test-only and the focused browser paths were rerun.

Evidence

What I checked:

  • Changed shared boundary: The branch adds one optional primary-action pointer handler to the shared control props and attaches it to every Send and Stop rendering branch, so the narrow-layout focus guard is not limited to one visible control state. (ui/src/pages/chat/components/chat-composer-controls.ts:201, 4bb4a1efb35a)
  • Focused implementation: The composer prevents only the pointerdown default that would move focus when its own textarea is focused and the computed bottom margin is zero; stable layouts and unrelated focus continue through their existing paths. Successful submission also clears stale IME composition state before dispatching. (ui/src/pages/chat/components/chat-composer.ts:562, 4bb4a1efb35a)
  • Regression coverage: The branch adds focused JSDOM coverage for focus ownership, stable layouts, active-run controls, draft lifecycle, and composition reset, plus Playwright Control UI coverage for narrow touch/mouse activation, wide controls, and drag-away cancellation. (ui/src/pages/chat/chat-composer-pointer-activation.test.ts:1, 4bb4a1efb35a)
  • Real behavior evidence: The PR body supplies baseline and after-fix browser recordings/screenshots showing the baseline 48 px shift with no chat.send, then successful narrow Send and Stop dispatches while the focused inset remains zero; GitHub’s proof label is proof: sufficient. (d2d6533761cc)
  • Linked bug ownership: The PR is explicitly linked to the reported Android/PWA Send failure, whose steps, workaround, and expected first-tap behavior match the guarded focus/layout path.
  • Current review continuity: The prior completed ClawSweeper review found no line-level defects and identified only base drift. The latest commit is test-only according to the PR body; current CI has many completed successes but is still running, so no final merge verdict is made here. (4bb4a1efb35a)

Likely related people:

  • unknown: The relevant current-main history could not be queried because the local read-only command runner failed before executing inspection commands; the PR author is intentionally not substituted as a current-main owner. (role: shared Control UI composer history could not be traced in this read-only execution environment; confidence: low; files: ui/src/pages/chat/components/chat-composer.ts, ui/src/pages/chat/components/chat-composer-controls.ts)

Rank-up moves

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

  • Refresh the branch against current main and rerun the narrow touch/mouse Send/Stop browser scenarios on the exact merge head.

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 (5 earlier review cycles)
  • reviewed 2026-07-29T22:25:33.092Z sha d2d6533 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T22:30:31.613Z sha d2d6533 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T22:42:47.543Z sha d2d6533 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T22:50:49.937Z sha d2d6533 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T00:16:27.113Z sha d2d6533 :: needs maintainer review before merge. :: none

@Ram-G

Ram-G commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording 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. and removed 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. labels Jul 29, 2026
@Ram-G
Ram-G marked this pull request as ready for review July 29, 2026 22:46
@Ram-G
Ram-G marked this pull request as draft July 30, 2026 00:11
@Ram-G
Ram-G marked this pull request as ready for review July 30, 2026 00:11
@Ram-G

Ram-G commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

human note - I've reviewed the prod code "by hand" - arrived at it after a few iterations - the current version is the final version I am proposing. I've not reviewed the tests myself.

@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification before landing:

Root cause confirmed in source. On narrow/PWA layouts, ui/src/styles/chat/layout.css zeroes the composer shell's bottom margin while the textarea is focused (:5004, :5024). Tapping Send blurs the textarea at pointerdown, the margin snaps back (~48px), the button moves before pointerup, and the click silently never fires — the exact silent-failure class this repo treats as the worst bug type. The fix (preventDefault on primary-action pointerdown only when the textarea is focused and the shell's computed bottom margin is 0) pins the gesture to precisely the unstable layout and leaves every other state on default focus behavior. The submit-path IME composition reset mirrors the existing pattern at chat-composer.ts:406.

Gates:

  • ClawSweeper: patch quality 4/6, proof 5/6 ("Ready for maintainer review"); its two remaining items were the stale-base refresh, addressed per repo policy via merge-verify drift analysis + a fresh hosted CI pass rather than a rebase.
  • Hosted CI on head 4bb4a1efb35a: pull_request run 30503375004 re-run (attempt 2) completed success at 01:19Z — checks-ui, checks-ui-e2e 1–4/4, i18n and node lanes, ci-gate.
  • Codex autoreview (gpt-5.6-sol, xhigh) on the exact bundle vs merge-base 97d374b3: clean, no accepted/actionable findings — "patch is correct (0.97)".
  • Verified the fix is not already on main (no onPrimaryActionPointerDown upstream).
  • Fork source not executed locally per untrusted-source policy; hosted CI authoritative.

Landing; closes #113732. Thanks @Ram-G — the baseline-fails/candidate-passes E2E proof and the recorded pointer traces made this an easy review.

@steipete
steipete merged commit f2af4e9 into openclaw:main Aug 3, 2026
182 checks passed
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

@Ram-G

Ram-G commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Hello @steipete - of course. Just pinging back to say that I am overjoyed to be able to contribute - thank you for reviewing the PR. As a first time contributor - it means a ton to me.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* fix(ui): keep chat actions responsive on mobile

* test(ui): satisfy composer lint gates

---------

Co-authored-by: Ram Gupta <[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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

Bug: Send button unresponsive on mobile Android Chrome (PWA) — workspace toggle workaround

2 participants