Repository navigation
Conversation
Chartman123
requested changes
Nov 16, 2026
Comment on lines
+272
to
+277
| const uploadButtonLabel = computed<string>(() => { | ||
| return maxAllowedFilesCount.value > 1 | ||
| ? t('forms', 'Upload files') | ||
| : t('forms', 'Upload a file') | ||
| }) | ||
|
|
Collaborator
There was a problem hiding this comment.
Please use the n function for the translations here, that already handles plurals out of the box
Collaborator
|
@v01dst Thanks for your contribution. Please also add the AI block back to the PR description if you used AI for this. DCO also doesn't pass as you didn't sign-off your commit |
v01dst
force-pushed
the
fix/3839-file-upload-button-name
branch
from
November 16, 2026 16:21
86c1d2f to
428c38c
Compare
The upload button of a file question only holds an icon, so a screen reader announces it as "button" without saying what it does. axe reports it as `button-name`, which fails WCAG 4.1.2. The button now gets an `aria-label`. It says "Upload a file" for a question that takes one file and "Upload files" when more than one file is allowed. The visible text "Add new file as answer" stays where it is: it belongs to the label of the hidden file input, not to the button. Fixes nextcloud#3839 Signed-off-by: v01dst <v01dst@users.noreply.github.com> Assisted-by: OpenCode:MiniMax-M3.1-Flash
v01dst
force-pushed
the
fix/3839-file-upload-button-name
branch
from
November 17, 2026 15:33
428c38c to
3523117
Compare
Author
|
Thanks for the hint. The commit is signed off now, and the AI block is back in the description. The commit also carries an If anything else is missing, please tell me. |
Collaborator
The requested changes in QuestionFile.vue regarding the translations are still pending :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The upload button of a file question carries only an icon (
IconUpload/IconUploadMultiple). A screen reader announces it as "button" and nothingtells the user what it does, which fails WCAG 4.1.2 Name, Role, Value. axe
reports it as
button-name(critical).The visible text "Add new file as answer" is not a fix here: it belongs to the
<label>around the hidden<input type="file">, so it never reaches thebutton.
In the editor the button is disabled as well, so it shows up there as an
unnamed, disabled button.
Solution
The button gets an
aria-label:The label follows
maxAllowedFilesCount, the same setting that picks theicon, so the two never disagree.
Test
playwright/e2e/a11y-question-inputs.spec.tsgains a case that opens a formwith a file question, switches to the view mode and looks for the button by
its accessible name:
Looking the button up by role and name is the same check a screen reader
does, so the test fails without the fix.
Testing
npx prettier --checkon both changed files: passesnpx eslinton both changed files: passesnpm run typecheck: no new errors. The project has 113 type errors onmainalready (QuestionDate.vue,QuestionMultiple.vue,QuestionRanking.vueand others); the count and the file list areunchanged with this branch applied.
The Playwright suite needs a running Nextcloud server, so it could not be
executed here.
Fixes #3839
🤖 AI (if applicable)
An AI coding agent (OpenCode, MiniMax-M3.1-Flash) drafted the component
change and the Playwright case. I read the diff line by line, ran prettier,
eslint and the type check, and wrote the text above myself.