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

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

Closed
1 of 6 tasks
kbecciv opened this issue Jul 17, 2023 · 18 comments
Closed
1 of 6 tasks

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

kbecciv opened this issue Jul 17, 2023 · 18 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Jul 17, 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. 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
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 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

@Jahanzaib00
Copy link

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

@Jahanzaib00
Copy link

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?

@huzaifa-99
Copy link
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

@jayeshmangwani
Copy link
Contributor

The same root cause as this #22632 issue

cc: @jliexpensify

@adityaaa-r
Copy link
Contributor

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @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>

@huzaifa-99
Copy link
Contributor

huzaifa-99 commented Jul 17, 2023

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

@DrLoopFall
Copy link
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);
}

@DrLoopFall
Copy link
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.

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 17, 2023
@melvin-bot melvin-bot bot changed the title Web - Split bill icons are aligned to the left [$1000] Web - Split bill icons are aligned to the left Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016faf5a12cb59c166

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@jliexpensify
Copy link
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?

@melvin-bot melvin-bot bot added the Overdue label Jul 20, 2023
@jliexpensify
Copy link
Contributor

Bump @Santhosh-Sellavel !

@melvin-bot melvin-bot bot removed the Overdue label Jul 20, 2023
@Santhosh-Sellavel
Copy link
Collaborator

Missed this one somehow!

@Santhosh-Sellavel
Copy link
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
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants