Skip to content

🎨 Palette: Improve pagination accessibility - #2121

Open
damacus wants to merge 1 commit into
mainfrom
palette-pagination-aria-labels-1149261447878206447
Open

🎨 Palette: Improve pagination accessibility#2121
damacus wants to merge 1 commit into
mainfrom
palette-pagination-aria-labels-1149261447878206447

Conversation

@damacus

@damacus damacus commented Sep 7, 2026

Copy link
Copy Markdown
Owner

πŸ’‘ What

Updated the Admin Users Pagination component to use standard aria_label attributes instead of visually hidden span.sr-only tags. For disabled state wrappers, explicitly added role="button" and aria_disabled="true".

🎯 Why

To improve semantic HTML and screen reader accessibility. Visually hidden spans nested inside generic elements (like span tags used for disabled links) are often not interpreted as interactive controls by screen readers unless accompanied by explicit roles and states.

πŸ“Έ Before/After

Before: (Disabled previous button)

<span class="... opacity-50 cursor-not-allowed">
  <span class="sr-only">Previous page</span>
  β€Ή
</span>

After:

<span class="... opacity-50 cursor-not-allowed" role="button" aria-disabled="true" aria-label="Previous page">
  β€Ή
</span>

β™Ώ Accessibility

Ensured that disabled pagination controls are correctly announced as disabled buttons by screen readers rather than plain text nodes. Active links now use standard aria-label attributes instead of relying on sr-only CSS hacks.


PR created automatically by Jules for task 1149261447878206447 started by @damacus


Devin Review

Replaced nested `span.sr-only` screen reader text with explicit `aria_label` attributes on active `Link` components.

For disabled pagination controls which fall back to standard `span` elements, added `role="button"` and `aria_disabled="true"` alongside the `aria_label` to correctly announce their interactive purpose and current state to assistive technologies.

Co-authored-by: damacus <40786+damacus@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ 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.

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 potential issue.

Devin Review

Comment on lines +95 to +105
aria_label: t('admin.users.pagination.previous'),
data: { turbo_frame: 'admin-users-frame' }
) do
span(class: 'sr-only') { t('admin.users.pagination.previous') }
plain 'β€Ή'
end
else
span(class: "#{nav_button_class('rounded-l-md')} opacity-50 cursor-not-allowed") do
span(class: 'sr-only') { t('admin.users.pagination.previous') }
span(
class: "#{nav_button_class('rounded-l-md')} opacity-50 cursor-not-allowed",
role: 'button',
aria_disabled: 'true',
aria_label: t('admin.users.pagination.previous')

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.

πŸ” Pagination specs expect removed markup

Four pagination examples still require .sr-only children. The new ARIA attributes leave these tests failing and untested.

Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

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