Skip to content

fix: make file requests dialog accessible - #64471

Merged
susnux merged 7 commits into
masterfrom
fix/create-file-request-ui-a11y
Nov 6, 2026
Merged

susnux merged 7 commits into
masterfrom
fix/create-file-request-ui-a11y

Conversation

@kristian-zendato

Copy link
Copy Markdown
Contributor

Summary

Improve a11y of the Create file request dialog:

  1. Recipient emails are a semantic list — chips render in a <ul> / <li> with an accessible name (Recipient emails).
  2. Unambiguous chip delete labels — each close button is Remove email: {email} instead of a shared Remove email.
  3. Form labels are programmatically linked — visible legends use <label for>, fields have stable ids, helper text is aria-describedby, and the expiration date keeps a visible linked label.
  4. Upload destination is keyboard-operable — Enter/Space opens the folder picker; typing/paste still do not edit the path.
  5. Focus returns to New — after File request created closes, focus goes back to the New button instead of the Files keyboard-shortcuts UI.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@kristian-zendato
kristian-zendato requested a review from a team as a code owner September 17, 2026 08:12
@kristian-zendato
kristian-zendato requested review from skjnldsv, sorbaugh and susnux and removed request for a team September 17, 2026 08:12
@susnux susnux changed the title Fix/create file request UI a11y fix: make file requests dialog accessible Sep 17, 2026
@susnux susnux added this to the Nextcloud 36 milestone Sep 17, 2026

<div v-if="password !== null" class="file-request-dialog__password-field">
<NcPasswordField
id="file-request-dialog-password"

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.

why the ID?


methods: {
returnFocusTarget(): HTMLElement | null {
return document.querySelector<HTMLElement>('[data-cy-upload-picker] button')

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.

Ideally not use the data selected, but there is also no public "api" here. Maybe

Suggested change
return document.querySelector<HTMLElement>('[data-cy-upload-picker] button')
return document.querySelector<HTMLElement>('.upload-picker button')

@kristian-zendato
kristian-zendato force-pushed the fix/create-file-request-ui-a11y branch from 36d410a to 59ac106 Compare September 28, 2026 15:19
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

{{ t('files_sharing', 'Where should these files go?') }}
<label class="file-request-dialog__legend-label" for="file-request-dialog-destination">
{{ t('files_sharing', 'Where should these files go?') }}
</label>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That should not be the case, now NcTextField has two labels.
The legend doesn't need a label

@skjnldsv skjnldsv Oct 21, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It works, but the announcement is redundant. Two ways to clean it up:

Option A: legend names the group, NcTextField names the field (the easiest I'd say)

Remove the <label> from the legend and keep NcTextField's label prop.

<fieldset class="file-request-dialog__destination" data-cy-file-request-dialog-fieldset="destination">
	<legend>{{ t('files_sharing', 'Where should these files go?') }}</legend>
	<NcTextField
		id="file-request-dialog-destination"
		:label="t('files_sharing', 'Upload destination')"
		…>
		<IconFolder :size="18" />
	</NcTextField>
	…
</fieldset>
  • Group: "Where should these files go?"
  • Field: "Upload destination"
  • This is the intended fieldset/legend semantics. Clicking the legend no longer focuses the input, but the field's own label still does.

Option B: legend label is the only label

Keep <label for> in the legend and stop NcTextField from rendering its own with label-outside.

<fieldset class="file-request-dialog__destination" data-cy-file-request-dialog-fieldset="destination">
	<legend>
		<label class="file-request-dialog__legend-label" for="file-request-dialog-destination">
			{{ t('files_sharing', 'Where should these files go?') }}
		</label>
	</legend>
	<NcTextField
		id="file-request-dialog-destination"
		label-outside
		…>
		<IconFolder :size="18" />
	</NcTextField>
	…
</fieldset>
  • Group and field are both named "Where should these files go?"
  • There is still a double announcement (group + field), but it's acceptable and explicit.
  • Clicking the legend focuses the input.

Either way: link the info text to the field

The lock notice is not announced when the input has focus. Use helper-text, which NcTextField wires up with aria-describedby:

<NcTextField
	…
	:helper-text="t('files_sharing', 'The uploaded files are visible only to you unless you choose to share them.')">

To keep the custom <p> with the lock icon, give it an id and pass aria-describedby="file-request-dialog-destination-info" to NcTextField instead. Check that NcTextField doesn't override its own aria-describedby when you do this.

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.

Vote for A.

@kristian-zendato
kristian-zendato force-pushed the fix/create-file-request-ui-a11y branch from 59ac106 to 0857bf6 Compare October 21, 2026 15:48
Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
kristian-zendato and others added 3 commits November 6, 2026 21:20
…equest UI

Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
… dialog

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux force-pushed the fix/create-file-request-ui-a11y branch from 0857bf6 to 04c6d12 Compare November 6, 2026 20:32
@susnux
susnux requested a review from a team as a code owner November 6, 2026 20:32
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux requested a review from a team as a code owner November 6, 2026 20:55
@susnux
susnux requested review from leftybournes and removed request for a team November 6, 2026 20:55
@susnux
susnux merged commit 4469f01 into master Nov 6, 2026
86 checks passed
@susnux
susnux deleted the fix/create-file-request-ui-a11y branch November 6, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants