Skip to content

feat(ProgressBar): UIProgressView's timing under a finger - #8225

Merged
cixzhang merged 4 commits into
meta:mainfrom
vjeux:uikit/c07-progressbar-touch
Nov 3, 2026
Merged

cixzhang merged 4 commits into
meta:mainfrom
vjeux:uikit/c07-progressbar-touch

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Part of matching iOS under a finger (spec:AST-094): ProgressBar eases to each value in 300 ms; iOS's progress view moves linearly, a whole track per second, from wherever its fill is drawn. ProgressBar now does that under a coarse primary pointer.

Options and tradeoffs:

  • Keep the 300 ms ease: unlike iOS.
  • One fixed linear time: small changes crawl, large ones rush.
  • A duration in proportion to the change, from the drawn fill (this PR, UIKit's model), on two motion roles, so a theme's tempo scales it.

Visual authority

  • Existing component/module DD row reused or amended.
  • Durable component-local intent added to the optional Design decisions table by a team design owner.
  • Correction already settled by current family, design, theme, or objective accessibility authority.
  • New shared or cross-component direction settled in docs/design/.

Settled by component:ProgressBar FR4 and DEC-2: UIKit's timing, the 16 px minimum and the empty zero under a finger, on progress.fillTrackMs and progress.curves.fill. Reduced motion still lands at once.

Before and after

10% → 90% under a finger (Chromium), before then after, a row per 50 ms:

Before: eased After: linear

Android emulator, through a busy script:
Android through a block

Mid-flight, minimum and zero, right to left (iOS simulator):
Mid-flight Minimum and zero Right to left

The recordings come from an earlier revision with the same timing; the Chromium tests check it at this head.

State matrix

  • 10 → 90: 800 ms, linear; sent to 30 halfway: 600 ms from the drawn 50%.
  • 0 paints nothing; 1 draws the 16 px minimum, and a mark it covers is on the fill. Right to left mirrors.
  • Tempo 1.5: 10 → 90 takes 1.2 s.
  • Forced colors with a finger: the sized fill lands at once. A mouse, reduced motion and the indeterminate bar: unchanged.

Writing rubric results

component:ProgressBar (FR4's gap lines, its verification row) and the role table: R1–R6 none.

Scope

  • Appearance is the primary intent.
  • Behavior, API, interaction model, and unrelated layout changes were removed or split.
  • The evidence shows the changed pixels actively running, not only source or computed styles.
  • Public text and artifacts contain no internal Meta context.

Testing

Rebased onto main; comments carry no record ids. One summary comment maps every open bot thread; the fixed and moot ones are resolved.

Local gates at 5372476: the core unit suite (18,328); ProgressBar browser specs 39/39 and ×3 on two pinned cores 117/117 (Chromium-only); typecheck, lint, every check and the a11y contract (174) pass.

@vercel

vercel Bot commented Oct 24, 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 2, 2026 11:49pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 24, 2026
@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 3, 2026, 12:07 AM UTC

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5372476

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
ProgressBar · Storybook 🔴 10.4 kB (+2.4 kB) · 7.2 kB CSS (+232 B) 524 (+111) — · — · —

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

API changes: none in this pull request

Committed API report behind this build: core 1 row; run pnpm api:report.

Wide change (shared styles: packages/core/src/theme/derivedVarRegistry.test.ts): 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.

Approval needs an engineering owner's decision first. ProgressBar's new touch presentation (linear motion at 1 s per full track, a 16 px minimum fill, a transparent fill at zero, and no change under Reduce Motion) rests only on the draft spec:AST-094 this pull request adds, and its FR4 would narrow architecture:theme-tokens to pointer presentations. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and you can do that yourself as an engineering owner. Please also add ## Writing rubric results for the record to the description, and settle the Reduce Motion exception against FR8. Independently of that decision:

  • A value that returns to where it came from mid-flight (10% → 90% → 10%) runs about 400 ms although --_progress-bar-duration says 800 ms, because the browser shortens reversed CSS transitions; a 10 → 90 → 10 case in ProgressBarTouch.a11y.chromium.spec.ts would catch it.
  • A mark that falls inside the 16 px minimum fill keeps data-placement="track" and the track mark color.
  • FR7 cites spec:AST-090, which is not in the repository.
  • The diff is 16,490 authored lines because it carries the whole predecessor stack; landing #8196, #8211 and their predecessors first would leave this pull request's own 765-line commit to review.

[Automated review]

@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.

Approval waits on an engineering owner's decision: ProgressBar's iOS touch presentation (linear motion for the 1 s whole-track motion role from the drawn position, a 16 px minimum fill, no fill at zero, and no change under Reduce Motion) rests only on the draft spec:AST-094 this pull request adds, whose FR4 narrows architecture:theme-tokens and whose FR4 and DEC-1 reject the theme motion roles the same head adds. An engineering owner records that decision, including whether the theme roles stay with AST-094 amended or are removed, by commenting /approve-spec <full head SHA> on this pull request, and you can do that yourself as an engineering owner. Please also add ## Writing rubric results for the record to the description. Independently of that decision:

  • A return to the previous value mid-flight (10% → 90% → 10%) runs 400 ms although 0.8 s is declared, because the browser shortens a reversed CSS transition.
  • A theme that sets progress.activityIndicator.cycleMs breaks the Spinner's stepping, since the spoke delays stay at fixed 100 ms steps.
  • The new platform adaptation condition is outside the closed vocabulary of spec:AST-012 FR2, so it needs removing or that record amended first.
  • CI is red: the motion topic's CLI golden (docs-topics.json) is stale after the new role row, and no Changeset names @astryxdesign/cli.
  • astryx docs motion says sheets, menus and navigation play roles that nothing reads yet, and a mark inside the 16 px minimum keeps its track styling.
  • AST-094 FR7 cites a spec:AST-090 that is not in the repository, and the diff is 19,100 authored lines because it carries the predecessor stack; landing those first would leave this pull request's own two commits.

[Automated review]

Comment thread packages/core/src/Spinner/Spinner.tsx Resolved
Comment thread packages/cli/assets/docs/motion.doc.mjs Resolved

@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.

Approval waits on an engineering owner's decision: ProgressBar's iOS touch presentation (linear motion for the 1 s whole-track motion role from the drawn position, a 16 px minimum fill, no fill at zero, and no change under Reduce Motion) rests only on the draft spec:AST-094 this pull request adds, whose FR4 narrows architecture:theme-tokens and whose FR4 and DEC-1 reject the theme motion roles the same head adds. An engineering owner records that decision, including whether the theme roles stay with AST-094 amended or are removed, by commenting /approve-spec <full head SHA> on this pull request, and you can do that yourself as an engineering owner. Please also add ## Writing rubric results for the new record to the description. Independently of that decision:

  • A return to the previous value mid-flight (10% → 90% → 10%) runs 400 ms although 0.8 s is declared, because the browser shortens a reversed CSS transition.
  • A theme that sets progress.activityIndicator.cycleMs breaks the Spinner's stepping, since the spoke delays stay at fixed 100 ms steps.
  • The new platform adaptation condition is outside the closed vocabulary of spec:AST-012 FR2, so it needs removing or that record amended first.
  • astryx docs motion and the theme template describe sheets, menus and navigation playing roles that nothing reads yet, and a mark inside the 16 px minimum keeps its track styling.
  • AST-094 contradicts the code it ships (FR4 and DEC-1, FR8, FR13) and cites a spec:AST-090 that is not in the repository, and the diff is 19,367 authored lines because it carries the predecessor stack, so landing those first would leave this pull request's own commits.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

  • Touch gating. core/src/ProgressBar/ProgressBar.tsx:267 writes its own (pointer: coarse) check. This conflicts with AST-012 FR2 (touch is resolved once, through the closed adaptation vocabulary) and public-component-api INV16. Resolve through the shared touch resolver key so behavior matches the spec. If this behavior genuinely can't be expressed through the resolver, please raise it here as a spec question instead of shipping a separate check.

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

@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.

Approval waits on an engineering owner's decision on the draft spec:AST-094 this pull request adds: ProgressBar's iOS touch presentation (linear motion for the progress.progressView.wholeTrackMs role from the drawn fill, a 16 px minimum, a transparent zero, and landing at once under Reduce Motion) has no current spec authority, and AST-094's FR4 and DEC-1 reject the theme motion roles the same head adds. An engineering owner records that decision, including whether a determinate value change falls under design:reduced-motion and whether the theme roles stay with AST-094 amended or are removed, by commenting /approve-spec <full head SHA> on this pull request; you can do that yourself as an engineering owner. Independently of that decision, these need changes:

  • Under reduced motion a coarse pointer outside iOS still sees the fill slide for 300 ms, because the generated rule is (prefers-reduced-motion: reduce) and (not (pointer: coarse)), although the Changesets say a new value lands at once on every pointer.
  • The 744 px / 500 px compact edge contradicts current spec:AST-012 FR9 and architecture:public-component-api INV17 (width below the effective md point, from the theme's one definition), and the platform condition contradicts AST-012 FR2.
  • The themable timing.reducedMotionCrossFadeMs role (500 ms by default) contradicts design:reduced-motion DR4 and DR2, and astryx docs motion says sheets, menus and navigation play roles that nothing reads yet.
  • AST-094 contradicts the code it ships (FR4 and DEC-1, FR8, FR13) and cites a spec:AST-090 that is not in the repository; the request to take the touch gate from the shared resolver is still open.
  • The diff is 19,833 authored lines because it carries #8196, #8211 and their stack; landing or retargeting them would leave about 1,195 lines of this pull request's own.

[Automated review]

Comment thread packages/cli/assets/docs/motion.doc.mjs Resolved
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026
@vjeux

vjeux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Done in c2f1979, d85e70e and f10050c (head 6a1aba3): the timing, the minimum fill and the empty fill key on (pointer: coarse); the marks' measurement lives in ProgressBarTouch.ts, reads useTouchPresentation() and uses the shared resize observer; the reduced-motion keys are the two shared queries. The keys stay literal, pinned to the resolver's constants by test, because the StyleX build gives imported at-rule keys a different priority.

@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.

Approval waits on an engineering owner identifying the spec that governs ProgressBar's fill geometry under a finger, the 16 px minimum above zero and the transparent fill at zero: no current record covers it, and spec:AST-094 FR42 and DEC-20 (the default look grows no box under touch) bear on it. An engineering owner records that decision by commenting /approve-spec with the full head SHA on this pull request, and you can do that yourself as an engineering owner. Whatever the decision, these changes are needed:

  • Land #8076 and #8196 on their own and rebase, so this branch carries only its ProgressBar change (about 1,350 of 16,431 authored lines).
  • With forced colors and a finger the fill animates width for up to a second, which AST-094 FR5 rules out; letting the value land at once there would conform.
  • Register the touch duration and its linear curve as motion roles of the progress table, with the role test AST-094 FR4 asks for.
  • Add real-device recordings on an iPhone and an Android phone, or narrow the changeset's every-touch-device and busy-script claims.

[Automated review]

// would halve a return mid-flight (10 → 90 → 10). It takes three
// values because two would repeat on that return.
default:
'translateX(calc(max(var(--_progress-bar-fill, 0%), 16px) - 100% + var(--_progress-bar-flip, 0) * 0.01px))',

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.

Held for an engineering owner: the 16 px minimum (and the transparent fill at zero, line 344) has no current spec authority. spec:AST-094 covers touch timing (FR1, DEC-1), leaves platform look and feel out of scope, and its FR42 and DEC-20 say the default look grows no box under touch; at 1% on a 370 px track this draws 16 px where a mouse draws 3.7 px.

Comment thread .changeset/progress-bar-touch-timing.md Outdated
'@astryxdesign/core': patch
---

[feat] Under a finger (a coarse primary pointer, on every touch device), a determinate ProgressBar moves to a new value the way iOS's progress view does: linearly, taking one second per full track of change (0.8 s from 10% to 90%), and from wherever the fill is drawn when the value changes again mid-way. Above zero the fill never draws shorter than two track heights, and at zero it is not drawn. The motion runs on the compositor, so it keeps going while a script runs; under reduced motion a new value lands at once. A mouse or trackpad keeps the theme's duration and easing.

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.

"On every touch device" and "keeps going while a script runs" are claims about iOS Safari and Android Chrome, and spec:AST-094 Platform support asks for real-device evidence for those (spec:AST-013 FR10); the recordings come from a simulator and an emulator. Under forced colors the fill also animates width on the main thread today. Add device recordings, or narrow the wording to what was shown.

@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: the touch timing, 16 px minimum and empty zero match the current ProgressBar record, and the new browser specs pass, but two fixes are needed first.

  • With forced colors and a finger, the sized fill now transitions width linearly for up to 1 s, which spec:AST-094 FR5 rules out for touch motion; letting it land at once there would conform, and the changeset's "runs on the compositor" sentence should then exclude forced colors.
  • useProgressBarTouch registers the progress table in a mount-only Effect that synchronizes nothing and that no runtime code reads (architecture:react-component-runtime INV3), so it can be removed.

[Automated review]

Comment thread .changeset/progress-bar-touch-timing.md Outdated
'@astryxdesign/core': patch
---

[feat] Under a finger (a coarse primary pointer, on every touch device), a determinate ProgressBar moves to a new value the way iOS's progress view does: linearly, taking one second per full track of change at the theme's default tempo (0.8 s from 10% to 90%), and from wherever the fill is drawn when the value changes again mid-way. A theme's tempo scales that time. Above zero the fill never draws shorter than two track heights, and at zero it is not drawn. The motion runs on the compositor, so it keeps going while a script runs; under reduced motion a new value lands at once. A mouse or trackpad keeps the theme's duration and easing.

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.

"The motion runs on the compositor, so it keeps going while a script runs" holds outside forced colors only: with forced colors and a finger the fill animates width on the main thread. Scope the sentence, or make it true by landing the forced-colors fill at once.

@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in dc95057. With forced colors and a finger, the sized fill now lands at once. A forced-colors case checks that no transition runs. The mount Effect is gone, and the changeset names forced colors. Under reduced motion, component:ProgressBar FR4 says a new value lands at once on every pointer.

@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: the touch timing, 16 px minimum and empty zero match the current ProgressBar record, and both earlier fixes landed, but the new '@media (forced-colors: active) and (pointer: coarse)' key in ProgressBar.tsx fails core's touch-key spelling test (utils/touchPresentation.test.ts), which passes on main. Nesting the forced-colors 0s under the existing '@media (pointer: coarse)' key, as width already does, fixes it and keeps the forced-colors Chromium spec green; the two source-reading assertions in ProgressBar.test.tsx (lines 1215 and 1252) then need updating.

[Automated review]

@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in df714d7. The forced-colors 0s now nests under the existing (pointer: coarse) key, and the source assertion matches it. The forced-colors Chromium case and the whole core unit suite pass at that head.

@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.

Recommending approval: under a finger the fill now follows UIProgressView's timing, 16 px minimum and empty zero exactly as the current component:ProgressBar FR4 states, and nesting the forced-colors duration under the touch key fixes the touch-key test from the last round. The repository's spec-owner check still needs an engineering owner to comment /approve-spec with this head's SHA, because the record changes. Three optional comment trims are left inline.

[Automated review]

vjeux added 4 commits November 2, 2026 14:36
Under a coarse primary pointer a determinate value change moves the way
UIProgressView's setProgress(_:animated: true) does: linearly, for the
progress.fillTrackMs role (1000 ms per whole track) times the share of the
track the value moved, on the progress.curves.fill role, scaled by the
theme's tempo, starting from wherever the fill is drawn. Above zero the
fill draws at least two track heights (16px), a mark that length covers
counts as on the fill, and at zero it paints nothing. A mouse keeps the
theme's timing, and reduced motion still lands at once
(component:ProgressBar FR4).
…s at once

Under forced colors the fill is sized by width, a layout property that
touch motion never animates (spec:AST-094 FR5), so with a finger it now
lands at once there instead of taking the touch duration. The touch layer
no longer registers the progress table in a mount Effect: nothing at
runtime reads the registry, and the generated role table registers it.
…uch key

Core spells every pointer media key the way the touch presentation resolver
does, so the forced-colors 0s duration nests under the existing
(pointer: coarse) key instead of a compound key of its own.
… ids

The touch layer's comments cited record ids, which the source-comment
rule leaves to `pnpm specs:for`, and several ran past one short
sentence. They now state each reason in short sentences. The motion
table's ProgressBar file was linked to its records only through those
citations, so the component record now lists it.
@vjeux
vjeux force-pushed the uikit/c07-progressbar-touch branch from df714d7 to 5372476 Compare November 2, 2026 23:36
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Open review threads at 5372476, by disposition:

I resolve the fixed and moot threads. The argued ones stay open.

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 5372476

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 2, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 2, 2026 23:40

@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.

Recommending approval: under a finger the fill now follows UIProgressView's timing, its 16 px minimum and the empty zero exactly as the current component:ProgressBar FR4 states, and the new Chromium spec passes at this head while failing against the base. No changes are required; three optional comment trims are left inline.

[Automated review]

Comment on lines +254 to +263
// Under a finger (TOUCH_QUERY, on every touch device), the fill moves as
// UIProgressView's setProgress(_:animated: true) does. It moves linearly
// from wherever it is drawn. Its duration is the `progress.fillTrackMs` role
// times the share of the track the value moved (`--_progress-bar-move`).
// Its curve is the `progress.curves.fill` role (`--_progress-bar-curve`).
// The touch layer (ProgressBarTouch) writes both, and this rule scales the
// duration by the theme's tempo. Above zero, the fill never draws shorter
// than the touch minimum (`--_progress-bar-min`, 16px on the 8px track). At
// zero it paints nothing (`fillEmpty`). Under reduced motion it lands at
// once, as everywhere (below). A mouse or trackpad keeps the theme's timing.

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.

Optional: most of this block restates the variables, keys and the fillEmpty rule written just below. Keeping only the reason reads better, for example: "Under a coarse pointer the fill follows UIProgressView: it moves linearly from where it is drawn, for a time in proportion to the change."

Comment on lines +569 to +570
// Under a finger the fill moves as UIProgressView's does and draws at least
// 16px; what that needs from script is the touch layer's (ProgressBarTouch).

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.

Optional: this comment restates the useProgressBarTouch call below it, so it can go.

import {observeResize} from '../utils/sharedResizeObserver';
import {useTouchPresentation} from '../utils/touchPresentation';

/** The track's height. */

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.

Optional: this JSDoc restates the constant's name. A constraint is more useful here: "Equals the track's height in ProgressBar.tsx."

@cixzhang
cixzhang merged commit 3b3052a into meta:main Nov 3, 2026
107 checks passed
@vjeux
vjeux deleted the uikit/c07-progressbar-touch branch November 3, 2026 03:02

This branch was successfully deployed

1 active deployment
Preview — 53724765 Deployed Nov 2, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants