Skip to content

fix(AlertDialog): a press that slides between the actions runs the one it lifts on - #8083

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c18-alerts-pr1
Nov 3, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c18-alerts-pr1

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

User impact

In an AlertDialog, a press that slides from one action to the other runs nothing on lift. UIKit runs the action under the lift.

Problem and solution fit

  1. Why it occurs: the two buttons are separate pressables, with no group tracking.
  2. Why it harms the task: a person who presses the wrong action cannot slide to the right one.
  3. Why it matters: family:action-groups makes every group of sibling actions behave one way.

AlertDialog tracks a held pointer of any kind across its actions through a new internal hook over the shared tracker. The lift runs the action under the pointer through its own click; a lift outside both runs nothing. Focus then does what a click on the lifted action does (FR1), with the focus logic from #8657.

The press controller leaves a tracked action's pointer press to the tracker, its one painter (folded in from #8637, which this supersedes). A tracked action takes no :active paint, so a mouse slide lights one action; a key's press still paints.

Expected behavior and authority

component:AlertDialog FR8 (current); family:action-groups FR1–FR5; spec:AST-094 FR41. The record's FR8 gap note goes, and its verification row, verified_by and compatibility bullet now say FR8 ships: text-only edits that need an eng-owner /approve-spec on this head.

The lifted action fades on the shared 200 ms press fade, as the spec owners decided: a tap is not a gesture.

Smallest restoration

  • hooks/useActionGroupTracking.ts: the hook.
  • hooks/actionGroupTracker.ts: where several actions hold the point (no layout), the press resolves to the action it landed on.
  • utils/pressFeedback.ts, privateAttributes/pressGroupItem.stylex.ts: the marker and its skip.
  • hooks/pressGroupContext.ts, Button.tsx: the tracker alone paints a tracked press. A tracked Button sizes its own :active image to zero unless the tracker lights it. The overlay module, a public entry, gains no export; its SYNC header names Button.
  • scripts/touch-support-bundle.test.mjs: AlertDialog and its importers are gesture users.
  • The actions keep touch-action: pinch-zoom: Chrome on Android cancels a pointer it pans, which would end the press.

Evidence

  • Red-first, each failing before its change: a slide and a finger tap left focus off the lifted action; a user-event click on the action ran nothing in jsdom; with the tracked overlay off, a mouse press slid from Delete to Cancel left Delete's pressed image showing; with the host's style management off, a held finger refused no selection; with the controller's skip removed, three press-paint cases failed.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

Local gates at 3576bcb:

  • Typecheck, pnpm check:repo, strict ESLint and Prettier on the changed files, the private-attribute baseline check, and the touched unit suites (1,492, with every tracker user) pass.
  • pnpm test:ui: 19,027 passed. Node project after a fresh core build: 16,055 passed, 2 expected failures; 7 CLI cases timed out at 30 s under machine load (load average 55). Rerun on their own, the 6 files' 761 cases pass (one file only when run alone).
  • The core build passes, and the API report check shows no change.
  • Storybook builds. AlertDialog's interaction spec (its FR2 case fails with the tracked overlay off): 12/12 in Chromium in two runs, 12/12 pinned to 2 cores with 4 workers, and 120/120 in WebKit in CI's 4-CPU container (×10, 1 worker).
  • AlertDialog's and Button's accessibility contracts: 25/25.
  • The comment-provenance baseline check fails on main itself, for files this PR does not touch.

Writing rubric results

component:AlertDialog: FR8's gap note, the readiness row, the Current-state impact bullet, the compatibility bullets, FR8's verification row and verified_by now say FR8 ships.

  • R1 narration, R2 research, R4 rejected alternatives, R5 change references: none.
  • R3 evidence: FR8's verification row names the suites that verify it.
  • R6 open questions: none touched.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants