Skip to content

docs: don't animate pixel loader when not in view - #10576

Open
yihuiliao wants to merge 8 commits into
mainfrom
pixelloader-cpu
Open

docs: don't animate pixel loader when not in view#10576
yihuiliao wants to merge 8 commits into
mainfrom
pixelloader-cpu

Conversation

@yihuiliao

@yihuiliao yihuiliao commented Sep 4, 2026

Copy link
Copy Markdown
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices
  • I understand every change in this PR and can explain why it's there.
  • If AI-assisted, I followed our AI contribution guidance and pointed my assistant at CLAUDE.md.

📝 Test Instructions:

Go to ai components doc page, open chrome's task manager and compare it with the ai component doc page on prod. the cpu should be lower when you are not over the pixel loader section.

🧢 Your Project:

@github-actions github-actions Bot added the S2 label Sep 4, 2026
@rspbot

rspbot commented Sep 4, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Sep 4, 2026

Copy link
Copy Markdown

@yihuiliao yihuiliao changed the title chore: don't animate pixel loader when not in view in docs docs: don't animate pixel loader when not in view Sep 4, 2026
@rspbot

rspbot commented Sep 4, 2026

Copy link
Copy Markdown

@yihuiliao yihuiliao added documentation Improvements or additions to documentation and removed S2 labels Sep 4, 2026
@devongovett

Copy link
Copy Markdown
Member

What do you think about putting this in the PixelLoader component itself rather than something that would need to be copy and pasted from the docs? That would also have the benefit that if you scrolled the response status out of view in the chat it would automatically pause to reduce cpu consumption.

@yihuiliao

Copy link
Copy Markdown
Member Author

hmm good point, i'll take a look

@rspbot

rspbot commented Sep 4, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Sep 4, 2026

Copy link
Copy Markdown

@devongovett

Copy link
Copy Markdown
Member

nice seems to work. one tiny detail is that the setInterval and the animation can get out of sync because the animation is paused mid-cycle and resumes when it comes back into view, whereas the interval re-starts from the beginning. you can sort of see it as an extra delay between icons. they will re-sync on the next iteration though so not too big a deal.

devongovett
devongovett previously approved these changes Sep 4, 2026
Comment thread packages/dev/s2-docs/pages/s2/ai-components.mdx Outdated
Comment thread packages/dev/s2-docs/pages/s2/ai-components.mdx Outdated
@rspbot

rspbot commented Sep 5, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Sep 5, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (9)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/1f84d8d2f4c4f0ef84718a808ef5bb360420094b/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/1f84d8d2f4c4f0ef84718a808ef5bb360420094b/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI documentation Improvements or additions to documentation S2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants