Skip to content

🎨 Palette: Standardize pagination icon-only buttons for accessibility - #1998

Open
damacus wants to merge 1 commit into
mainfrom
palette-pagination-accessibility-10201013275391994045
Open

🎨 Palette: Standardize pagination icon-only buttons for accessibility#1998
damacus wants to merge 1 commit into
mainfrom
palette-pagination-accessibility-10201013275391994045

Conversation

@damacus

@damacus damacus commented Aug 31, 2026

Copy link
Copy Markdown
Owner

💡 What:
Standardized the accessibility markup for the "Previous" and "Next" pagination icon-only buttons in app/components/admin/users/pagination.rb. Removed visually hidden sr-only inner text and replaced it with clean aria-label attributes on the parent elements. Added role="button" and aria-disabled="true" to the disabled placeholder elements.

🎯 Why:
This is a modern accessibility best practice for icon-only interactive elements. It prevents screen readers from redundantly announcing the visual character (like "Previous less-than") and ensures that disabled states are correctly announced as inactive controls rather than completely skipped by virtual cursors.

📸 Before/After:
(Visual changes remain functionally identical; chevrons are still displayed but are now aria-hidden.)

♿ Accessibility:
Improved structural semantics for assistive technologies reading pagination controls, standardizing them across both their active (Link) and disabled (span) states.


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


Devin Review

- Moved `sr-only` span text to `aria-label` attributes on the parent elements for active links.
- Hidden decorative chevron icons using `aria_hidden: 'true'`.
- Enhanced disabled state spans by adding `role: 'button'` and `aria-disabled: 'true'` to ensure screen readers correctly interpret them as disabled controls rather than ignoring the `aria-label`.

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 2 potential issues.

Devin Review

Comment on lines +95 to +98
data: { turbo_frame: 'admin-users-frame' },
"aria-label": t('admin.users.pagination.previous')
) do
span(class: 'sr-only') { t('admin.users.pagination.previous') }
plain '‹'
span(aria_hidden: 'true') { plain '‹' }

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 tests still require removed markup

Existing component specs still require .sr-only nodes. The mandatory test gate fails after aria-label replaces them.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .jules/palette.md
Comment on lines +1 to +3
## 2024-03-24 - Phlex Pagination Accessibility Refactoring
**Learning:** When refactoring icon-only buttons for accessibility in Phlex components, be cautious of Phlex's block rendering semantics. Returning a string literal inside a Phlex block (e.g., `span { '‹' }`) does not output the text; you must explicitly use the `plain` helper (e.g., `span { plain '‹' }`). Also, when applying `aria-label` to disabled placeholder elements (like a generic non-interactive `span`), remember to include `role="button"` and `aria-disabled="true"` so screen readers correctly identify the element as a disabled interactive control instead of ignoring the `aria-label`.
**Action:** Always use `plain` for text nodes in Phlex blocks and pair `aria-label` with an appropriate interactive role (`role="button"`) and state (`aria-disabled="true"`) when mocking disabled buttons with plain `span` elements.

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.

🔍 Unrelated palette guidance disappears

The new pagination entry deletes three unrelated lessons and the log heading. This broad history rewrite conflicts with the repository’s atomic-change rule.

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