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

fix(ui): Profile avatar image motion setting #3044 #3066

Conversation

AndrewCrescencio
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit e02b2db
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/6746db99bd56b60008100e21
😎 Deploy Preview https://deploy-preview-3066--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit e02b2db
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/6746db99d49031000848fe8c

@AndrewCrescencio AndrewCrescencio marked this pull request as draft November 26, 2024 06:50
@AndrewCrescencio AndrewCrescencio marked this pull request as ready for review November 26, 2024 07:48
@shuuji3 shuuji3 self-assigned this Nov 26, 2024
@shuuji3 shuuji3 linked an issue Nov 27, 2024 that may be closed by this pull request
Copy link
Member

@shuuji3 shuuji3 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I confirmed this change stopped gif animation by replacing static image like png when enabled prefers-reduced-motion setting.

@shuuji3 shuuji3 added this pull request to the merge queue Nov 27, 2024
Merged via the queue into elk-zone:main with commit 008248e Nov 27, 2024
13 checks passed
@AndrewCrescencio
Copy link
Contributor Author

AndrewCrescencio commented Nov 27, 2024

nice, just commenting on it, I was a little worried, I don't know if at some point it might happen that the profile doesn't have a photo or doesn't have a static photo

@shuuji3
Copy link
Member

shuuji3 commented Nov 28, 2024

Good point.

Mastodon has ensured avatar_static (https://docs.joinmastodon.org/entities/Account/#avatar) exists since v1.1.2 (in 2017), so I think we don't have to worry about that case, at least for Mastodon.

But the same property might not exist on other fediverse servers so it's safer to fall back to avatar property when there is no avatar_static. It's not optimal, but I think it's better than an empty image.

@shuuji3
Copy link
Member

shuuji3 commented Nov 28, 2024

For example, something like this?

 const preferredMotion = usePreferredReducedMotion()
 const accountAvatarSrc = computed(() => {
-  return preferredMotion.value === 'reduce' ? account.avatarStatic : account.avatar
+  return preferredMotion.value === 'reduce' ? (account?.avatarStatic ?? account.avatar) : account.avatar

@shuuji3
Copy link
Member

shuuji3 commented Nov 28, 2024

ref. GoToSocial returns static avatar like Mastodon: Routes and Methods - GoToSocial Documentation - https://docs.gotosocial.org/en/latest/api/swagger/

@AndrewCrescencio
Copy link
Contributor Author

Yes, but idk if is really needed... thanks for docs link. I should also remove the structure props, because in the test log (issue #2934) is complaining about. I wanted to make the corrections, I don't know if I should make the changes to my fork and create the pull request here again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Profile avatar image does not respect reduced motion setting
2 participants