Skip to content
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

Add focus management for uploads #2542

Merged
merged 1 commit into from
Dec 17, 2019
Merged

Conversation

marcus-herrmann
Copy link
Contributor

@marcus-herrmann marcus-herrmann commented Nov 25, 2019

Regarding: progressbar, to listwrapper on complete

Description

Improves upload user flow for screen reader users by making them programmatically aware of

  • the interstitial interface state of an upload in progress
  • the end of mentioned upload progress

Related Issue

Motivation and Context

While visual users can comprehend that an (larger) upload is running and get visual clues about its end, screen readers stay silent during the progress. This PR tackles this issue by adding two steps:

  1. When the upload starts programmatic focus will be sent to the progressbar. In the related ODS PR OcProgress is improved with aria states/information about the upload so screen reader can pick its state up. In order to do so the progressbar has to have focus.
  2. Once the upload has finished screen reader will be informed about the completion via a live region and focus will be sent to the container that wraps the file lists (where the newly uploaded files then will recide).

How Has This Been Tested?

  • No automatic tests (related to my issues with the overall test setup)
  • Manual tests with two tools

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes

Open tasks:

@@ -1,9 +1,9 @@
<template>
<div id="files" class="uk-flex uk-flex-column">
<files-app-bar />
<upload-progress v-show="inProgress.length" class="uk-padding-small uk-background-muted" />
<files-app-bar @upload-start="onUploadStart" @upload-end="onUploadEnd" />
Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, it starts to feel like we need some event bus to globally detect such events like uploads

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marcus-herrmann marcus-herrmann force-pushed the feature/accessible-uploads branch from ad49132 to ebd3f61 Compare November 25, 2019 17:46
@marcus-herrmann marcus-herrmann changed the title Add focus management for uploads [WIP] Add focus management for uploads Nov 28, 2019
@marcus-herrmann marcus-herrmann marked this pull request as ready for review November 28, 2019 08:23
@marcus-herrmann marcus-herrmann self-assigned this Nov 28, 2019
src/phoenix.js Outdated
@@ -65,6 +65,10 @@ Vue.use(VueMeta, {
Vue.component('drag', Drag)
Vue.component('drop', Drop)

// --- Event Bus ----

Vue.prototype.$bus = new Vue()
Copy link
Contributor

@PVince81 PVince81 Nov 28, 2019

Choose a reason for hiding this comment

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

@LukasHirt can you confirm that this approach for a bus makes sense ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

TBH I'd rather see event bus avoided. @marcus-herrmann is it necessary here? Would it be much trouble covering this with state? If needed to stay, pls make the bus a constant and import it only where it's needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Covering it with state was my first approach, I talked with @PVince81 about that and we agreed that this approach was overengeenering/not what the store was meant to be. Keep in mind that there would be more occurances for this, to send for example focus across the interface/components that are not close to each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LukasHirt Here's the first approach mentioned above: #2624

Copy link
Contributor

Choose a reason for hiding this comment

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

@LukasHirt are we ok with the bus then ?

Copy link
Contributor

Choose a reason for hiding this comment

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

now thinking, I remember seeing that it's possible to access the root component using this.$root, would it be possible to use that component as the bus instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This appears to work as well. PR updated

@marcus-herrmann marcus-herrmann force-pushed the feature/accessible-uploads branch from ebd3f61 to 25c584c Compare December 6, 2019 11:18
@marcus-herrmann marcus-herrmann force-pushed the feature/accessible-uploads branch from 25c584c to 08648f1 Compare December 12, 2019 18:03
Regarding: progressbar, to listwrapper on complete
@PVince81 PVince81 force-pushed the feature/accessible-uploads branch from 08648f1 to a967fbc Compare December 17, 2019 06:41
@PVince81
Copy link
Contributor

Rebased

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit dcc2765 into master Dec 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/accessible-uploads branch December 17, 2019 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Needs-Review Needs review from a maintainer Topic:Accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessible uploads
3 participants