Skip to content

🎨 Palette: Add 'Loading' state accessibility to ProgressBarButton#75

Merged
dlukt merged 1 commit intomasterfrom
palette-progressbarbutton-loading-a11y-1440675815958682234
Feb 19, 2026
Merged

🎨 Palette: Add 'Loading' state accessibility to ProgressBarButton#75
dlukt merged 1 commit intomasterfrom
palette-progressbarbutton-loading-a11y-1440675815958682234

Conversation

@dlukt
Copy link
Owner

@dlukt dlukt commented Feb 19, 2026

💡 What: Added logic to ProgressBarButton to set contentDescription to @string/loading when the progress bar is visible, and restore it when the progress bar is hidden.

🎯 Why: To provide accurate feedback to screen reader users when a button is in a processing state, preventing confusion where the button announces an action (e.g., "Follow") while visually showing a loading spinner.

Accessibility:

  • Screen readers will now announce "Loading…" instead of the static button text when the button is busy.
  • Restores original accessibility behavior when loading completes.

PR created automatically by Jules for task 1440675815958682234 started by @dlukt

When ProgressBarButton enters a loading state, it visually hides the text and shows a spinner. However, for screen readers, the button text (e.g., 'Follow') was still announced, which was confusing. This change sets the content description to 'Loading…' while the spinner is visible, and restores the original content description (or text fallback) when the loading finishes.

Co-authored-by: dlukt <201112286+dlukt@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 19, 2026 14:25
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link

Copilot AI left a comment

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 accessibility for the ProgressBarButton component by dynamically updating the content description to inform screen reader users when a button enters a loading state. The implementation saves the original content description when showing the progress indicator and restores it when loading completes.

Changes:

  • Added instance variable to track original content description
  • Modified setProgressBarVisible() to set content description to "Loading" when showing progress, and restore it when hiding
  • Added guard conditions to prevent redundant state updates

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

@dlukt dlukt merged commit 9a5490a into master Feb 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments