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

[HOLD for payment 2024-02-14] [$500] A border is being displayed on the second image of the group chat in the search model #34416

Closed
2 of 6 tasks
kavimuru opened this issue Jan 12, 2024 · 32 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Jan 12, 2024

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


Version Number: v1.4.24-7
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
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

  1. Create group chat and send a message
  2. Go to the search model
  3. Hover over the first group chat
  4. Notice only second image displayed with border

Expected Result:

A border should not displayed on second image of the first group chat in the search model

Actual Result:

A border is being displayed on the second image of the group chat in the search model

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

Add any screenshot/video evidence
Bug6339897_1705050171837!Screenshot_2024-01-12_at_12 25 44_AM
Bug6339897_1705050171821!Screenshot_2024-01-12_at_12 36 34_AM

Bug6339897_1705050171836.2024-01-12_00-29-44.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0135be644839e7389d
  • Upwork Job ID: 1745742363732340736
  • Last Price Increase: 2024-01-12
  • Automatic offers:
    • bernhardoj | Contributor | 28128985
@kavimuru kavimuru added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 12, 2024
@melvin-bot melvin-bot bot changed the title A border is being displayed on the second image of the group chat in the search model [$500] A border is being displayed on the second image of the group chat in the search model Jan 12, 2024
Copy link

melvin-bot bot commented Jan 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0135be644839e7389d

Copy link

melvin-bot bot commented Jan 12, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 12, 2024
Copy link

melvin-bot bot commented Jan 12, 2024

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Jan 12, 2024

Proposal

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

The second avatar of a group chat shows a border while hovered.

What is the root cause of that problem?

The border color is actually doesn't match the background color when we hover over a focused option.

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

We need to prevent the border from being applied when the option is focused.

<SubscriptAvatar
mainAvatar={option.icons[0]}
secondaryAvatar={option.icons[1]}
backgroundColor={hovered ? hoveredBackgroundColor : subscriptColor}
size={CONST.AVATAR_SIZE.DEFAULT}
/>
) : (
<MultipleAvatars
icons={option.icons}
size={CONST.AVATAR_SIZE.DEFAULT}
secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(hovered ? hoveredBackgroundColor : subscriptColor)]}
shouldShowTooltip={showTitleTooltip && OptionsListUtils.shouldOptionShowTooltip(option)}
/>

(hovered && !optionIsFocused)

just like we did in OptionRowLHN

@dukenv0307
Copy link
Contributor

Proposal

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

A border is being displayed on the second image of the group chat in the search model

What is the root cause of that problem?

We have a border width and border of the subscription avatar here.

StyleUtils.getAvatarBorderWidth(isSmall ? CONST.AVATAR_SIZE.SMALL_SUBSCRIPT : CONST.AVATAR_SIZE.SUBSCRIPT),
StyleUtils.getBorderColorStyle(backgroundColor ?? theme.componentBG),

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

We should remove this border style.

StyleUtils.getAvatarBorderWidth(isSmall ? CONST.AVATAR_SIZE.SMALL_SUBSCRIPT : CONST.AVATAR_SIZE.SUBSCRIPT),
StyleUtils.getBorderColorStyle(backgroundColor ?? theme.componentBG),

What alternative solutions did you explore? (Optional)

NA

@dragnoir
Copy link
Contributor

dragnoir commented Jan 12, 2024

Proposal

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

A border is being displayed on the second image of the group chat in the search model

What is the root cause of that problem?

OptionRow, src/components/OptionRow.tsx, is calculating the hoveredBackgroundColor

const hoveredBackgroundColor = hoveredStyle?.backgroundColor ? (hoveredStyle.backgroundColor as string) : backgroundColor;

The other components like SubscriptAvatar and MultipleAvatars are using the value hoveredBackgroundColor to set the border color:

The issue is that the hoveredBackgroundColor is not updated when the Row is focused

If we remove the border style, when hovering, there will be issues. BEcause now there's always a border === to the background color and it gives a feeling that there's transparency

image

When no hovered, border === background color
when hovered, border === new background color

When focused, we need to set background color to the focusBAckground color to adjust the border color.

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

on OptionRow, update here:

if (optionIsFocused) {
  subscriptColor  =  focusedBackgroundColor;
+  hoveredBackgroundColor  =  focusedBackgroundColor;
}

We are updating the value of hoveredBackgroundColor to be equal to focusedBackgroundColor when optionIsFocused is true.

Commit: src/components/OptionRow.tsx

POC

17.mp4

@melvin-bot melvin-bot bot added the Overdue label Jan 14, 2024
Copy link

melvin-bot bot commented Jan 15, 2024

@slafortune, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

@thesahindia
Copy link
Member

@bernhardoj's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2024
Copy link

melvin-bot bot commented Jan 15, 2024

Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@dragnoir
Copy link
Contributor

@thesahindia did you checked my proposal? Can I pls ask how you picked the best proposal?

@dragnoir
Copy link
Contributor

@iwiznia I would like to respectfully request if you could @thesahindia kindly revisit my proposal. I believe it addresses some crucial points that could enhance our project's functionality and efficiency. Here are my thoughts

  • prevent the border from being applied is a workaround and not solving the core issue, the component <SubscriptAvatar> and other components interact with the props that set the color. The issue here is that this last value is wrong, so I thionk fixing the value is better than trying to igonore it
  • Hover Interaction Consistency: It's important to maintain interaction cues like hover effects. Currently, the hover or focus elements blend with the background color, which could be problematic if the background color changes in the future. Therefore, adjusting the border color to maintain the hover interaction seems like a more sustainable approach.
  • Global Usability of and and others: These components are not just limited to our use case in the OptionRow but could be utilized in various scenarios. Thus, it's essential to keep the logic global and adaptable, instead of circumventing the hover effect on focused elements. This approach ensures that we cater to all potential use cases, not just the ones where the hover color matches the focus background.
  • Comprehensive Solution to Component Issues: The solution in the selected proposal only addresses a specific issue with , while the problem also affects other components like . I believe that resolving the root cause in the code would be more beneficial than just focusing on a single aspect of the hover effect across multiple components.

I've detailed these points in my proposal, along with a proof-of-concept video and branch code. I would greatly appreciate any feedback or explanations on why the current workaround might be considered a preferable solution. Your insights would be extremely valuable.

Thank you for taking the time to consider my request.

@bernhardoj
Copy link
Contributor

@dragnoir hi, I don't see how your proposal is different from mine.

backgroundColor={(hovered && !optionIsFocused) ? hoveredBackgroundColor : subscriptColor}

vs

if (optionIsFocused) {
  subscriptColor  =  focusedBackgroundColor;
+  hoveredBackgroundColor  =  focusedBackgroundColor;
}

Yes, it's written differently, but the core concept is the same.

Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The difference should be important, meaningful or considerable.

@dragnoir
Copy link
Contributor

@bernhardoj my proposal is 100% different from yours.

We need to prevent the border from being applied when the option is focused.

Your solution is about preventing the border from being applied.

My solution is to allow border BUT with the right value

(hovered && !optionIsFocused)

Your solution will need custom conditions for each style on all the componets that OptionRow uses. Wish effect even the components behavior in future uses.

My solution is one line of code that fix oll withgout editing components logic and keeping the same logic in all the components I mentioned.

As you mentioned:

The border color is actually doesn't match the background color when we hover over a focused option.

But your proposal is about ignoring the issues, hiding it. You said it, doesn't match, so it's better to match it

My solution will match the border to the background color.

@bernhardoj
Copy link
Contributor

We need to prevent the border from being applied when the option is focused.

Your solution is about preventing the border from being applied.

I think there is a misunderstanding on how I word it. The issue here is that the hovered border color is applied when it shouldn't, so the solution is simply preventing that when it's focused just like we did in OptionRowLHN (which I put this ref on my solution too).

You can compare the results between mine and your solution and you will notice there will be no difference. The difference is in how we write the code and you are proposing to make it DRY. Making it DRY is something that can be done in the PR stage.

Let's wait for the team to reply.

@dragnoir
Copy link
Contributor

@bernhardoj again our solutions are totally different.

  • You haven't catched that focusedBackgroundColor is the right value to use
  • You are not updating the value of hoveredBackgroundColor before the return
  • and lot's I already mentioned.

Yes I agree, let's wee what @iwiznia @slafortune @thesahindia will decide and I will respect their decition.

@melvin-bot melvin-bot bot added the Overdue label Jan 18, 2024
@slafortune
Copy link
Contributor

@iwiznia @thesahindia just wanted to verify that all has been considered and we can move forward with this

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 18, 2024
@iwiznia
Copy link
Contributor

iwiznia commented Jan 22, 2024

Hmmm @thesahindia what's your take here?

@melvin-bot melvin-bot bot removed the Overdue label Jan 25, 2024
@thesahindia
Copy link
Member

@dragnoir, I don't know if you tested the solution correctly because I am not seeing that issue. Here's what I got -

Screenshot 2024-01-26 at 3 59 25 AM

@iwiznia, I am not seeing any major reason for not going with the first proposal that @bernhardoj proposed. I will leave the final decision to you.

@dragnoir
Copy link
Contributor

@thesahindia can you pls share the bransh you tested with or the code difference you created? I am 100% sure of what I didi, I shared the code diff, screenshots and lots of explanation. At least pls share the bransh you tested with.

@melvin-bot melvin-bot bot added the Overdue label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

@iwiznia, @slafortune, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@bernhardoj
Copy link
Contributor

PR is ready

cc: @thesahindia

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 7, 2024
@melvin-bot melvin-bot bot changed the title [$500] A border is being displayed on the second image of the group chat in the search model [HOLD for payment 2024-02-14] [$500] A border is being displayed on the second image of the group chat in the search model Feb 7, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 7, 2024
Copy link

melvin-bot bot commented Feb 7, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Feb 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.37-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-02-14. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Feb 7, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@thesahindia] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 13, 2024
@slafortune
Copy link
Contributor

@thesahindia can you complete the checklist above? Thanks!

@slafortune
Copy link
Contributor

@bernhardoj - automatic offer (Contributor) Paid $500

@thesahindia requires payment through NewDot Manual Requests - $500
Waiting on checklist.

@thesahindia
Copy link
Member

Test case steps -

  1. Open a group chat and send any message
  2. Open search page
  3. The first item on the search page should be the group chat. Hover over it.
  4. Verify the border color of the second avatar still matches with the background color
  5. Press the arrow down key once to move the focused option to the next item
  6. Repeat step 3-4

@slafortune
Copy link
Contributor

@thesahindia requires payment through NewDot Manual Requests - $500

@JmillsExpensify
Copy link

$500 approved for @thesahindia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants