Skip to content

fix(lab): smooth CircularProgress indeterminate animation - #5916

Merged
freddymeta merged 1 commit into
mainfrom
fix/circular-progress-indeterminate
Sep 3, 2026
Merged

fix(lab): smooth CircularProgress indeterminate animation#5916
freddymeta merged 1 commit into
mainfrom
fix/circular-progress-indeterminate

Conversation

@freddymeta

@freddymeta freddymeta commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • scale the indeterminate dash with SVG viewport percentages so every size uses the same proportional animation without pathLength rescaling
  • make the final keyframe match the initial dash geometry and shift exactly one full dash period, removing the loop snap
  • record CircularProgress as direction-neutral for the RTL audit

Root cause

The old fixed-unit animation had two discontinuities:

  • the 64px ring's path is about 185 units, but the initial 1, 150 dash pattern totals 151, so SVG repeated it and briefly painted a second dash
  • the final keyframe kept a 90-unit dash through 100%, then reset it to 1 unit in one frame

The new 2%, 300% pattern scales with the square SVG viewport. Its 300% gap exceeds every ring circumference, and the -302% endpoint shifts one complete pattern, so the next iteration begins at equivalent geometry.

Related to #4133.

Visual proof

Frozen at the first animation frame, before (left) and after (right):

CircularProgress before and after

The extra dash near the top of the 64px ring is the flash seen at normal speed.

Chromium boundary samples for the shrinking dash: 16.1272% → 5.41198% → 2.53244% → 2.05847% → 2.00058% → 2%. The loop no longer has a one-frame size collapse.

Test plan

  • pnpm lint:strict
  • GitHub CI test job on exact head 8a0931b — passed
  • pnpm exec vitest run packages/lab/src/CircularProgress/CircularProgress.test.tsx — 32 passed
  • pnpm build
  • pnpm -F @astryxdesign/lab typecheck
  • pnpm -F @astryxdesign/storybook build
  • pnpm -F @astryxdesign/storybook rtl-audit -- --filter CircularProgress — verified N/A, zero gaps
  • node internal/stylex-capabilities/scan.mjs — 83/92 supported
  • Chromium: sampled eight points across the animation for all three sizes; the dash gap cannot repeat, the dash shrinks monotonically into the loop boundary, and no pathLength scaling is present

No changeset: @astryxdesign/lab is private/canary-only, and the repository changeset check passes without one.

— Puck, on behalf of Freddy

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 2, 2026
@vercel

vercel Bot commented Sep 2, 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 Sep 3, 2026 1:06am UTC

Request Review

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Sep 2, 2026
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

CircularProgress (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 328 -
Complexity N/A High (23) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/lab N/A 3.5KB 1.5KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@freddymeta
freddymeta force-pushed the fix/circular-progress-indeterminate branch from 508381a to 447a880 Compare September 2, 2026 13:28
@freddymeta
freddymeta marked this pull request as ready for review September 2, 2026 13:48
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@freddymeta
freddymeta force-pushed the fix/circular-progress-indeterminate branch from 447a880 to c3e0205 Compare September 2, 2026 13:56
@freddymeta

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-09-02.at.9.59.32.PM.mov

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

Thanks, this is good. People waiting on indeterminate progress no longer see the extra dash or loop snap. I checked all three sizes and RTL. [Reviewed by Robohands]

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 3, 2026
github-actions Bot added a commit that referenced this pull request Sep 3, 2026
@freddymeta
freddymeta merged commit 56f7966 into main Sep 3, 2026
28 checks passed
@freddymeta
freddymeta deleted the fix/circular-progress-indeterminate branch September 3, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants