Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
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.
💡 What: Added logic to
ProgressBarButtonto setcontentDescriptionto@string/loadingwhen 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:
PR created automatically by Jules for task 1440675815958682234 started by @dlukt