You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WS - Members - Avatars group on final screen moves to the left if admin invites more 8 users #22685
There's also another issue #22632, connected to this, even though the issues are different, the root cause remains the same.
I've made a proposal there which would solve both issues, I'll also leave a proposal below just in case.
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.
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.
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.
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
Activity
melvin-bot commentedon Jul 11, 2023
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 11, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)StevenKKC commentedon Jul 11, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Avatars group on final screen moves to the left if admin invites more 8 users.
What is the root cause of that problem?
Avatar group's width is calculated as below.
App/src/components/MultipleAvatars.js
Lines 138 to 144 in 702d8e2
App/src/components/MultipleAvatars.js
Lines 91 to 93 in 702d8e2
If have more than 8 avatar,
lengthwould be greater thanprops.maxAvatarsInRow(4).So avatar group moves to the left.
What changes do you think we should make in order to solve the problem?
Avatar group's width should be equal to or less than
props.maxAvatarsInRow.We can change code as below.
What alternative solutions did you explore? (Optional)
None.
DrLoopFall commentedon Jul 12, 2023
There's also another issue #22632, connected to this, even though the issues are different, the root cause remains the same.
I've made a proposal there which would solve both issues, I'll also leave a proposal below just in case.
DrLoopFall commentedon Jul 12, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace members avatars group on the final screen moves to the left if the admin invites more than 8 users
What is the root cause of that problem?
We are using
leftfor positioning/shifting avatars, which causes it to use more space than required.App/src/styles/StyleUtils.js
Line 906 in 702d8e2
App/src/styles/StyleUtils.js
Line 923 in 702d8e2
Also, currently, we are calculating the width, as a workaround, which is also a part of the problem in this issue.
App/src/components/MultipleAvatars.js
Lines 138 to 144 in 702d8e2
What changes do you think we should make in order to solve the problem?
Use
margin-leftinstead ofleftfor positioning the avatar.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.
App/src/components/MultipleAvatars.js
Lines 138 to 144 in 702d8e2
melvin-bot commentedon Jul 14, 2023
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!
huzaifa-99 commentedon 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.
App/src/components/MultipleAvatars.js
Lines 142 to 145 in 6e5b07c
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 conditionWhat alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon Jul 18, 2023
@johncschuster 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
johncschuster commentedon Jul 18, 2023
If the root cause will be fixed in another issue, does this issue need to remain open?
(I'm not sure, so I'm asking in Slack)
johncschuster commentedon Jul 20, 2023
bumping my question above
Santhosh-Sellavel commentedon Jul 20, 2023
@johncschuster Yeah can close this one in favor of #22632
johncschuster commentedon Jul 21, 2023
Thanks, @Santhosh-Sellavel!