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

Group - Offline added avatar is not showing with reduced opacity #40427

Closed
5 of 6 tasks
izarutskaya opened this issue Apr 18, 2024 · 21 comments
Closed
5 of 6 tasks

Group - Offline added avatar is not showing with reduced opacity #40427

izarutskaya opened this issue Apr 18, 2024 · 21 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@izarutskaya
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v1.4.63-0
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Crate a group chat
  2. Navigate to the group chat
  3. Apply offline mode
  4. Click on chat header > click on upload avatar icon
  5. Upload avatar

Expected Result:

Avatar should be grayed out

Actual Result:

Avatar is not grayed out

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6453314_1713426435179.offline_avatar.mp4

View all open jobs on GitHub

@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

Triggered auto assignment to @flodnv (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Apr 18, 2024

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 18, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@izarutskaya
Copy link
Author

@abekkala I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb.

@nexarvo
Copy link
Contributor

nexarvo commented Apr 18, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Offline added avatar is not grayed out

What is the root cause of that problem?

Right now we don't set pendingFields for group avatars that's why The pendingAction is null here:

pendingAction={pendingAction}

We are not setting pendingFields in updateGroupChatAvatar

What changes do you think we should make in order to solve the problem?

We can set pendingFields in optimistic data here:

const optimisticData: OnyxUpdate[] = [
    {
        onyxMethod: Onyx.METHOD.MERGE,
        key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
        value: {
            avatarUrl: file?.uri ?? '',
+            pendingFields: {
+               avatar: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
+           },
        },
    },
];

Finally we will pass pendingActions below to be used in OfflineWithFeedback:

<AvatarWithImagePicker
source={icons[0].source}
isUsingDefaultAvatar={!report.avatarUrl}
size={CONST.AVATAR_SIZE.XLARGE}
avatarStyle={styles.avatarXLarge}
shouldDisableViewPhoto
onImageRemoved={() => {
// Calling this without a file will remove the avatar
Report.updateGroupChatAvatar(report.reportID ?? '');
}}
onImageSelected={(file) => Report.updateGroupChatAvatar(report.reportID ?? '', file)}
editIcon={Expensicons.Camera}
editIconStyle={styles.smallEditIconAccount}
/>
) : (
<RoomHeaderAvatars
icons={icons}

pendingAction={report?.pendingFields?.avatar ?? undefined}

What alternative solutions did you explore? (Optional)

@flodnv
Copy link
Contributor

flodnv commented Apr 18, 2024

This is from #39757 @marcaaron 🙃

@marcaaron
Copy link
Contributor

Definitely not a Deploy Blocker.

Avatar should be grayed out

@shawnborton What do you think about this?

We could use a greyscale filter on the image. There's a library here that can do it: https://github.com/iyegoroff/react-native-color-matrix-image-filters

@marcaaron marcaaron added Weekly KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 18, 2024
@marcaaron
Copy link
Contributor

@nexarvo I think it would have a default avatar, but not match the user uploaded avatar or default avatars for Group Chats. Or what else would it look like?

@shawnborton
Copy link
Contributor

Ah, for offline pending patterns, we don't use grayscale filters - we just reduce opacity to something like 50%. Gut check from @trjExpensify & @Expensify/design please!

@trjExpensify
Copy link
Contributor

Yeah, 50% opacity for pending create. The account profile avatar should have a good example to follow.

@nexarvo
Copy link
Contributor

nexarvo commented Apr 18, 2024

@shawnborton @marcaaron yes it's 50% opacity. Below I attached the screen shot for the result of my RCA above

Online Offline
Screenshot 2024-04-19 at 12 04 49 AM Screenshot 2024-04-19 at 12 04 14 AM

@marcaaron
Copy link
Contributor

marcaaron commented Apr 18, 2024

Ok cool, thanks for the memory refresh @trjExpensify @shawnborton 🙇

@nexarvo There's a small detail though that this already has an open issue here. And @s77rt is assigned. @s77rt have you made progress on that or would you like to work with @nexarvo on this one as the C+?

If so, I will close this and mark that other issue as External and keep you both assigned.

@marcaaron marcaaron changed the title Group - Offline added avatar is not grayed out Group - Offline added avatar is not showing with reduced opacity Apr 18, 2024
@dannymcclain
Copy link
Contributor

Also quick note: I don't think the button should be 50% opacity, just the image, right? The button isn't disabled, so it should still be full opacity.

CleanShot 2024-04-18 at 15 45 12@2x

@nexarvo
Copy link
Contributor

nexarvo commented Apr 19, 2024

Coming from this comment from @s77rt. @marcaaron I think we can continue with your comment here

@shawnborton
Copy link
Contributor

That's a great shout Danny, you are totally right about that.

@s77rt
Copy link
Contributor

s77rt commented Apr 19, 2024

@marcaaron Working with @nexarvo sounds great!

@nexarvo Please comment on the other issue so you can be assigned. For the PR let's add the errors logic too, it's pretty straightforward, add errorFields.avatar

@nexarvo
Copy link
Contributor

nexarvo commented Apr 24, 2024

@dannymcclain @shawnborton for Profile and Workspace pages when we change picture offline then the icon also fades to 50% opacity. Do we need to make the behaviour of Group Chat avatar consistent with other pages ?

@shawnborton
Copy link
Contributor

I think fading the icon is a bug and we should fix that so that only the picture is faded out and not the pencil icon. Can we fix that everywhere?

@dannymcclain
Copy link
Contributor

I think fading the icon is a bug and we should fix that so that only the picture is faded out and not the pencil icon. Can we fix that everywhere?

Agree. If we can fix that everywhere that'd be awesome.

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2024
@marcaaron
Copy link
Contributor

Closing in favor of #39983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants