Skip to content

Conversation

@myabc
Copy link
Contributor

@myabc myabc commented Dec 22, 2025

Ticket

https://community.openproject.org/wp/70166

What are you trying to accomplish?

This PR fixes a number of Accessibility issues detected by ERB Lint + GitHub's A11y Linters.

erb_lint -f compact . | grep GitHub
erb_lint -f compact . --enable-linters git_hub/accessibility/avoid_generic_link_text,git_hub/accessibility/disabled_attribute,git_hub/accessibility/iframe_has_title,git_hub/accessibility/image_has_alt,git_hub/accessibility/link_has_href,git_hub/accessibility/navigation_has_label,git_hub/accessibility/nested_interactive_elements,git_hub/accessibility/no_aria_hidden_on_focusable,git_hub/accessibility/no_aria_label_misuse,git_hub/accessibility/no_positive_tab_index,git_hub/accessibility/no_redundant_image_alt,git_hub/accessibility/no_title_attribute,git_hub/accessibility/no_visually_hidden_interactive_elements,git_hub/accessibility/svg_has_accessible_text

See #13704

Screenshots

What approach did you choose and why?

This is not an exhaustive fix, but rather an incremental pass!!

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@myabc myabc changed the title Bug/fix erb lint accessibility errors [#70166] Fix accessibility errors found by ERB Lint Dec 22, 2025
@myabc myabc force-pushed the bug/fix-erb-lint-accessibility-errors branch from f41d46d to 986b27b Compare December 23, 2025 00:44
myabc added 5 commits January 16, 2026 00:21
- Replaces `title` attribute with `aria-label` for interactive elements.
- Removes `title` from non-interactive elements.
- Converts `<a>` tags without proper `href` to `<button>` elements,
  using Primer `Button`/`IconButton` where possible.
Removes all positive `tabindex` values.
@myabc myabc force-pushed the bug/fix-erb-lint-accessibility-errors branch from 986b27b to f3d723b Compare January 16, 2026 03:22
@myabc myabc changed the base branch from release/17.0 to dev January 16, 2026 03:22
@myabc myabc requested a review from Copilot January 16, 2026 03:22
@myabc myabc added this to the 17.1.x milestone Jan 16, 2026
Copy link
Contributor

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 pull request addresses accessibility issues detected by ERB Lint with GitHub's A11y Linters, focusing on improving the accessibility of UI elements throughout the application.

Changes:

  • Replaced redundant title attributes with appropriate aria-label attributes on interactive elements
  • Converted icon-only buttons to use Primer Design System components with proper ARIA labels
  • Updated test selectors to use accessible names for better test reliability
  • Removed positive tabindex values to improve keyboard navigation
  • Added security improvements (rel="noopener") and form autocomplete attributes

Reviewed changes

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

Show a summary per file
File Description
spec/features/admin/custom_fields/work_packages/list_spec.rb Updated test to use accessible_name selector for "Move to bottom" button
spec/features/admin/custom_fields/shared_custom_field_expectations.rb Updated test to use accessible_name selector for "Move to top" button
modules/webhooks/spec/features/manage_webhooks_spec.rb Simplified test selectors for webhook response modal triggers
modules/webhooks/app/views/webhooks/outgoing/admin/_form.html.erb Removed redundant title attributes from legend elements
modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.rb Renamed method from title to response_body_title for clarity
modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.html.erb Converted link to Primer Button with proper ARIA labels and updated modal trigger selector
modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/totp/_form.html.erb Removed redundant title attribute from legend
modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/sms/_form.html.erb Removed redundant title attributes from legends
modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/confirm.html.erb Removed positive tabindex values from form elements
modules/two_factor_authentication/app/views/two_factor_authentication/settings.html.erb Added rel="noopener" to external link for security
modules/two_factor_authentication/app/views/two_factor_authentication/authentication/request_otp.html.erb Removed positive tabindex values from form elements
modules/avatars/app/views/settings/_openproject_avatars.html.erb Removed redundant title attributes from legends
modules/avatars/app/views/avatars/users/_local_avatars.html.erb Removed redundant title attribute from legend
modules/avatars/app/views/avatars/users/_gravatars.html.erb Removed redundant title attribute from legend
app/views/repositories/revision.html.erb Changed title attributes to aria-label on list items
app/views/onboarding/_configuration_modal.html.erb Removed redundant title attribute from button
app/views/members/_member_form.html.erb Converted anchor tag to button element for close action with proper aria-label
app/views/ldap_auth_sources/_form.html.erb Replaced custom toast with Primer Banner component and updated copyright format
app/views/custom_fields/_custom_options.html.erb Replaced custom reorder links with Primer ButtonGroup component and updated copyright format
app/views/custom_actions/_form.html.erb Changed title attribute to aria-label on close button
app/components/individual_principal_base_filter_component.html.erb Added autocomplete="off" to name filter input

Comment on lines +116 to +121
icon: :"arrow-up",
"aria-label": t(:label_sort_higher),
data: { action: "admin--custom-fields#moveRowUp" }
)
component.with_button(
icon: :"arrow-down",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon names used here are inconsistent with the rest of the codebase. Other similar components use "chevron-up" and "chevron-down" for the up/down movement icons (see app/components/admin/custom_fields/hierarchy/item/actions_component.rb, app/components/admin/enumerations/item_component.rb, etc.), but this change uses :"arrow-up" and :"arrow-down". These should be changed to match the established pattern: use :"chevron-up" instead of :"arrow-up" and :"chevron-down" instead of :"arrow-down".

Suggested change
icon: :"arrow-up",
"aria-label": t(:label_sort_higher),
data: { action: "admin--custom-fields#moveRowUp" }
)
component.with_button(
icon: :"arrow-down",
icon: :"chevron-up",
"aria-label": t(:label_sort_higher),
data: { action: "admin--custom-fields#moveRowUp" }
)
component.with_button(
icon: :"chevron-down",

Copilot uses AI. Check for mistakes.
Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants