Repository navigation
feat(ProgressBar): UIProgressView's timing under a finger - #8225
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
b339f1f to
52da7a5
Compare
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
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-durationsays 800 ms, because the browser shortens reversed CSS transitions; a 10 → 90 → 10 case inProgressBarTouch.a11y.chromium.spec.tswould 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]
There was a problem hiding this comment.
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.cycleMsbreaks the Spinner's stepping, since the spoke delays stay at fixed 100 ms steps. - The new
platformadaptation condition is outside the closed vocabulary ofspec:AST-012FR2, 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 motionsays 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-090that 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]
There was a problem hiding this comment.
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.cycleMsbreaks the Spinner's stepping, since the spoke delays stay at fixed 100 ms steps. - The new
platformadaptation condition is outside the closed vocabulary ofspec:AST-012FR2, so it needs removing or that record amended first. astryx docs motionand 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-090that 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]
|
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:
This is about where the behavior lives, not about the PR's intent. |
|
Agreed: one implementation.
|
There was a problem hiding this comment.
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-012FR9 andarchitecture:public-component-apiINV17 (width below the effectivemdpoint, from the theme's one definition), and theplatformcondition contradicts AST-012 FR2. - The themable
timing.reducedMotionCrossFadeMsrole (500 ms by default) contradictsdesign:reduced-motionDR4 and DR2, andastryx docs motionsays 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-090that 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]
|
Done in c2f1979, d85e70e and f10050c (head 6a1aba3): the timing, the minimum fill and the empty fill key on |
There was a problem hiding this comment.
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
widthfor 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
progresstable, 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))', |
There was a problem hiding this comment.
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.
| '@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. |
There was a problem hiding this comment.
"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.
bd4ecc6 to
4f71407
Compare
There was a problem hiding this comment.
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
widthlinearly for up to 1 s, whichspec:AST-094FR5 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. useProgressBarTouchregisters the progress table in a mount-only Effect that synchronizes nothing and that no runtime code reads (architecture:react-component-runtimeINV3), so it can be removed.
[Automated review]
| '@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. |
There was a problem hiding this comment.
"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.
|
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, |
There was a problem hiding this comment.
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]
|
Fixed in df714d7. The forced-colors |
There was a problem hiding this comment.
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]
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.
df714d7 to
5372476
Compare
|
Open review threads at 5372476, by disposition:
I resolve the fixed and moot threads. The argued ones stay open. |
|
/approve-spec 5372476 |
There was a problem hiding this comment.
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]
| // 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. |
There was a problem hiding this comment.
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."
| // 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). |
There was a problem hiding this comment.
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. */ |
There was a problem hiding this comment.
Optional: this JSDoc restates the constant's name. A constraint is more useful here: "Equals the track's height in ProgressBar.tsx."
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:
Visual authority
DDrow reused or amended.Design decisionstable by a team design owner.docs/design/.Settled by
component:ProgressBarFR4 and DEC-2: UIKit's timing, the 16 px minimum and the empty zero under a finger, onprogress.fillTrackMsandprogress.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:
Android emulator, through a busy script:

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

The recordings come from an earlier revision with the same timing; the Chromium tests check it at this head.
State matrix
Writing rubric results
component:ProgressBar(FR4's gap lines, its verification row) and the role table: R1–R6 none.Scope
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.