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

Avatars are cut to the side on 'Add message' page when user invites more than 12 user a time #23605

Closed
1 of 6 tasks
kavimuru opened this issue Jul 26, 2023 · 5 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jul 26, 2023

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


Action Performed:

  1. Click on 'Profile' avatar
  2. Click on 'Workspaces' link
  3. Click on 'New Workspace' button
  4. Click on 'Members' link
  5. Click on 'Invite' button
  6. Select more than 12 members & click 'Next'

Expected Result:

Avatars should be center aligned & shouldn't be cut off

Actual Result:

Avatars are cut to the left side

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.45-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

2023-07-25.07.09.50.mp4

Snip - (2) New Expensify - Google Chrome

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690269388882669

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 26, 2023
@dukenv0307
Copy link
Contributor

Proposal

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

Avataras are cut to the side on 'Add message' page when user invites more than 12 user a time

What is the root cause of that problem?

The width of avatarContainerStyles is calculated wrongly. When we have 12 user icons, avatarRows have two rows are firstRow has length is 8 and secondRow has length is 4. We calculate length here by get max length of two rows.

const length = avatarRows.length > 1 ? Math.max(avatarRows[0].length, avatarRows[1].length) : avatarRows[0].length;
width = oneAvatarSize.width + overlapSize * 2 * (length - 1) + oneAvatarBorderWidth * (length * 2);

in this case length = 8 => width is calculated with avatar's length = 8. But in

{_.map([...avatars].splice(0, props.maxAvatarsInRow), (icon, index) => (

we just display 4 avatars, so the container width is bigger than the inner one
=> alignItemsCenter makes the avatars get cut to the left side

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

We should calculate length accordingly with props.maxAvatarsInRow by getting min between props.maxAvatarsInRow and Math.max(avatarRows[0].length, avatarRows[1].length)

const length = avatarRows.length > 1 ? Math.min(Math.max(avatarRows[0].length, avatarRows[1].length), props.maxAvatarsInRow) : avatarRows[0].length;

const length = avatarRows.length > 1 ? Math.max(avatarRows[0].length, avatarRows[1].length) : avatarRows[0].length;
width = oneAvatarSize.width + overlapSize * 2 * (length - 1) + oneAvatarBorderWidth * (length * 2);

OPTIONAL:
I think here we should compare props.icons.length with props.maxAvatarsInRow instead of a default constant

if (props.icons.length > 4) {

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.25-07-2023.16.39.13.webm

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@ahmdshrif
Copy link
Contributor

The same root cause as #22632, and thisPR should fix it

@conorpendergrast
Copy link
Contributor

Looks like this was previously reported in #22685 and #23415 too, so closing

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. Daily KSv2
Projects
None yet
Development

No branches or pull requests

4 participants