Skip to content

fix(core): a calc() duration token times the press release clock - #10069

Merged
cixzhang merged 6 commits into
meta:mainfrom
vjeux:uikit/c21-theme-timing-callers
Nov 7, 2026
Merged

cixzhang merged 6 commits into
meta:mainfrom
vjeux:uikit/c21-theme-timing-callers

Conversation

@vjeux

@vjeux vjeux commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A theme can write a duration token with calc(). The CSS release fade plays the resolved length, but the press's JavaScript release clock parses the token's text and falls back. It runs 175 ms against a 200 ms fade, so the pressed state clears off its fade. The clock now follows the CSS it times.

Problem and solution fit

The clock parsed its token's text, and calc() text does not parse. CSS resolves it, so the clock and the fade disagree, and the state the clock ends no longer matches the screen. Core's shared theme-timing reader resolves a token as a transition resolves it. The clock now reads through it.

Expected behavior and authority

  • spec:AST-090 FR2: "The durations resolve like any token."
  • spec:AST-094 FR5: the shared release plays --duration-exit.

Smallest restoration

#10068 added the shared reader and has merged. Three commits trim comments from both reviews. The last drops the refresh end that earlier heads carried. AST-094 now lists pull-to-refresh as a gesture component, so its end belongs on its springs, in a follow-up.

  • pressFadeMs reads --duration-exit with readThemeTokens. A time, a zero, no value and an invalid value keep their results.
  • Without core's stylesheet, a token with no value reads its default at the element. So pressFadeMs follows that element's --duration-fast, where main read 175 ms.

Evidence

  • Reproduction before the change: the press clock reads 175 ms for calc(0.1s * 2), where its fade plays 200 ms (not-for-landing 3af61da195).
  • Result after the change: the press clock reads 200 ms.
  • Representative unchanged path: the press clock's results for a time, a zero, no value and an invalid value, in new unit cases.
  • Regression test or other mutation-sensitive proof: the press case fails on 3af61da195.

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

At this head, d697b49, on main 3c7d1b2. It replays this pull request's commits past #10068's merge and v0.7.9, then drops the refresh end. The theme-timing proof uses main's shared StyleX stand-in, which gains the four stubs the press clock's module needs.

  • pnpm test:ui: 21,909 passed in 892 files. pnpm exec vitest run --project node scripts/touch-support-bundle.test.mjs: 11 passed.
  • pnpm -F @astryxdesign/core typecheck and Lab's typecheck: 0 errors. CI=true pnpm lint: 0 errors and no warning in this change's files.
  • check:knowledge, check:changesets, review:pre (0 findings, 122 authored lines) and the public-text check pass.
  • themeTiming, ButtonPress and ListRowPressPaths interaction specs: Chromium 22 passed. The theme-timing proof in WebKit under the CI profile (--cpus=4, CI=1, LP_NUM_THREADS=4), three runs: 8 passed in each.
  • On not-for-landing 3af61da195, the press case fails: the clock reads 175 ms, not 200.
  • RefreshControl.interaction.browser.spec.ts, unchanged from main: Chromium 23 passed and 1 skipped.

@vercel

vercel Bot commented Nov 5, 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 6:21pm UTC

Request Review

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

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 6:34 PM UTC

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d0428b9

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
ContextMenuItem 28.7 kB (+1.0 kB) · 6.3 kB CSS (0) —
MoreMenu 95.9 kB (+951 B) · 17.1 kB CSS (0) —
DropdownMenu 95.6 kB (+946 B) · 17.1 kB CSS (0) —
113 more components
Component Size LoC
lab/Schedule 104.3 kB (+924 B) · 3.9 kB CSS (0) —
Timestamp 32.2 kB (+725 B) · 10.2 kB CSS (0) —
CommandPalette 71.9 kB (+606 B) · 12.4 kB CSS (0) —
DropdownMenuItem 21.8 kB (+602 B) · 6.3 kB CSS (0) —
SelectorOption 20.7 kB (+598 B) · 6.1 kB CSS (0) —
Item 17.3 kB (+590 B) · 5.5 kB CSS (0) —
Pagination 108.2 kB (+582 B) · 17.5 kB CSS (0) —
RadioListItem 66.3 kB (+572 B) · 10.1 kB CSS (0) —
lab/ListInput 100.5 kB (+572 B) · 1.6 kB CSS (0) —
lab/TabBar 73.7 kB (+572 B) · 1.8 kB CSS (0) —
TableSelectionToolbar 68.9 kB (+570 B) · 13.0 kB CSS (0) —
TopNavMegaMenu 68.6 kB (+569 B) · 11.7 kB CSS (0) —
lab/CommentPin 55.6 kB (+566 B) · 1.2 kB CSS (0) —
Switch 100.3 kB (+565 B) · 9.9 kB CSS (0) —
CodeBlock 74.0 kB (+563 B) · 11.2 kB CSS (0) —
DateRangeInput 91.1 kB (+563 B) · 12.3 kB CSS (0) —
SideNavItem 69.4 kB (+563 B) · 11.0 kB CSS (0) —
TextArea 61.3 kB (+561 B) · 9.2 kB CSS (0) —
Link 52.2 kB (+560 B) · 7.0 kB CSS (0) —
ChatLayout 62.6 kB (+559 B) · 10.4 kB CSS (0) —
DateInput 182.1 kB (+559 B) · 16.7 kB CSS (0) —
FileInput 68.1 kB (+558 B) · 10.8 kB CSS (0) —
Stepper 60.9 kB (+558 B) · 10.0 kB CSS (0) —
richtext/RichTextEditorToolbar 250.1 kB (+557 B) · 454 B CSS (0) —
Selector 98.2 kB (+556 B) · 17.1 kB CSS (0) —
TopNavMenu 73.4 kB (+555 B) · 11.1 kB CSS (0) —
InputGroup 55.5 kB (+554 B) · 7.8 kB CSS (0) —
MultiSelector 93.6 kB (+554 B) · 16.6 kB CSS (0) —
RadioList 55.2 kB (+554 B) · 7.2 kB CSS (0) —
AvatarGroupOverflow 47.4 kB (+552 B) · 5.5 kB CSS (0) —
DropdownMenuRadioItem 22.5 kB (+552 B) · 6.6 kB CSS (0) —
ChatSendButton 59.7 kB (+551 B) · 9.9 kB CSS (0) —
Field 53.8 kB (+551 B) · 7.2 kB CSS (0) —
TabMenu 70.6 kB (+551 B) · 11.0 kB CSS (0) —
ChatLayoutScrollButton 59.8 kB (+550 B) · 10.1 kB CSS (0) —
SideNavHeading 74.4 kB (+549 B) · 11.2 kB CSS (0) —
DropdownMenuCheckboxItem 22.5 kB (+548 B) · 6.6 kB CSS (0) —
Thumbnail 63.6 kB (+548 B) · 11.5 kB CSS (0) —
MobileNavToggle 59.6 kB (+547 B) · 9.9 kB CSS (0) —
Banner 61.3 kB (+546 B) · 10.4 kB CSS (0) —
IconButton 59.3 kB (+546 B) · 9.9 kB CSS (0) —
MobileNav 69.5 kB (+546 B) · 10.5 kB CSS (0) —
ToggleButton 60.2 kB (+546 B) · 10.0 kB CSS (0) —
lab/SelectableCardGroup 63.2 kB (+546 B) · 162 B CSS (0) —
Calendar 70.3 kB (+545 B) · 10.5 kB CSS (0) —
ChatDictationButton 59.8 kB (+545 B) · 10.0 kB CSS (0) —
Carousel 68.5 kB (+543 B) · 10.8 kB CSS (0) —
Button 59.3 kB (+542 B) · 9.9 kB CSS (0) —
ListItem 68.8 kB (+542 B) · 11.3 kB CSS (0) —
SideNavCollapseButton 60.1 kB (+542 B) · 9.9 kB CSS (0) —
BaseTypeahead 70.1 kB (+541 B) · 10.8 kB CSS (0) —
TopNavHeading 73.8 kB (+541 B) · 11.0 kB CSS (0) —
richtext/RichTextEditor 295.3 kB (+541 B) · 2.6 kB CSS (0) —
BreadcrumbItem 83.3 kB (+537 B) · 12.0 kB CSS (0) —
Step 30.9 kB (+537 B) · 5.6 kB CSS (0) —
lab/DiffViewer 85.6 kB (+537 B) · 2.1 kB CSS (0) —
FieldLabel 50.0 kB (+536 B) · 5.6 kB CSS (0) —
richtext/RichTextView 275.0 kB (+536 B) · 2.3 kB CSS (0) —
TopNav 71.2 kB (+535 B) · 10.8 kB CSS (0) —
ComplexSelector 69.8 kB (+534 B) · 11.7 kB CSS (0) —
Toast 96.9 kB (+534 B) · 10.2 kB CSS (0) —
CheckboxInput 63.3 kB (+532 B) · 9.1 kB CSS (0) —
Slider 105.7 kB (+532 B) · 8.7 kB CSS (0) —
DialogHeader 62.1 kB (+531 B) · 11.4 kB CSS (0) —
CheckboxListItem 69.9 kB (+530 B) · 11.3 kB CSS (0) —
TimeInput 158.0 kB (+530 B) · 15.7 kB CSS (0) —
lab/EmojiPicker 85.2 kB (+530 B) · 751 B CSS (0) —
AlertDialog 104.0 kB (+528 B) · 14.3 kB CSS (0) —
DrawerHeader 62.3 kB (+527 B) · 12.8 kB CSS (0) —
TextInput 66.6 kB (+525 B) · 11.0 kB CSS (0) —
NumberInput 70.7 kB (+522 B) · 11.3 kB CSS (0) —
Outline 24.7 kB (+521 B) · 4.1 kB CSS (0) —
TopNavItem 13.6 kB (+520 B) · 4.0 kB CSS (0) —
Typeahead 78.6 kB (+520 B) · 12.3 kB CSS (0) —
ChatComposer 76.4 kB (+519 B) · 11.7 kB CSS (0) —
ClickableCard 17.7 kB (+519 B) · 7.1 kB CSS (0) —
SelectableCard 17.9 kB (+519 B) · 7.3 kB CSS (0) —
ButtonGroup 41.2 kB (+515 B) · 3.7 kB CSS (0) —
Tab 14.3 kB (+514 B) · 4.2 kB CSS (0) —
Lightbox 110.9 kB (+512 B) · 10.3 kB CSS (0) —
ChatComposerInput 74.5 kB (+509 B) · 11.2 kB CSS (0) —
ChatComposerTokenElement 74.5 kB (+509 B) · 11.2 kB CSS (0) —
Tokenizer 90.2 kB (+509 B) · 18.3 kB CSS (0) —
SegmentedControlItem 17.2 kB (+506 B) · 4.3 kB CSS (0) —
TopNavMegaMenuItem 13.6 kB (+506 B) · 4.2 kB CSS (0) —
CommandPaletteItem 12.9 kB (+504 B) · 3.6 kB CSS (0) —
Token 28.4 kB (+494 B) · 4.7 kB CSS (0) —
Overlay 22.3 kB (+488 B) · 3.9 kB CSS (0) —
DropdownMenuSubMenu 69.0 kB (+473 B) · 9.7 kB CSS (0) —
Collapsible 26.7 kB (+37 B) · 4.5 kB CSS (0) —
lab/Comments 324.3 kB (+27 B) · 2.5 kB CSS (0) —
PowerSearch 281.0 kB (+24 B) · 23.5 kB CSS (0) —
lab/TransferListSelector 113.1 kB (+17 B) · 1.9 kB CSS (0) —
SideNav 88.6 kB (+4 B) · 11.3 kB CSS (0) —
List 17.6 kB (0) · 651 B CSS (0) —
lab/TabBarItem 3.8 kB (0) · 1.8 kB CSS (0) —
lab/CommentThread 319.3 kB (−10 B) · 2.4 kB CSS (0) —
SegmentedControl 92.1 kB (−11 B) · 6.8 kB CSS (0) —
lab/TransferList 106.3 kB (−16 B) · 1.7 kB CSS (0) —
lab/ChatReactionBar 103.1 kB (−18 B) · 1.1 kB CSS (0) —
DateTimeInput 203.7 kB (−21 B) · 18.4 kB CSS (0) —
Popover 87.4 kB (−24 B) · 13.9 kB CSS (0) —
lab/ChatEmojiPicker 101.9 kB (−36 B) · 773 B CSS (0) —
lab/CommentComposer 143.9 kB (−36 B) · 1.9 kB CSS (0) —
lab/TourStep 93.7 kB (−45 B) · 590 B CSS (0) —
Markdown 179.4 kB (−46 B) · 20.0 kB CSS (0) —
ContextMenu 106.2 kB (−58 B) · 17.0 kB CSS (0) —
CheckboxList 68.1 kB (−72 B) · 8.1 kB CSS (0) —
TreeList 43.1 kB (−73 B) · 5.6 kB CSS (0) —
TableHeaderCell 107.0 kB (−92 B) · 17.2 kB CSS (0) —
TableCell 107.4 kB (−100 B) · 17.4 kB CSS (0) —
AppShell 89.1 kB (−102 B) · 13.4 kB CSS (0) —
Table 116.3 kB (−104 B) · 17.7 kB CSS (0) —

Package size: @astryxdesign/core 6.92 MB packed (+24 B); no new dependencies.

API changes: none in this pull request

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

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@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, and as a draft from a fork it runs once the pull request is ready for review and a maintainer adds the ci:run label.

The press release clock now reads a calc() --duration-exit as the release animation resolves it, so a finger lifted across a group of actions no longer cuts a 200 ms release at 175 ms, and RefreshControl's end now slides on a calc() duration token; both restore spec:AST-094 FR5 and FR45. This diff also carries the shared reader from #10068, and two optional wording suggestions are left inline.

[Automated review]

vjeux added 4 commits November 6, 2026 07:42
…the refresh end as CSS does

pressFadeMs and Lab's refresh endTiming parsed their token's text, so a
hand-written calc() value fell back while the CSS it times played the
resolved length. The press release clock ran 175 ms against a 200 ms
fade, and the refresh's end skipped its slide.

Both now read through core's shared theme-timing reader. pressFadeMs
reads --duration-exit with readThemeTokens. endTiming keeps its rule
that a token with no value means no slide, then resolves the tokens
with resolveTiming. A time, a zero, no value and an invalid value keep
their results. Lab reads resolveTiming from the internal touch entry,
in place of the motion-role parsers, which it no longer reads.
The comment on firstDurationMs restated its name and its parameter, so
it goes. resolveTiming's last JSDoc sentence splits in two, one topic
each.
pressFadeMs's JSDoc and the theme-timing proof's press case called the
release fade a transition. It is an animation, so they name the release
animation's duration. endTiming's comment keeps only its reason: core's
token defaults do not apply, so the end slides only when the theme sets
both tokens.
pressFadeMs's first JSDoc sentence ran to 28 words once it named the
token and how it resolves. It splits in two: where the clock is read
from, then which token that is and how it resolves.

@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 release clock fix is sound and follows AST-094 FR5, but the refresh-end half no longer has spec authority on main.

  • Regression: AST-094 FR45 now lists pull-to-refresh as a gesture component whose program-started moves settle on its springs, so the new calc() curve slide for the refresh end (refreshPull.ts, refreshTouchController.ts:561) and its FR45-labelled browser case contradict it.
  • Regression: desktop behavior change needs an owner decision: under a calc() --duration-medium, the refresh end after a desktop trackpad pull now slides for 600 ms where main ended at once (refreshTouchController.ts:561); gate it to touch input or cite the decision.

The smallest fix for both is to drop the refresh-end half (Lab's two files and their tests, the internal touch entry swap, its bundle-test list and its changeset) and keep the press-clock fix, which stands alone; moving the end onto the pull-to-refresh spring can follow on its own. CI has not run on this head yet: as a draft from a fork, it runs once the pull request is ready for review and a maintainer adds the ci:run label.

[Automated review]

AST-094 lists pull-to-refresh as a gesture component, so the moves its
program starts settle on its springs. Timing its end on resolved
duration tokens would extend a curve slide the record no longer allows,
and it changed the desktop end under a calc() token. So Lab's refresh
end, the internal touch entry, its bundle list and that changeset stay
as on main. Moving the end onto the pull-to-refresh spring can follow
on its own.
@vjeux vjeux changed the title fix(core): calc() duration tokens time the press release and the refresh end fix(core): a calc() duration token times the press release clock Nov 6, 2026
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec d697b49

@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; as a draft from a fork, it runs once the pull request is marked ready for review and a maintainer adds the ci:run label.

The press release clock now reads a calc() --duration-exit as the release animation resolves it, which restores spec:AST-094 FR5, and dropping the refresh-end half clears both earlier blocking findings. On a ButtonGroup segment tapped with a finger under calc(0.1s * 2), the release now runs its full 200 ms instead of stopping at 175 ms.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 6, 2026 17:09
@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 17:34
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 17:34
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 17:37
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 17:37
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec d0428b9

@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: CI passes on this head.

The press release clock now resolves a calc() --duration-exit through core's shared theme-timing reader, which restores spec:AST-094 FR5: a ButtonGroup segment tapped with a finger under calc(0.6s * 2) now stays in its release for the full 1,200 ms instead of clearing at 175 ms. Plain times, zero and values that are not a time keep their results, and desktop mouse and keyboard presses are unchanged.

[Automated review]

@cixzhang
cixzhang merged commit e855791 into meta:main Nov 7, 2026
73 checks passed
@vjeux
vjeux deleted the uikit/c21-theme-timing-callers branch November 7, 2026 18:56

This branch was successfully deployed

1 active deployment
Preview — d0428b9d 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