Skip to content

fix(ui): keep an outside tap from activating the page beneath - #190505

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/standardize-popover-outside-tap
Nov 2, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/standardize-popover-outside-tap

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

On a phone, tapping outside an open popover or menu closes it and also activates whatever is under the finger. In Live activity, tapping a session row to dismiss the filter opens that session. #190376 added a guard for this to Dashboards alone, and every other surface still has the problem.

User Impact

On touch, a tap outside an overlay closes it without activating the control under the finger. A tap on a text field also focuses that field, since only the click is held back. The next tap acts on the page as usual. Scrolling still leaves an overlay open, as it does today. Mouse behavior doesn't change.

Why This Change Was Made

The overlay registry already decides when an outside press dismisses an overlay, so one rule there covers every popover and menu. It absorbs one click, only when a touch release has just dismissed something. The next press clears it, even when the tap produced no click and took the registry's last root with it, so a long press can't swallow a later click. Keyboard activation still goes through.

With this landed, #190376 can drop its local pointerdown and click guard in dashboard-filter-popover.tsx. Sheets aren't involved: #190499 and the sidebar's sheets take the tap on their own backdrop.

Evidence

Mock data at 390x844, real touch input, same tap on the second session row. This changes behavior and no pixels, so there are no theme images.

Filter open Before: the tap opened the session After: the tap only closed the filter
Live activity with the filter open The tapped session opened in chat Live activity with the filter closed
  • After: the second tap on the same row opens the session. Tapping "Learn more" with the Automations filter open closes the filter and opens nothing.
  • At 1440px with a mouse, the same click still closes the filter and opens the session.
  • oxfmt, oxlint, tsgo:ui and ui:check-performance:base pass. Browser tests for popovers, overlay lifecycle, menus, session menu, pickers and multi-select pass, along with the mobile sheet e2e tests.
  • WebKit touch: Playwright's WebKit on macOS with touch emulation reports pointerType: touch. The first tap on a Live activity row closed the filter and stayed on the page, the second opened the session, and a tap on the search field closed the filter and focused the field. Real Safari isn't captured: OS clicks reach it as a mouse. iOS Safari isn't run.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 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 added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR suppresses the click following a touch release that dismisses a shared menu or popover.

Example: At 390×844, tap the Tax filing research session while the Live activity filter is open.

  • Before: The filter closes and the session opens.
  • After: The filter closes; a second tap opens the session.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful shared repair with inspected product evidence, two focused implementation blockers, and an explicit WebKit touch coverage gap.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A phone user dismissing a filter can accidentally open the session or link beneath the finger.
Reason: The maintainer-authored direction prevents an observed unwanted action through the existing shared owner without adding configuration or a parallel component.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep this PR open: the shared fix addresses accidental mobile navigation, but it must preserve vetoed closes and satisfy the existing listener guard.

Priority: P2
Reviewed head: 6e7460c668f5b248b63b2e1f93e2621d80dcfea9

Before merge

  • Suppress the click only after the close request succeeds (P2) - A popover whose onBeforeHide prevents default returns false from branch.request(false) and remains open, but this code still installs the click absorber. For example, touch the outside button in the existing vetoed-light-dismissal fixture: the overlay stays open and the button's click is silently lost. The stated rule applies after dismissal, and cancellation must be admitted before new effects. Gate absorption on the successful close result and extend the existing veto case to cover touch activation.
  • Register the click handler through the existing listener helper (P2) - This new direct addEventListener call raises the registry's count from zero to one, while config/control-ui-addEventListener-baseline.txt gives this file no allowance. The controller guard counts plain TypeScript calls too and rejects this increase, so the changed-check/lint path cannot pass with this hunk. Use the already imported listen(document, "click", absorb, true) teardown instead of adding or raising an allowance.
  • Explain or restore the original intent of Shared outside-pointer dismissal and cancellation - b68c44c: feat(ui): use native Solid overlays and tabs #169128 established one lifecycle owner that admits cancellation before effects and preserves caller behavior.
  • Explain or restore the original intent of Registry listener ownership - 5719a1e: refactor(ui): retain overlay root listener cleanup #174178 moved registry listeners to the existing listen helper and retained their teardown functions.

Findings

  • [P2] Suppress the click only after the close request succeeds — ui/src/components/overlay-registry.ts:390-392
  • [P2] Register the click handler through the existing listener helper — ui/src/components/overlay-registry.ts:351-354

Provenance

Tests

  • Missing end-to-end proof: Provide the changed outside-touch dismissal flow on WebKit and show the regression failing before the fix; the added synthetic-event test does not prove native touch event synthesis.
Agent review details

How this fits together

The Control UI overlay registry receives document and shadow-root input events, delegates accepted visibility changes to the overlay lifecycle owner, and now intercepts the following touch-generated click.

flowchart TD
  A[Touch input] --> B[Overlay registry]
  B --> C[Overlay lifecycle]
  C --> D[Popover or menu closes]
  B --> E[Document click interception]
  E --> F[Underlying page action]
Loading

Technical review

Best possible solution:

Keep suppression in the shared registry, arm it only after accepted dismissal, and use the existing listener helper with explicit teardown.

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

Current main dismisses the overlay on an outside release without suppressing its click, matching the supplied before screenshot and reported session-row navigation; no target code was executed.

Is this the best way to solve the issue?

The existing registry is the smallest appropriate owner, and the added test protects distinct touch, subsequent-tap, and mouse behavior, but click suppression must depend on accepted close admission.

Full review comments:

  • [P2] Suppress the click only after the close request succeeds — ui/src/components/overlay-registry.ts:390-392
    A popover whose onBeforeHide prevents default returns false from branch.request(false) and remains open, but this code still installs the click absorber. For example, touch the outside button in the existing vetoed-light-dismissal fixture: the overlay stays open and the button's click is silently lost. The stated rule applies after dismissal, and cancellation must be admitted before new effects. Gate absorption on the successful close result and extend the existing veto case to cover touch activation.
    Confidence: 0.98
  • [P2] Register the click handler through the existing listener helper — ui/src/components/overlay-registry.ts:351-354
    This new direct addEventListener call raises the registry's count from zero to one, while config/control-ui-addEventListener-baseline.txt gives this file no allowance. The controller guard counts plain TypeScript calls too and rejects this increase, so the changed-check/lint path cannot pass with this hunk. Use the already imported listen(document, "click", absorb, true) teardown instead of adding or raising an allowance.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Touch click-through behavior changes intended behavior with a stated reason (b68c44c: The original shared registry dismissed on outside release without intercepting the following click; this PR explains the observed accidental navigation and deliberately changes touch behavior while retaining mouse behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:control-ui-controllers --base c97faa7
  • pnpm --dir ui test src/components/solid/popover.browser.test.tsx src/components/overlay-lifecycle.browser.test.ts src/components/overlay-shadow.browser.test.ts
  • pnpm tsgo:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b68c44c adds ui/src/components/overlay-registry.ts:249 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b68c44ca8f3c; files: ui/src/components/overlay-registry.ts)
  • Josh Lehman: Raw commit 8d9e033 adds ui/src/components/overlay-registry.ts:233 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8d9e0332be31; files: ui/src/components/overlay-registry.ts)
  • Vyctor H. Brzezowski: Raw commit 5bf26f6 adds ui/src/components/solid/popover.browser.test.tsx:216 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5bf26f681e92; files: ui/src/components/solid/popover.browser.test.tsx)

PR surface

Source +30, Tests +43. Total +73 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 31 1 +30
Tests 1 43 0 +43
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 74 1 +73

Labels

Label changes:

  • add P2: Accidental navigation affects mobile overlay dismissal, with a focused shared fix and limited blast radius.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Accidental navigation affects mobile overlay dismissal, with a focused shared fix and limited blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 1, 2026, 11:28 AM ET / 16:28 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit fb2c420 into main Nov 2, 2026
85 of 89 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/standardize-popover-outside-tap branch November 2, 2026 10:03
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…aw#190505)

Keep the dismissing outside touch from activating the page below the popover while preserving keyboard, mouse and subsequent pointer actions.

Budget exception approved after source simplification review: chat boot JavaScript is 60 bytes over its gzip ceiling. Behavioral, lint, type and security checks passed.
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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant