-
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
Fix avatar spinner size #2927
Fix avatar spinner size #2927
Conversation
6584cbf
to
5a1fd3f
Compare
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 like the new loading delay behaviour. When an Avatar get's rendered, it shows nothing but the loading spinner and after 5 seconds (timeout in Avatar component) the placeholder with the colored background and one capitalized letter in the center gets displayed. The impression is that the UI is not very responsive/fast. Would be better, to show the placeholder from the start and - without a loading spinner - replace it with the avatar image as soon as it's loaded. In my opinion this doesn't need a visual loading state.
The approach to have and use only one, globally available, avatar component is both good and useful. 🚀 |
5a1fd3f
to
967b1da
Compare
<oc-icon v-if="item.value.shareType === 1" class="uk-margin-small-right" name="group" size="large" /> | ||
<oc-icon v-else class="uk-margin-small-right" name="person" size="large" /> | ||
</template> | ||
<oc-icon v-if="item.value.shareType === shareTypes.group" class="uk-margin-small-right" name="group" size="large" /> |
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.
Add key to v-if, v-else
<div v-else key="collaborator-avatar-placeholder"> | ||
<oc-icon v-if="collaborator.info.share_type === '1'" class="uk-margin-small-right" name="group" size="large" /> | ||
<oc-icon v-if="$_shareType === shareTypes.group" class="uk-margin-small-right" name="group" size="large" /> |
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.
Add key to v-if, v-else
src/components/Avatar.vue
Outdated
@@ -1,12 +1,15 @@ | |||
<template> | |||
<component :is="type" v-if="enabled"> | |||
<oc-avatar :width="width" :loading="loading" :src="avatarSource" :userName="userName" /> | |||
<oc-spinner v-if="loading" size="small" key="collaborator-avatar-spinner" :aria-label="$gettext('Loading')" |
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.
Add key to v-if, v-else
967b1da
to
690fb30
Compare
@LukasHirt I've added the requested keys, please recheck |
and I forgot the changelog entry as this is a bugfix |
Refactored avatar component logic to be located only in Phoenix core. Moved spinner into the avatar component. Adjusted spinner size to match the one of the avatar to avoid layout shifting.
690fb30
to
5df30e4
Compare
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.
🚀
Description
Refactored avatar component logic to be located only in Phoenix core.
Moved spinner into the avatar component.
Adjusted spinner size to match the one of the avatar to avoid layout shifting
Related Issue
Fix #2921
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: