-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Enh/beta improvements #41481
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
Enh/beta improvements #41481
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,6 @@ | |
| tabindex="0" | ||
| @close="close" | ||
| @update:active="setActiveTab" | ||
| @update:starred="toggleStarred" | ||
| @[defaultActionListener].stop.prevent="onDefaultAction" | ||
| @opening="handleOpening" | ||
| @opened="handleOpened" | ||
|
|
@@ -50,6 +49,16 @@ | |
|
|
||
| <!-- Actions menu --> | ||
| <template v-if="fileInfo" #secondary-actions> | ||
| <NcActionButton :close-after-click="true" | ||
| @click="toggleStarred(!fileInfo.isFavourited)"> | ||
| <template v-if="fileInfo.isFavourited" #icon> | ||
| <StarOutline :size="20" /> | ||
| </template> | ||
| <template v-else #icon> | ||
| <Star :size="20" /> | ||
| </template> | ||
| {{ fileInfo.isFavourited ? t('files', 'Add to favorites') : t('files', 'Remove from favorites') }} | ||
| </NcActionButton> | ||
| <!-- TODO: create proper api for apps to register actions | ||
| And inject themselves here. --> | ||
| <NcActionButton v-if="isSystemTagsEnabled" | ||
|
|
@@ -98,6 +107,9 @@ import $ from 'jquery' | |
| import axios from '@nextcloud/axios' | ||
| import moment from '@nextcloud/moment' | ||
|
|
||
| import Star from 'vue-material-design-icons/Star.vue' | ||
| import StarOutline from 'vue-material-design-icons/StarOutline.vue' | ||
|
|
||
| import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js' | ||
| import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' | ||
| import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' | ||
|
|
@@ -117,6 +129,8 @@ export default { | |
| NcEmptyContent, | ||
| SidebarTab, | ||
| SystemTags, | ||
| Star, | ||
| StarOutline, | ||
| }, | ||
|
|
||
| data() { | ||
|
|
@@ -189,7 +203,8 @@ export default { | |
| * @return {string} | ||
| */ | ||
| subtitle() { | ||
| return `${this.size}, ${this.time}` | ||
| const starredIndicator = this.fileInfo.isFavourited ? '★ ' : '' | ||
| return `${starredIndicator} ${this.size}, ${this.time}` | ||
| }, | ||
|
|
||
| /** | ||
|
|
@@ -246,7 +261,6 @@ export default { | |
| }, | ||
| compact: this.hasLowHeight || !this.fileInfo.hasPreview || this.isFullScreen, | ||
| loading: this.loading, | ||
| starred: this.fileInfo.isFavourited, | ||
|
Contributor
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. We should then decide if we simply want to drop this in the library as well. |
||
| subname: this.subtitle, | ||
| subtitle: this.fullTime, | ||
| name: this.fileInfo.name, | ||
|
|
||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.
If we want to make it more discoverable / prominent that the file is a favorite we might want to use this instead.
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.
Is this accessible? The grey one would meet the contrast requirements I would hope.
CC @JuliaKirschenheuter
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.
I think we would have to use an icon with alt text / aria-label, right @JuliaKirschenheuter @marcoambrosini?
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.
Well we have
--icon-starred-yellowas an icon that fulfills accessibility requirements for bright and dark mode.Uh oh!
There was an error while loading. Please reload this page.
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.
The problem is that the NcAppSidebar only accepts a string in that subline. I suggest we add the text "favorite" beside the star, so a screen reader would read out the info too.
Contrast is ok, yes.
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.
Also not possible, there it's either the switch or nothing. I suggest we go ahead with this and we modify the sidebar component so that we can slot in a proper icon there as @susnux suggests
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.
Why is this not possible? Since the current solution is not accessible ("star" is not understandable as "favorite", and we can not add an aria-label) we need to do it otherwise.
Can we please do:
@marcoambrosini @szaimen
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.
and we have already everything we need
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.
I don't think that this is not accessible.
Emoji is read by a screen reader. It could be unclear that "star" means "favorite". But it is the same for all users. Any user needs to understand that "star" is "a starred file" which means "favorite".
This would be good to have a description here. But not required if we appeal to a common user experience of "starring".
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.
Ok, thanks for the assessment @ShGKme – then @AndyScherzinger and I would agree we should merge this as-is for now.
In the long term however it could possibly be better to have an image with aria-label which is more explicit, which we could also place on the top right of the filetype icon so it is symmetric to the files list.