Skip to content

[$1000] Web - Split bill icons are aligned to the left #22993

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Split bill with 8 users
  2. See the icons on the split bill report.

Expected Result:

Split bill icons are aligned to the right

Actual Result:

Split bill icons are aligned to the left

Workaround:

Unknown

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.40-5
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

image (31)
image (30)
image (29)

Expensify/Expensify Issue URL:
Issue reported by: @daveSeife
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689299771028809

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016faf5a12cb59c166
  • Upwork Job ID: 1681073914064621568
  • Last Price Increase: 2023-07-17

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 17, 2023
  2. melvin-bot commented on Jul 17, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jul 17, 2023

    @melvin-bot

    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
  4. Jahanzaib00 commented on Jul 17, 2023

    @Jahanzaib00

    The issue is due to the flexbox property which was aligning the items to the right.

  5. Jahanzaib00 commented on Jul 17, 2023

    @Jahanzaib00

    Hello, from last 2 days I've been working on some of the issues but no matter how quickly I resolve them or send the proposal. Somehow, I've never assigned the issue formally.
    Can some guide, what's the issue?

  6. huzaifa-99 commented on Jul 17, 2023

    @huzaifa-99
    Contributor

    Proposal

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

    We want the multiple avatars of IOUPreview to be right-aligned

    What is the root cause of that problem?

    Currently we are not apply align styles to the MultipleAvatars container view

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

    We need to apply align styles to styles.iouPreviewBoxAvatar

    What alternative solutions did you explore? (Optional)

    n/a

  7. jayeshmangwani commented on Jul 17, 2023

    @jayeshmangwani
    Contributor

    The same root cause as this #22632 issue

    cc: @jliexpensify

  8. adityaaa-r commented on Jul 17, 2023

    @adityaaa-r
    Contributor

    @jayeshmangwani does this mean the issue is closed and don't need any work?

  9. melvin-bot commented on Jul 17, 2023

    @melvin-bot

    📣 @aditya-ragi! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  10. huzaifa-99 commented on Jul 17, 2023

    @huzaifa-99
    Contributor

    My proposal here fixes this issue, reposting for visibility

    Proposal

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

    We want workspace icons to be aligned to right.

    What is the root cause of that problem?

    We do a different kind of width calculation when there are more than 4 icons, but at a single time we only display 4 icons. The extra width moves the icons to left.

    if (props.icons.length > 4) {
    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);
    } else {

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

    We should update the width calculation here. Since we only display a max of 4 icons, we can remove the length calculation and use 4 directly (which comes from props.maxAvatarsInRow), and simplify this whole block with this condition

    const length = Math.min(props.maxAvatarsInRow, props.icons.length)
    width = oneAvatarSize.width + overlapSize * 2 * (length - 1) + oneAvatarBorderWidth * (length * 2);
    image
    image
    image

    What alternative solutions did you explore? (Optional)

    N/A

  11. DrLoopFall commented on Jul 17, 2023

    @DrLoopFall
    Contributor

    Proposal

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

    Split bill icons are not aligned properly

    What is the root cause of that problem?

    We are using left for positioning/shifting avatars, which causes it to use more space than required.

    left: -(overlapSize * index),

    left: -(oneAvatarSize.width * 2 + oneAvatarBorderWidth * 2),

    Also, currently, we are calculating the width, as a workaround, which is also a part of the problem in this issue.

    @stitesExpensify I think the width was set as a workaround for the issue described in my proposal (the 2nd issue)

    We are using left for positioning/shifting avatars but the PressableWithoutFeedback itself is not shifted, which causes it to be clickable in both the original and shifted positions.

    If we use margin-left instead, we can remove the width, which may prevent any future issues.

    if (props.icons.length > 4) {
    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);
    } else {
    // one avatar width + overlaping avatar sizes + border space
    width = oneAvatarSize.width + overlapSize * 2 * (props.icons.length - 1) + oneAvatarBorderWidth * (props.icons.length * 2);
    }

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

    Use margin-left instead of left for positioning the avatar.

    // in getHorizontalStackedAvatarStyle
    - left: -(overlapSize * index)
    + marginLeft: index > 0 ? -overlapSize : 0
    
    // in getHorizontalStackedOverlayAvatarStyle
    - left: -(oneAvatarSize.width * 2 + oneAvatarBorderWidth * 2)
    + marginLeft: -(oneAvatarSize.width + oneAvatarBorderWidth * 2)

    We should also need to remove the width, as we don't need it anymore, because this proposal also removes the need for the workaround as it fixes the issue in the root, and removing it may prevent future issues like this.

    if (props.icons.length > 4) {
    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);
    } else {
    // one avatar width + overlaping avatar sizes + border space
    width = oneAvatarSize.width + overlapSize * 2 * (props.icons.length - 1) + oneAvatarBorderWidth * (props.icons.length * 2);
    }

  12. DrLoopFall commented on Jul 17, 2023

    @DrLoopFall
    Contributor

    I've already made proposals in issue #22632 and #22685 which also has the same exact root cause as this one, implementing any one of the proposals would solve all these 3 issues.

    Also, I've made a proposal above just in case.

    @puneetlath please have a look here also.

  13. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 17, 2023
  14. changed the title [-]Web - Split bill icons are aligned to the left[/-] [+][$1000] Web - Split bill icons are aligned to the left[/+] on Jul 17, 2023
  15. melvin-bot commented on Jul 17, 2023

    @melvin-bot
  16. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 17, 2023
  17. melvin-bot commented on Jul 17, 2023

    @melvin-bot

    Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.

  18. melvin-bot commented on Jul 17, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (External)

  19. jliexpensify commented on Jul 17, 2023

    @jliexpensify
    Contributor

    Hi @Santhosh-Sellavel - we've had a few comments stating that this issue has the same root cause as a few others. Could you check this out, and let us know if this is the case? If so, should we wait on a PR from another issue to resolve this one?

  20. jliexpensify commented on Jul 20, 2023

    @jliexpensify
    Contributor
  21. Santhosh-Sellavel commented on Jul 20, 2023

    @Santhosh-Sellavel
    Collaborator

    Missed this one somehow!

  22. Santhosh-Sellavel commented on Jul 20, 2023

    @Santhosh-Sellavel
    Collaborator

    @jliexpensify This seems like a dupe of #22632 & the same RC.

    We can close this one straightaway, and nothing is due here!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions