Skip to content

test(ui): open the touch-viewport activity drawer with touch input - #161571

Merged
steipete merged 3 commits into
mainfrom
fix/ui-e2e-activity-card-escape-race
Sep 30, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/ui-e2e-activity-card-escape-race

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Related: #160856 (first sighting: run 36508995885, job 109217154316, checks-ui-e2e (7/9), 2026-09-29T01:45Z)

What Problem This Solves

Fixes: the Control UI e2e "opens focused details inside a narrow touch viewport and follows the session's saved face" (ui/src/e2e/people-activity-card.e2e.test.ts) intermittently kept the "Activity for Alice" card open after Escape (expected 1 to be +0, full 15 s poll), failing unrelated PRs.

User Impact

No user-visible change. PR CI stops going red on this test. The Control UI behavior it exposed is intended (a visible tooltip is dismissed by the first Escape).

Why This Change Was Made

The test runs in a touch viewport (hasTouch, isMobile, 390×650, motion enabled) but opened the navigation drawer with a mouse click(). That parks a hover pointer at the toggle while the drawer slides in underneath it. If a header button's tooltip opens after focus has entered the card, that tooltip owns the next Escape by design (Tooltip.consumeEscape, window capture), so the card's own Escape handler never runs.

The test now opens the drawer with tap(), matching its touch scenario and the sibling touch-viewport tests (sidebar-name-marquee, question-flow). It also asserts that Tab actually moved focus into the portaled card before Escape. No timeouts, retries, or assertions were weakened.

Root cause detail and trace

.shell-nav slides in with a 200 ms transform, and the test's Tab/Escape run while it is still moving (translateX(-15px) at Tab, -2.6px at Escape on an idle Testbox). The parked mouse sits at ≈(40,30). As the drawer moves, Chromium fires synthetic pointerovers on the header's New conversation and Open command palette buttons.

Why it surfaced now: #160140 put title="Session counts unavailable" on the Online person link, and this mock never returns ownerSessionCounts. Keyboard focus on Alice therefore opens a title tooltip, which closes the moment the card opens. That close arms the tooltip provider's 300 ms skip window, so a hover opens its tooltip with 0 ms delay instead of 150 ms, exactly across Tab → Escape.

A reproduced failure (drawer animation slowed via CDP Animation.setPlaybackRate(0.1)):

784.2 keydown Tab            (Alice link → card)
795.3 focusin  card link "Release checklist"
797.0 pointerover mouse @40,30 → New conversation icon
802.3 tooltip open  "New conversation"
805.3 keydown Escape
805.5 tooltip closed "New conversation"   ← Escape consumed; the card never closes

The sighting's merge base 4ddd0e33973e is on main, and no later main commit touched this test.

Evidence

All proof ran on Blacksmith Testbox tbx_01m3qttws6vvr5z8a8cdde9ckr with CI's e2e config (test/vitest/vitest.ui-e2e.config.ts, OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1). A temporary, uncommitted harness replayed this test's opening sequence with a page-side event trace:

Scenario Result
Original click(), 4× CPU throttle 12/12 pass: CPU slowness alone does not trigger it
Original click(), normal speed, full traces hover samples hit the New conversation icon and open its tooltip; harmless only because a later focus move dismissed it
Original click(), drawer animation at 10% 2/10 failed with the CI symptom (trace above); a later batch passed 30/30, so the alignment is narrow
tap(), drawer animation at 10% 10/10 and 30/30 pass; traces contain zero mouse pointerovers
Control: hover New conversation after focus enters the card, then Escape 5/5 card stays open; the tooltip closes 0.1–0.3 ms after Escape

Fixed test:

  • The full people-activity-card file with --maxWorkers 2 passed 8/8 loops, 12/12 tests each.
  • A replay of CI shard 7/9's exact 81 files from the failing job with --maxWorkers 2 ran twice. 79/81 files passed both times, including people-activity-card 12/12. chat-selection-to-main and composer-text-readability fail at browserContext.newPage because the lease's Playwright cache lacks ffmpeg-1011 for video recording. That is a Testbox tooling gap; this PR doesn't touch those files and they are green on main CI.
  • Codex autoreview (P1) is scoped-clean. oxfmt --check and git diff --check are clean.

Test cost: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --maxWorkers=1 ui/src/e2e/people-activity-card.e2e.test.ts takes 41.5 s wall on Testbox, including the ~12 s bundled Control UI build. The file's 12 tests take 26.0 s, and this test takes 1.3 s (1.28–1.70 s across 11 runs). No test is added. tap() costs the same as click(), and the new poll resolves on its first read. CI (run 36667368805, checks-ui-e2e (7/9), the sighting's shard, 431/431 passed): the file took 28.2 s and this test 1.22 s.

Landing note: the first two CI runs on this PR failed before reaching any tests, because of main-side breaks introduced by #161534 (preflight could not find .ci-harness/scripts/ci-build-manifest.mjs, then check-guards rejected its parseBoolean). Both were fixed on main by 6c07ebf and df2a29c. The PR head was refreshed twice with the patch unchanged.

The narrow touch-viewport Activity card test opened the navigation drawer
with a mouse click. That parks a hover pointer at the toggle while the drawer
slides in underneath it, so the drawer's header buttons can receive synthetic
pointerover events after focus has entered the card. Their tooltip then owns
the next Escape (Tooltip.consumeEscape), and the card stays open for the whole
poll. #160140 made the window hot: the Online person link's "counts
unavailable" title tooltip closes when the card opens and arms the tooltip
provider's zero-delay skip window across Tab and Escape.

Open the drawer with tap(), matching the touch scenario and the sibling touch
tests, and assert Tab moved focus into the portaled card before Escape.

First sighting: #160856 (run 36508995885, checks-ui-e2e 7/9).
@clawsweeper

clawsweeper Bot commented Sep 30, 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.

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 12:12 AM ET / 04:12 UTC (Revision 3).

ClawSweeper review

What this changes

The Control UI browser test opens the mobile navigation drawer with touch input and verifies that focus enters the activity card before checking Escape dismissal.

Merge readiness

✅ Ready for maintainer review

Current main still has the flaky browser-test path. The reported failure and the proposed correction are supported by the Control UI event handlers and focused browser evidence; no actionable patch defect emerged.

Priority: P2
Reviewed head: bfadf057ea731e3c85280b306cf405d5e50be291

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A small, focused test correction has a credible before-and-after browser trace, measured test cost, and no identified correctness or security blocker.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The contributor's Testbox Chromium trace exercises the Control UI drawer and card through their real browser handlers with a mocked Gateway: the original click produced matching failures in 2/10 slowed-animation runs, while tap passed 40/40 and produced no mouse pointerovers. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The contributor's Testbox Chromium trace exercises the Control UI drawer and card through their real browser handlers with a mocked Gateway: the original click produced matching failures in 2/10 slowed-animation runs, while tap passed 40/40 and produced no mouse pointerovers. No stored-data contract changes.
Evidence reviewed 9 items Introduced test change: The pinned introduced diff changes the drawer action from click to tap and adds a focus-inside-card assertion before Escape; no production code changes.
Current-main behavior: The main-branch version of this touch-viewport test still uses a mouse click before its Tab and Escape sequence, so the proposed repair is not on main.
Escape event ordering: An active tooltip prevents Escape's immediate propagation at window capture; the sidebar activity-card runtime has a separate document Escape handler.
Findings None None.
Security None None.

How this fits together

The Control UI browser suite drives a mobile navigation drawer and Online-person activity card using a mocked Gateway. Drawer, tooltip, and card handlers process its pointer and keyboard input before the test checks the rendered result.

flowchart LR
A[Mobile browser test] --> B[Drawer touch input]
B --> C[Online person link]
C --> D[Activity card]
D --> E[Focus check]
E --> F{Tooltip visible?}
F -- No --> G[Escape closes card]
F -- Yes --> H[Escape dismisses tooltip]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +5. Total +5 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 6 1 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 6 1 +5

Review metrics

Metric Value Why it matters
Browser test cost 1.3 s changed case; 26.0 s existing file Contributor-reported Testbox timing shows no added test case and keeps the file below the 30-second explanation threshold.

Technical review

Best possible solution:

Keep the tooltip's intended Escape priority and land the focused mobile browser-test correction through normal PR gates.

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

Yes. The contributor recorded a matching failure from the current-main mouse-click path in Chromium with a slowed drawer, and current source supports the reported Escape ordering; this review did not rerun the browser test.

Is this the best way to solve the issue?

Yes. Touch input matches the test's mobile context, and the focus assertion checks the intended keyboard path without weakening dismissal assertions or changing tooltip behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: An intermittent Control UI test failure disrupts unrelated PR validation, while the patch changes no user-facing runtime behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The contributor's Testbox Chromium trace exercises the Control UI drawer and card through their real browser handlers with a mocked Gateway: the original click produced matching failures in 2/10 slowed-animation runs, while tap passed 40/40 and produced no mouse pointerovers. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The contributor's Testbox Chromium trace exercises the Control UI drawer and card through their real browser handlers with a mocked Gateway: the original click produced matching failures in 2/10 slowed-animation runs, while tap passed 40/40 and produced no mouse pointerovers. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

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

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 (2 earlier review cycles)
  • reviewed 2026-09-30T03:31:04.267Z sha 541cdd1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-30T03:54:18.790Z sha d9de87e :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 30, 2026
@steipete
steipete merged commit 2247f10 into main Sep 30, 2026
73 checks passed
@steipete
steipete deleted the fix/ui-e2e-activity-card-escape-race branch September 30, 2026 04:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…penclaw#161571)

The narrow touch-viewport Activity card test opened the navigation drawer
with a mouse click. That parks a hover pointer at the toggle while the drawer
slides in underneath it, so the drawer's header buttons can receive synthetic
pointerover events after focus has entered the card. Their tooltip then owns
the next Escape (Tooltip.consumeEscape), and the card stays open for the whole
poll. openclaw#160140 made the window hot: the Online person link's "counts
unavailable" title tooltip closes when the card opens and arms the tooltip
provider's zero-delay skip window across Tab and Escape.

Open the drawer with tap(), matching the touch scenario and the sibling touch
tests, and assert Tab moved focus into the portaled card before Escape.

First sighting: openclaw#160856 (run 36508995885, checks-ui-e2e 7/9).
RomneyDa added a commit that referenced this pull request Oct 11, 2026
Backport the exact fixture correction from 2247f10 (#161571). Use a native touch gesture and wait for focus inside the card before Escape; retain all existing assertions and test budgets.

Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 11, 2026
* chore(release): prepare 2026.9.33 with backport audit

* docs(release): store backport proposals as source diffs

* test(update): pin fresh-install fixture version

* docs(release): record pending September candidate preparation

* test(update): align downgrade fixture with driver version

* test(update): pin shared stable-driver fixture version

* test(doctor): align config fixture with lease worker clock

Reuse the Doctor test-clock hunk from ee7c294 without its production timer changes. Preserve all relative clock advances and assertions.

* test(plugins): close fixture state before cleanup

* test(telegram): make held album completion deterministic

Reuse the complete test-only fix from upstream c39a052 (#162410), by Peter Steinberger.

Hold the album window through handler admission and await its real keyed-queue work before asserting replies. Preserve the caption, topic isolation, media and error contracts without changing production, deadlines or retries.

* fix(agents): persist cleanup claims before child follow-ups

A completed child can accept a human follow-up while browser cleanup is
still pending. Persist its cleanup claim through the existing native
worker before dispatch, then drain newly admitted predecessor writes
before comparing the replacement with its exact durable source.

Preserve physical-source, original-row, generation and caller guards,
duplicate browser exclusion, and outcome-aware rollback. Adapt only the
shipped September session-effect contract; do not import mainline
registry or session-effect refactors.

Adapted from b725cc7 by Peter
Steinberger. Four real-worker regression cases fail before the repair;
the focused twelve-file group passes 253 cases on each of macOS and
Linux/arm64 afterward. The eleven original audit proposals stay unapplied.

* test(telegram): hold adoption batch through native admission

Hold the existing forward flush until both durable ingress handlers
reach the buffer, and freeze only its monotonic maximum-wait clock.
Worker I/O, Date, shutdown timers and the stop-observation budget
remain native and unchanged.

Assert one two-key replay operation while retaining the original
commit, compensating rollback, tombstone and replay-guard checks.
Delayed-second-admission controls reproduce the split-batch failure
and pass with the corrected fixture; diagnostics are not shipped.

Refs #168346

* test(plugins): surface native install timeout phases

* test: pin updater schedule and diagnose authority timeouts

Pin the legacy update-status schedule fixture as in upstream daedb90 (#163975). Add bounded failure phases to the real managed npm authority cases without changing their commands, assertions, or 120-second budgets. The hosted timeout remains unattributed.

* test(ui): use touch input for activity-card drawer

Backport the exact fixture correction from 2247f10 (#161571). Use a native touch gesture and wait for focus inside the card before Escape; retain all existing assertions and test budgets.

Co-authored-by: Peter Steinberger <[email protected]>

* fix(test): resolve monthly survivor no-op through candidate registry

Monthly package installs intentionally reject explicit update tags. Keep the
installed channel for the survivor no-op and opt into its loopback registry
for that invocation, while leaving regular releases on their exact tag.

Backport only the fixture target-manifest endpoint hunks from upstream
7a438dc (#161450), preserving existing
readiness IPC and published/candidate registry identity.

Extend the existing registry identity case to exercise the actual monthly
resolver and exact archive bytes. Retain no-op mutation, service, survival
assertions and all command budgets; no production policy change.

---------

Co-authored-by: Peter Steinberger <[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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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