-
Notifications
You must be signed in to change notification settings - Fork 159
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
Improve accessibility for the files sidebar #5000
Merged
Merged
Changes from 16 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ac0601a
Improve accessibility for the files sidebar
JammingBen 83892c0
close right side bar on outside click
2a693ce
Remove aria label on file sidebar actions, fix folder href
JammingBen d83429f
Add unit test
JammingBen 7b6f6ea
Transform the favorite-star in sidebar to a button, adjust aria-label
JammingBen e140f07
Add changelog item
JammingBen a1bf5f0
fix label and index for accordion actions in files app
fschade 851cb67
Add componentType for extentsion actions
JammingBen adf71e7
fix click outside
954d77f
Merge branch 'file-sidebar-a11y' of github.com:owncloud/web into file…
4d4b132
Use oc-text-initial class instead of own css
JammingBen b1ed608
Fix xpath selectors on file actions
JammingBen 2176baf
Fix xpath selectors on file actions
JammingBen e2c4117
fix click outside
4e2c7d4
Merge branch 'file-sidebar-a11y' of github.com:owncloud/web into file…
15af335
added comment
e32f1a0
Add a hint for screen readers if an action opens a new window/tab, us…
JammingBen 4ce0a87
Fix xpath selectors on file actions
JammingBen 90b5efa
Fix assertion string
JammingBen 336eca8
Fix xpath selection for actionPanelItems to get the tests running again
JammingBen e9e9334
Fix typo
JammingBen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
changelog/unreleased/enhancement-files-sidebar-accessibility
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Enhancement: Improve accessibility for the files sidebar | ||
|
||
We've did several improvements to enhance the accessibility on the files sidebar: | ||
- Transformed the file name to a h3 element | ||
- Transformed the "Open folder"-action to a link instead of a button | ||
- Transformed the favorite-star to a button-element | ||
- Adjusted aria-label of the favorite-star to describe what it does instead of its current state | ||
- Added a more descriptive close button label | ||
- Clicking outside of the sidebar now closes it | ||
- Removed the aria-label on the action buttons as they already include proper labels | ||
|
||
https://github.com/owncloud/web/pull/5000 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<template> | ||
<oc-app-side-bar | ||
:key="highlightedFile.id" | ||
v-click-outside="onClickOutside" | ||
class="files-sidebar oc-p-s oc-border-l" | ||
:disable-action="false" | ||
:close-button-label="$gettext('Close file sidebar')" | ||
@close="close()" | ||
> | ||
<template v-if="highlightedFile" slot="title"> | ||
|
@@ -11,25 +13,28 @@ | |
</div> | ||
<div class="uk-inline"> | ||
<div class="uk-flex uk-flex-middle"> | ||
<span | ||
<h3 | ||
id="files-sidebar-item-name" | ||
class="oc-mr-s oc-text-bold" | ||
class="oc-text-initial oc-mr-s oc-text-bold uk-margin-remove" | ||
tabindex="-1" | ||
v-text="highlightedFile.name" | ||
/> | ||
</div> | ||
<div class="uk-flex uk-flex-middle"> | ||
<oc-icon | ||
<oc-button | ||
v-if="!publicPage() && isFavoritesEnabled" | ||
id="files-sidebar-star-icon" | ||
:class="['uk-inline', 'oc-mr-xs', favoriteIconClass]" | ||
name="star" | ||
:accessible-label=" | ||
:aria-label=" | ||
highlightedFile.starred | ||
? $gettext('File is marked as favorite') | ||
: $gettext('File is not marked as favorite') | ||
? $gettext('Click to remove this file from your favorites') | ||
: $gettext('Click to mark this file as favorite') | ||
" | ||
appearance="raw" | ||
class="oc-mr-xs" | ||
@click.native.stop="toggleFileFavorite(highlightedFile)" | ||
/> | ||
> | ||
<oc-icon :class="favoriteIconClass" name="star" /> | ||
</oc-button> | ||
<template v-if="highlightedFile.size > -1"> | ||
{{ getResourceSize(highlightedFile.size) }}, | ||
</template> | ||
|
@@ -202,6 +207,22 @@ export default { | |
|
||
expandActionsAccordion() { | ||
this.SET_APP_SIDEBAR_EXPANDED_ACCORDION('files-actions') | ||
}, | ||
|
||
onClickOutside(event) { | ||
/* | ||
* We need to go for this opt-out solution because under circumstances a model will be rendered, | ||
AlexAndBear marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* for example if we click rename, clicking in this model would otherwise falsy close the sidebar. | ||
*/ | ||
|
||
if ( | ||
document.querySelector('.files-topbar').contains(event.target) || | ||
document.querySelector('.oc-topbar').contains(event.target) || | ||
document.querySelector('.oc-app-navigation').contains(event.target) || | ||
event.target.id === 'files-view' | ||
) { | ||
this.close() | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pascalwengerter ugly but I don't see another solution here. |
||
} | ||
} | ||
} | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kulmann this should be
<h2>
according to the accessibility call, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense IMO, I'll go for it for now. We can still revert it later if
h3
was correct.