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

Poll results shows dark avatars only on first opening #8625

Closed
SystemKeeper opened this issue Jan 30, 2023 · 4 comments · Fixed by nextcloud-libraries/nextcloud-vue#3925
Closed

Comments

@SystemKeeper
Copy link
Contributor

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Have a closed poll
  2. Open the results

Expected behaviour

If your system is in dark mode, the user avatars should be requested in dark mode as well

Actual behaviour

First opening:
image

Opening again:
image

Talk app

Talk app version: Master (@ 7dc878f)

Browser

Operating system: MacOS 13.2

Browser name: Safari & Chrome

Browser version: 16.3 & 109

@nickvergessen
Copy link
Member

Basically means we are not using the avatar component

@SystemKeeper
Copy link
Contributor Author

Not sure:

<AvatarWrapperSmall v-for="(item, index) in details.slice(0, 8)"
:id="item.actorId"
:key="index"
:source="item.actorType"
:disable-menu="true"
:disable-tooltip="true"
:show-user-status="false"
:name="getDisplayName(item)"
:condensed="true" />

<NcAvatar v-else-if="!isGuest"
:user="id"
:display-name="name"
:menu-container="menuContainer"
menu-position="left"
:disable-tooltip="disableTooltip"
:disable-menu="disableMenu"
:show-user-status="showUserStatus"
:size="size" />

or which component are you referring to?

@Antreesy
Copy link
Contributor

Antreesy commented Feb 3, 2023

Here are some research results:

  • Avatar comes as image from server. Its color is defined by method avatarUrlGenerator() in NcAvatar.vue
    Related PR: https://github.com/nextcloud/nextcloud-vue/pull/3119/files
  • method avatarUrlGenerator() is called with method loadAvatarUrl(), which is called in mounted hook, but returns different result from the second attempt
  • parameter --background-invert-if-dark: invert(100%) is defined by app theme (dark.css) and remains the same in process

So the conclusion is, result of window.getComputedStyle() call is inconsistent due to different browsers and security reasons
Changing the attribute from this.$el to document.body in this place works, because body and its style aren't changing, unlike the unmounted and mounted again avatar
@CarlSchwan i saw in your PR, that there was a server-related issue. Could you please comment this solution?

@SystemKeeper
Copy link
Contributor Author

Nice analysis 👍
These look similar to what you discovered: nextcloud/server#36462
nextcloud-libraries/nextcloud-vue#3707

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

Successfully merging a pull request may close this issue.

3 participants