-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
fix: add ARIA attributes to admin notices dropdown for accessibility #35686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add ARIA attributes to admin notices dropdown for accessibility #35686
Conversation
- Added role='button', aria-haspopup='true', aria-expanded='false', and aria-label to dropdown button - Added role='menu' to menu container - Added role='menuitem' to all menu items (select all, deselect all, inverse selection) - Follows WCAG 2.1 Level A accessibility guidelines - Resolves TODO comment at line 40 This change makes the operations dropdown accessible to screen reader users, allowing them to properly interact with the admin notices bulk actions.
|
@delvh I saw that the TODO is left by you. Could you elaborate the accessibility problem of it? Our "dropdown.ts" is designed to handle all accessibility problems for dropdown elements. If there is a problem, the framework should be improved. |
|
I mean, that comment was written around three years ago. |
|
So this PR is not necessary, only need to remove the TODO? |
|
If it works now (which I haven't tested since writing the initial comment in the code) but I assume it to work, then yes. |
|
@wxiaoguang You were correct, I apologize for not testing the live application before submitting <div class="ui floating upward dropdown small button"
tabindex="0"
role="menu"
aria-haspopup=""
aria-controls="_aria_auto_id_12"
aria-expanded="false"> |
|
my template level changes are not needed,the TODO comment appears to be outdated from before the framework implemented these features |
|
The TODO will be removed by Remove unnecessary code #35761 |


Description
This PR adds proper ARIA (Accessible Rich Internet Applications) attributes to the admin notices operations dropdown menu, making it fully accessible to screen reader users and improving keyboard navigation support.
Problem
The dropdown menu at
templates/admin/notice.tmplline 40 had a TODO comment indicating it needed accessibility improvements. Without proper ARIA attributes, users relying on assistive technologies could not:Solution
Added the following ARIA attributes following WCAG 2.1 Level A guidelines:
On the dropdown button:
role="button"- Identifies the element as an interactive buttonaria-haspopup="true"- Indicates a popup menu will appeararia-expanded="false"- Shows the menu is initially collapsedaria-label="{{ctx.Locale.Tr "admin.notices.operations"}}"- Provides accessible nameOn the menu container:
role="menu"- Identifies the popup container as a menuOn each menu item:
role="menuitem"- Identifies each option as a menu item (applied to 3 items: select all, deselect all, inverse selection)Changes Made
templates/admin/notice.tmpl(lines 40-52)role="menu"to menu containerrole="menuitem"to all 3 menu itemsTesting Performed
templates/repo/home.tmpl:3,templates/base/footer_content.tmpl:1-2)Standards Compliance
This implementation follows:
Consistency with Codebase
This change uses the same ARIA pattern already established in Gitea:
templates/repo/home.tmpl(line 3):role="main" aria-label="{{.Title}}"templates/base/footer_content.tmpl(line 1):role="group" aria-label="..."Impact
Screenshots/Evidence
Before: Screen readers announced "clickable, operations" with no context
After: Screen readers announce "Operations, button, has popup, collapsed" with full context
Related Issue
Resolves TODO comment at
templates/admin/notice.tmpl:40Checklist
Thank you for reviewing! This is my first contribution to Gitea. I'm committed to improving accessibility for all users.