Skip to content

Add animation to Docs Assistant widget#1731

Open
bucanero wants to merge 3 commits into
masterfrom
animate-ai-widget
Open

Add animation to Docs Assistant widget#1731
bucanero wants to merge 3 commits into
masterfrom
animate-ai-widget

Conversation

@bucanero

Copy link
Copy Markdown
Member

This PR updates the "thinking" state of the docs assistant widget so it shows an animated icon next to the three dots while the bot is looking up and writing an answer.

What changed:

docs/js/docs-assistant.js — the placeholder that used to be a static is now a bubble containing:

  • an AI spark icon (accent-pink) that gently pulses and rotates, and
  • three dots that ripple in sequence (typing-indicator style).

It also gets role="status" and aria-label="Searching the docs and writing an answer" so screen readers announce the working state. The error fallback still works (it overwrites the bubble with the text message).

material-overrides/assets/stylesheets/docs-assistant.css — added the da-spark (icon) and da-bounce (dots) keyframe animations, laid the indicator out in a flex row, and included a prefers-reduced-motion guard so the animation is disabled for users who opt out.

The icon uses the existing theme variables (--accent-default, --color-text-secondary), so it follows light/dark mode automatically like the rest of the widget. I verified it renders correctly in the browser.

Copilot AI review requested due to automatic review settings July 13, 2026 13:41
@bucanero bucanero added the A2 - Maintenance Minor Pull request contains minor updates to an existing page (i.e., modifying parameters, steps, etc.) label Jul 13, 2026

Copilot AI 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.

Pull request overview

This PR enhances the Polkadot Docs Assistant “thinking” state by replacing the static ellipsis with an animated spark + typing dots indicator, with an accessibility-oriented status announcement while the assistant is working.

Changes:

  • Updated the “thinking” message markup to render an inline SVG spark icon plus animated dots, and added ARIA status attributes.
  • Added CSS animations (da-spark, da-bounce) and flex layout for the thinking indicator, including a prefers-reduced-motion override.
  • Updated .gitignore to ignore the generated site output directory.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
material-overrides/assets/stylesheets/docs-assistant.css Adds flex layout and keyframe animations for the “thinking” indicator, plus reduced-motion handling.
docs/js/docs-assistant.js Replaces the static placeholder with icon + dot markup and sets ARIA status attributes on the thinking bubble.
.gitignore Ignores the generated site directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread material-overrides/assets/stylesheets/docs-assistant.css
Comment thread docs/js/docs-assistant.js
@bucanero

Copy link
Copy Markdown
Member Author

@illegalcall , I did this small PR based on our chat

@illegalcall

Copy link
Copy Markdown
Contributor

LGTM!

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A2 - Maintenance Minor Pull request contains minor updates to an existing page (i.e., modifying parameters, steps, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants