Skip to content

fix(core): a press inside a scroll view highlights 150 ms after touch - #10260

Merged
cixzhang merged 6 commits into
meta:mainfrom
vjeux:uikit/c01-press-onset
Nov 7, 2026
Merged

cixzhang merged 6 commits into
meta:mainfrom
vjeux:uikit/c01-press-onset

Conversation

@vjeux

@vjeux vjeux commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a phone or a tablet, a pressable inside a scroll view highlights 150 ms after the finger lands, so a flick scrolls without a flash (spec:AST-094 FR11). A busy page runs the touch listener late. The press code started its 150 ms wait only when that listener ran, so the highlight came late by the listener's delay, and by a different amount each time.

In the iOS 26.2 Simulator, Mobile Safari ran the listener 8 to 17 ms after the touch, and the highlight came 159 to 169 ms after it. With this change it comes 151 to 155 ms after the touch, in the same session.

Who is affected: every Astryx pressable inside a scroll view, through the shared press controller (buttons, list rows, menu rows, cards), and SegmentedControl, Switch, Slider and usePressTracker controls there, through the gesture system's press tracker. Their highlight is now on time. Outside a scroll view nothing changes: the highlight still comes in the frame the finger lands. A mouse and the keyboard are unaffected.

Problem and solution fit

  1. Why is the highlight late? utils/pressFeedback.ts armed its onset timer as a 150 ms setTimeout when its pointerdown listener ran. gestures/PressTracker.ts armed contentTouchDelay when the touch reached it. Both counted from when the code ran, not from the touch.
  2. Why does that harm the task? The page runs the listener after the touch, once the main thread is free: tens of milliseconds on a busy page in Mobile Safari. The highlight then trails the finger by that time on top of the content-touch delay.
  3. Why does that matter? FR11 times the highlight from touch-down, as UIKit's delaysContentTouches does. A highlight that trails by a varying delay reads as lag, and motion that starts with the press mark, such as a ContextMenu trigger's hold growth, inherits it.

The fix counts each wait from the touch's own time: an event's timeStamp, or a gesture touch's time. The time the page took to run the code comes off the wait. A time that is not on the page's clock (zero, ahead of now, or an epoch time such as a synthetic event's) counts as now, so the wait stays the full 150 ms. Each age is read on the clock of the window the touch landed in: a same-origin iframe's or a popup's clock starts later than the page's.

Expected behavior and authority

spec:AST-094 FR11: "A cell (a table or collection cell) highlights 150 ms after touch-down inside a scroll view … A control inside a scroll view takes the same 150 ms delay before its highlight and then follows its control profile." Its verification row asks for "press and long-press tests on synthetic streams with explicit timestamps". The record is unchanged: the code now does what it says.

Smallest restoration

  • utils/inputAge.ts (new, internal): one helper owns how old a touch is. clockOf finds the clock of the window that stamped an input (an event's view, or a node's window, else this window's), timeOn reads a stamp on that clock, and msSinceInput(time, source) is the input's age, never below 0. clockOf and timeOn come from hooks/longPressDetector.ts, which now imports them. Where the two rules disagreed, the long-press detector's wins: an epoch-millisecond stamp, as jsdom makes, keeps its age (a 60 ms-old one now waits 90 ms for the press onset too, as for the hold). Real browsers stamp on the performance clock, so they see no change.
  • utils/pressFeedback.ts: apply takes the touch's age, and the onset timer waits 150 ms less that age, never below 0. The flash and fade timers are unchanged, since each starts with its own paint. It passes the event, so the age reads the clock of the event's own window.
  • gestures/PressTracker.ts: touchBegan's contentTouchDelay wait loses the touch's age the same way. It passes the touch's target, so a control in a same-origin iframe or a popup reads that window's clock, as GestureHost does for a mover's age.
  • hooks/longPressDetector.ts: imports clockOf and timeOn instead of keeping its own, so the long-press hold reads a touch's age as the press onset does. Its behavior is unchanged.
  • The gesture recognizers already arm their timers on the event clock (setTimer(event.time + duration)), so the action groups' long-press tracking needs nothing.

No API, record, default or visual change.

Evidence

  • Reproduction before the change: iOS 26.2 Simulator, Mobile Safari, the press feedback "Buttons in a scroller" story, a real finger held on "Action 1". All times are from the pointerdown's own timeStamp. On main (3bd058c) the listener ran at 8–17 ms and the mark came at 159–169 ms (6 rounds).
  • Result after the change: in the same session, interleaved with main, the listener ran at 8–19 ms and the mark came at 151–155 ms (6 rounds). A second session: 152–158 ms (6 rounds).
  • Representative unchanged path: outside a scroller the highlight still comes in the frame the finger lands (the units and ButtonPress's "outside a scroller" browser case).
  • Regression tests, red first against main's code:
    • pressFeedback: "counts the content-touch delay from the touch's own timestamp, so a listener that runs late still paints on time" (a listener 60 ms late paints at 90 ms), and "paints at once when the listener runs later than the content-touch delay".
    • PressTracker: "counts the content-touch delay from the touch's own time, so a touch delivered late still highlights on time".
    • All three fail on main's code and pass here. The off-clock guard cases pass on both.
  • A press in a same-origin iframe, red first against the page's clock: the gesture system's browser case "a press in a same-origin iframe's scroll view waits the content-touch delay from the touch, on that window's clock" highlighted 100 ms after the touch in Chromium and 2 ms after it in WebKit, with the age taken on the page's clock. It passes here. The case first checks that the iframe's clock starts more than 150 ms after the page's. The units "reads the clock of the window the input landed in, as an iframe's" (inputAge) and "reads a touch's time on the clock of its own window, as an iframe's touch carries" (PressTracker) fail the same way. With msSinceInput ignoring the target's window, or PressTracker passing no target, the browser case fails 3 of 3.
  • One rule for a touch's age: the unit "reads a 60 ms-old epoch stamp as 60 ms old for both the press onset and the long-press hold" gives the same stamp to msSinceInput (60) and to the long-press detector (its 500 ms hold fires at 440 ms). With the previous inputAge.ts, longPressDetector.ts and pressFeedback.ts, it fails, as do the new epoch-stamp cases in the inputAge and pressFeedback suites. The long-press suites pass unchanged.
  • ButtonPress's browser case "inside a scroller, a held press waits UIScrollView's content-touch delay" now measures from the pointerdown's timeStamp, not from its listener, since the claim counts from the touch.

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

To check by hand, on an iPhone or the iOS Simulator, in the press feedback "Buttons in a scroller" story: hold a finger on a button. The highlight comes about 150 ms after the touch, also on a busy page. A flick still scrolls with no flash, and a button outside the scroller still highlights as the finger lands.

What was run at this head (main a888b3d merged in), after a fresh pnpm install --frozen-lockfile, with Storybook built from this head's code.

  • Static: typecheck, CI=true pnpm lint on the changed files, strict ESLint and Prettier on them, check:knowledge, changeset coverage and review:pre pass.
  • Node: test:node 17,024 passed, 2 expected failures, 71 skipped, 0 failed (944 files).
  • Unit: test:ui 22,131/22,131. The pressFeedback, PressTracker, inputAge, long-press detector and useLongPress suites 151/151. With main's pressFeedback.ts and PressTracker.ts, the three timing cases fail. With the page's clock in inputAge.ts and PressTracker.ts, the two iframe-clock cases fail. With the previous inputAge.ts, longPressDetector.ts and pressFeedback.ts, the shared-rule case and the epoch-stamp cases fail.
  • Browser, Chromium: ButtonPress, ButtonPressTiming, ButtonPressRelease, ListRowPress, ListRowPressPaths, SegmentedControl, Switch, TabPressPointer and the gesture system's gestures.interaction: 203 passed and 5 skipped by engine gates.
  • Browser, WebKit, CI profile (--cpus=4 -e CI=1 -e LP_NUM_THREADS=4 --cpuset-cpus=0-99, 1 worker): the same 9 files, 171 passed and 37 skipped by engine gates.
  • iOS 26.2 Simulator: as in Evidence.

Inside a scroll view, a pressable waits the content-touch delay before
its highlight. The press controller and PressTracker started that wait
when their code ran, so a busy page that handled the touch late made
the highlight late by the same time. In the iOS 26.2 Simulator the
listener ran 8 to 52 ms after the touch, and the highlight came 159 to
213 ms after it. It now comes 151 to 158 ms after the touch.

The wait now counts from the touch's own time: an event's timeStamp,
or a gesture touch's time. A time off the page's clock counts as now.
This affects every pressable in a scroll view, and SegmentedControl,
Switch, Slider and usePressTracker controls there.
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 7, 2026 2:32am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 2:33 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · f061085

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Button · Storybook 56.5 kB (+175 B) · 9.8 kB CSS (0) 688 (0) ✓ · ✓ · ✗
NumberInput 67.9 kB (+198 B) · 11.2 kB CSS (0) — — · — · —
Switch 97.2 kB (+197 B) · 9.9 kB CSS (0) — — · — · —
111 more components
Component Size LoC Visual · A11y · RTL
DateRangeInput 87.8 kB (+188 B) · 12.3 kB CSS (0) — — · — · —
lab/ChatReactionBar 99.8 kB (+187 B) · 1.1 kB CSS (0) — — · — · —
lab/Schedule 100.7 kB (+182 B) · 3.9 kB CSS (0) — — · — · —
Step 30.0 kB (+178 B) · 5.6 kB CSS (0) — — · — · —
Typeahead 75.2 kB (+178 B) · 12.3 kB CSS (0) — — · — · —
lab/ListInput 97.3 kB (+177 B) · 1.6 kB CSS (0) — — · — · —
ChatComposerInput 71.0 kB (+176 B) · 11.1 kB CSS (0) — — · — · —
MultiSelector 90.3 kB (+176 B) · 16.5 kB CSS (0) — — · — · —
ContextMenuItem 27.2 kB (+175 B) · 6.3 kB CSS (0) — — · — · —
Slider 102.6 kB (+175 B) · 8.7 kB CSS (0) — — · — · —
lab/TransferList 91.9 kB (+175 B) · 1.7 kB CSS (0) — — · — · —
ChatComposerTokenElement 71.0 kB (+174 B) · 11.1 kB CSS (0) — — · — · —
IconButton 56.5 kB (+173 B) · 9.8 kB CSS (0) — — · — · —
DateTimeInput 200.4 kB (+172 B) · 18.3 kB CSS (0) — — · — · —
ChatSendButton 56.9 kB (+171 B) · 9.8 kB CSS (0) — — · — · —
TableSelectionToolbar 66.0 kB (+171 B) · 13.0 kB CSS (0) — — · — · —
lab/CommentComposer 140.3 kB (+171 B) · 1.9 kB CSS (0) — — · — · —
MobileNavToggle 56.8 kB (+170 B) · 9.8 kB CSS (0) — — · — · —
lab/TransferListSelector 98.9 kB (+170 B) · 1.9 kB CSS (0) — — · — · —
DialogHeader 59.2 kB (+168 B) · 11.4 kB CSS (0) — — · — · —
SelectableCard 17.1 kB (+168 B) · 7.3 kB CSS (0) — — · — · —
TopNavItem 12.8 kB (+168 B) · 4.0 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 98.7 kB (+168 B) · 773 B CSS (0) — — · — · —
Lightbox 107.6 kB (+167 B) · 10.3 kB CSS (0) — — · — · —
TopNavMegaMenu 65.6 kB (+167 B) · 11.7 kB CSS (0) — — · — · —
TopNavMegaMenuItem 12.9 kB (+167 B) · 4.2 kB CSS (0) — — · — · —
TreeList 42.8 kB (+167 B) · 5.6 kB CSS (0) — — · — · —
ChatLayout 59.7 kB (+166 B) · 10.4 kB CSS (0) — — · — · —
CodeBlock 71.1 kB (+166 B) · 11.1 kB CSS (0) — — · — · —
lab/DiffViewer 82.8 kB (+166 B) · 2.1 kB CSS (0) — — · — · —
ChatComposer 73.0 kB (+165 B) · 11.7 kB CSS (0) — — · — · —
ChatDictationButton 57.0 kB (+165 B) · 9.9 kB CSS (0) — — · — · —
ChatLayoutScrollButton 57.0 kB (+165 B) · 10.0 kB CSS (0) — — · — · —
SideNavCollapseButton 57.3 kB (+165 B) · 9.9 kB CSS (0) — — · — · —
ToggleButton 57.3 kB (+165 B) · 9.9 kB CSS (0) — — · — · —
Banner 58.5 kB (+163 B) · 10.4 kB CSS (0) — — · — · —
CommandPaletteItem 12.1 kB (+163 B) · 3.6 kB CSS (0) — — · — · —
ListItem 65.7 kB (+162 B) · 11.1 kB CSS (0) — — · — · —
MobileNav 66.2 kB (+162 B) · 10.5 kB CSS (0) — — · — · —
DrawerHeader 59.4 kB (+161 B) · 12.8 kB CSS (0) — — · — · —
CheckboxListItem 66.7 kB (+160 B) · 11.1 kB CSS (0) — — · — · —
DateInput 178.0 kB (+160 B) · 16.6 kB CSS (0) — — · — · —
Popover 84.2 kB (+160 B) · 13.9 kB CSS (0) — — · — · —
AvatarGroupOverflow 45.2 kB (+159 B) · 5.5 kB CSS (0) — — · — · —
SelectorOption 19.8 kB (+158 B) · 6.0 kB CSS (0) — — · — · —
Stepper 58.1 kB (+158 B) · 10.0 kB CSS (0) — — · — · —
TimeInput 154.7 kB (+158 B) · 15.7 kB CSS (0) — — · — · —
AppShell 86.4 kB (+157 B) · 13.3 kB CSS (0) — — · — · —
Calendar 67.4 kB (+157 B) · 10.4 kB CSS (0) — — · — · —
Link 49.4 kB (+157 B) · 7.0 kB CSS (0) — — · — · —
RadioListItem 63.5 kB (+157 B) · 10.0 kB CSS (0) — — · — · —
Token 27.5 kB (+157 B) · 4.7 kB CSS (0) — — · — · —
CheckboxInput 60.5 kB (+156 B) · 9.1 kB CSS (0) — — · — · —
Item 16.4 kB (+156 B) · 5.5 kB CSS (0) — — · — · —
Outline 23.9 kB (+156 B) · 4.1 kB CSS (0) — — · — · —
lab/TourStep 90.5 kB (+156 B) · 590 B CSS (0) — — · — · —
AlertDialog 100.4 kB (+155 B) · 14.2 kB CSS (0) — — · — · —
ClickableCard 16.9 kB (+155 B) · 7.1 kB CSS (0) — — · — · —
CommandPalette 67.4 kB (+155 B) · 12.4 kB CSS (0) — — · — · —
DropdownMenuItem 20.8 kB (+155 B) · 6.2 kB CSS (0) — — · — · —
FileInput 65.3 kB (+155 B) · 10.8 kB CSS (0) — — · — · —
lab/CommentPin 53.4 kB (+154 B) · 1.2 kB CSS (0) — — · — · —
lab/CommentThread 303.6 kB (+154 B) · 2.4 kB CSS (0) — — · — · —
Collapsible 26.3 kB (+153 B) · 4.5 kB CSS (0) — — · — · —
lab/SelectableCardGroup 60.4 kB (+153 B) · 162 B CSS (0) — — · — · —
BaseTypeahead 66.7 kB (+152 B) · 10.8 kB CSS (0) — — · — · —
TopNav 67.9 kB (+152 B) · 10.8 kB CSS (0) — — · — · —
richtext/RichTextView 272.1 kB (+152 B) · 2.3 kB CSS (0) — — · — · —
DropdownMenuRadioItem 21.6 kB (+151 B) · 6.6 kB CSS (0) — — · — · —
TextInput 63.9 kB (+151 B) · 11.0 kB CSS (0) — — · — · —
ComplexSelector 66.8 kB (+150 B) · 11.6 kB CSS (0) — — · — · —
Tab 13.5 kB (+150 B) · 4.2 kB CSS (0) — — · — · —
SegmentedControlItem 16.4 kB (+149 B) · 4.3 kB CSS (0) — — · — · —
SideNav 85.8 kB (+149 B) · 11.2 kB CSS (0) — — · — · —
lab/EmojiPicker 82.3 kB (+149 B) · 751 B CSS (0) — — · — · —
SideNavItem 66.3 kB (+147 B) · 10.9 kB CSS (0) — — · — · —
richtext/RichTextEditor 292.5 kB (+146 B) · 2.6 kB CSS (0) — — · — · —
Tokenizer 86.6 kB (+144 B) · 18.2 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 21.6 kB (+143 B) · 6.6 kB CSS (0) — — · — · —
Thumbnail 60.8 kB (+143 B) · 11.4 kB CSS (0) — — · — · —
Carousel 65.3 kB (+142 B) · 10.8 kB CSS (0) — — · — · —
Toast 94.0 kB (+135 B) · 10.1 kB CSS (0) — — · — · —
Markdown 163.9 kB (+127 B) · 19.8 kB CSS (0) — — · — · —
TabMenu 67.6 kB (+125 B) · 11.0 kB CSS (0) — — · — · —
TopNavMenu 70.5 kB (+123 B) · 11.1 kB CSS (0) — — · — · —
lab/Comments 308.8 kB (+119 B) · 2.5 kB CSS (0) — — · — · —
BreadcrumbItem 80.5 kB (+115 B) · 12.0 kB CSS (0) — — · — · —
ContextMenu 91.8 kB (+113 B) · 16.8 kB CSS (0) — — · — · —
Pagination 105.0 kB (+112 B) · 17.4 kB CSS (0) — — · — · —
Selector 95.0 kB (+112 B) · 17.1 kB CSS (0) — — · — · —
TopNavHeading 70.8 kB (+112 B) · 10.9 kB CSS (0) — — · — · —
SideNavHeading 71.3 kB (+110 B) · 11.1 kB CSS (0) — — · — · —
SegmentedControl 90.3 kB (+107 B) · 6.8 kB CSS (0) — — · — · —
Table 101.2 kB (+107 B) · 17.5 kB CSS (0) — — · — · —
PowerSearch 277.5 kB (+104 B) · 23.3 kB CSS (0) — — · — · —
TableHeaderCell 92.6 kB (+103 B) · 17.0 kB CSS (0) — — · — · —
DropdownMenu 91.8 kB (+92 B) · 17.0 kB CSS (0) — — · — · —
TableCell 93.0 kB (+92 B) · 17.3 kB CSS (0) — — · — · —
MoreMenu 92.1 kB (+80 B) · 17.0 kB CSS (0) — — · — · —
DropdownMenuSubMenu 65.4 kB (+78 B) · 9.6 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 246.3 kB (+71 B) · 454 B CSS (0) — — · — · —
NavHeadingMenu 15.6 kB (+39 B) · 3.5 kB CSS (0) — — · — · —
InputGroup 52.6 kB (+37 B) · 7.8 kB CSS (0) — — · — · —
Field 51.0 kB (+35 B) · 7.2 kB CSS (0) — — · — · —
RadioList 52.4 kB (+34 B) · 7.2 kB CSS (0) — — · — · —
CheckboxList 54.8 kB (+33 B) · 8.0 kB CSS (0) — — · — · —
FieldLabel 47.7 kB (+22 B) · 5.6 kB CSS (0) — — · — · —
Overlay 21.7 kB (+17 B) · 3.9 kB CSS (0) — — · — · —
TextArea 58.4 kB (+16 B) · 9.2 kB CSS (0) — — · — · —
ButtonGroup 40.1 kB (0) · 3.7 kB CSS (0) — — · — · —
Timestamp 23.3 kB (−1 B) · 10.1 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 6.84 MB packed (+1.8 kB); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 24 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec a74129e

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet. It runs once the pull request is marked ready for review and a maintainer adds the ci:run label, since the branch is in a fork.

Both content-touch waits now count from the touch's own timestamp, as spec:AST-094 FR11 asks ("highlights 150 ms after touch-down inside a scroll view"), and the three new explicit-timestamp tests fail without the fix and pass with it.

  • Non-blocking: the msSinceInput JSDoc (packages/core/src/utils/inputAge.ts:16) names "a synthetic event's" time as an epoch time, but in a browser a script-created event is stamped on the page clock; epoch stamps come from DOM emulators such as jsdom.

[Automated review]

Comment thread packages/core/src/utils/inputAge.ts Resolved
@vjeux
vjeux marked this pull request as ready for review November 6, 2026 11:31
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 6, 2026
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 11:45
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 11:46
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 11:46
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 11:46
@vjeux
vjeux marked this pull request as draft November 6, 2026 12:52
@vjeux
vjeux force-pushed the uikit/c01-press-onset branch from 0071635 to a74129e Compare November 6, 2026 12:56
@vjeux
vjeux marked this pull request as ready for review November 6, 2026 12:57
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 29a439a

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the press-onset fix is right for the page's own document, but it shortens the content-touch wait wrongly for controls rendered into another window's document.

  • Miss: PressTracker subtracts a touch's time, stamped on its own document's clock, from this bundle's performance.now() (gestures/PressTracker.ts:351-354), so for a Switch, SegmentedControl or Slider inside a scroll view in a same-origin iframe or a second window the 150 ms wait drops to 0 and the highlight comes 101–123 ms after touch-down in Chromium instead of 150 ms; measure the age on the clock of the window that stamped the touch, as GestureHost.ts:1183 already does, and add a case to the existing iframe harness.

The new explicit-timestamp tests fail on the old code and pass here, so the main-document fix itself is well proven. The earlier non-blocking note on the inputAge.ts JSDoc wording stays in its thread. Some CI jobs were still running when this was written.

[Automated review]

A touch in a same-origin iframe or a popup carries a time on that
window's clock, which starts later than the page's. PressTracker took
the touch's age on the page's clock, so the content-touch wait in a
scroll view there dropped to about 100 ms. msSinceInput now reads the
clock of the window that the touch's target belongs to, as GestureHost
does for a mover's age.
@vjeux
vjeux marked this pull request as draft November 6, 2026 20:54
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec ddd4d27

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the CI run on this head stopped at admission because CI was full, so its tests have not run yet. Re-run all jobs of the CI workflow so the required checks run.

Both content-touch waits now count from the touch's own timestamp, as spec:AST-094 FR11 asks, and a touch's age is read on its own window's clock, so a control in a same-origin iframe keeps the full 150 ms. The explicit-timestamp unit tests and the iframe browser case fail against the old code and pass here.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 6, 2026 21:54
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 9d97d51

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one finding. The FR11 timing fix itself checks out: the new explicit-timestamp tests fail with main's code and pass here, and the same-origin iframe case holds in Chromium.

  • Miss: utils/inputAge.ts adds a second implementation of the touch-clock logic that hooks/longPressDetector.ts already has in clockOf and timeOn, with a different rule for epoch-millisecond stamps (for the same 60 ms-old stamp the press onset waits 150 ms and the long-press detector 90 ms), so please move those two helpers into inputAge.ts, build msSinceInput on them, and have longPressDetector.ts import them.

CI is still running on this head.

[Automated review]

Comment thread packages/core/src/utils/inputAge.ts Resolved
@vjeux
vjeux marked this pull request as draft November 7, 2026 01:04
hooks/longPressDetector.ts read a touch's time with its own clockOf
and timeOn. utils/inputAge.ts now owns both, and msSinceInput builds
on them, so the press onset and the long-press hold read a touch's
age the same way. An epoch stamp, as jsdom makes, now keeps its age
for the press onset too, as it already did for the hold. The press
onset also reads the clock of the event's own window.
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 5b61705

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because a draft runs no CI, so marking the pull request ready for review starts it.

The earlier finding is fixed: utils/inputAge.ts now owns clockOf and timeOn, msSinceInput builds on them, and the long-press detector imports them, so a touch's age reads the same for the press onset and the hold. Both content-touch waits count from touch-down as spec:AST-094 FR11 requires, and the explicit-timestamp tests fail with main's code and pass here.

[Automated review]

@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec f061085

@vjeux
vjeux marked this pull request as ready for review November 7, 2026 02:38
@cixzhang
cixzhang merged commit 6cbcbf8 into meta:main Nov 7, 2026
152 of 158 checks passed
@vjeux
vjeux deleted the uikit/c01-press-onset branch November 7, 2026 04:34

This branch was successfully deployed

1 active deployment
Preview — f0610857 Deployed Nov 7, 2026 by vercel[bot]
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants