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 2023-12-29] [$500] Expense avatar and Report avatar in LHN look incorrect #32413

Closed
1 of 6 tasks
m-natarajan opened this issue Dec 3, 2023 · 43 comments
Closed
1 of 6 tasks
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

@m-natarajan
Copy link

m-natarajan commented Dec 3, 2023

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


Version Number: 1.4.7-0
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: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1701439047370489

Action Performed:

Create an expense on a workspace, submit it

Expected Result:

In the LHN (not in #focus mode), the avatar for an expense should have the user's avatar at 40x40 with the small workspace avatar to the bottom right.
For the report, we should have the diagonal avatar pattern where both the workspace avatar and user avatar are the same height/width, but are diagonal from each other

Actual Result:

The avatars are incorrect

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: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
CleanShot 2023-12-01 at 08 54 52@2x

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0197708be36886dd46
  • Upwork Job ID: 1731331203476029440
  • Last Price Increase: 2023-12-10
  • Automatic offers:
    • Ollyws | Reviewer | 28036548
    • shubham1206agra | Contributor | 28036550
@m-natarajan m-natarajan 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 Dec 3, 2023
@melvin-bot melvin-bot bot changed the title Expense avatar and Report avatar in LHN look incorrect [$500] Expense avatar and Report avatar in LHN look incorrect Dec 3, 2023
Copy link

melvin-bot bot commented Dec 3, 2023

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

Copy link

melvin-bot bot commented Dec 3, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0197708be36886dd46

Copy link

melvin-bot bot commented Dec 3, 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

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

melvin-bot bot commented Dec 3, 2023

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

@chiItepin
Copy link

chiItepin commented Dec 3, 2023

This appears to be by design since the request would be a thread from a report.

And whenever there's an expense report thread, the avatar size is smaller

@yh-0218
Copy link
Contributor

yh-0218 commented Dec 3, 2023

Proposal

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

Expense avatar and Report avatar in LHN look incorrect

What is the root cause of that problem?

Because we use CONST.AVATAR_SIZE.SMALL_NORMAL when isExpenseRequest = true

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

We need to use only props.size or CONST.AVATAR_SIZE.DEFAULT here, here and here

What alternative solutions did you explore? (Optional)

Screenshot 2023-12-03 at 7 40 19 PM

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Dec 3, 2023

Proposal

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

Expense avatar and Report avatar in LHN look incorrect

What is the root cause of that problem?

The diagonal avatar pattern was missing from the Expense report and IOU report because there is a bug in isWorkspaceThread function which also gives true for the thread which is not a chat (i.e., IOU or expense).

For design pattern reference
#20512 (comment)

For Avatar size, as referenced below, it was decided to keep the avatar size irrespective of isExpenseRequest. And here are the finalized avatar designs

  1. Subscript
    a. Normal Size
    The main avatar is of size 40x40, with the subscript avatar being of size 20x20, with a border width of 2, and an offset of -4 to the bottom and right
    b. Compact Size
    The main avatar is 24x24, with the subscript avatar being 12x12, with a border width of 2 and an offset of -2 to the bottom and right.

  2. Multiple Avatar
    a. Normal Size
    Both avatars have size 24x24, and the second avatar has a border width of 2, and an offset of -18 to the bottom and right.
    b. Compact Size
    Both avatars are 16x16, and the second avatar has a border width of 2 and an offset of -14 to the bottom and right.

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

Use the following implementation instead cause the workspace thread will always be of type chat

function isWorkspaceThread(report: OnyxEntry<Report>): boolean {
    return isThread(report) && isChatReport(report) && !isDM(report);
}

OR

function isWorkspaceThread(report: OnyxEntry<Report>): boolean {
    return isThread(report) && isChatReport(report) && Boolean(getChatType(report));
}

There are too many changes regarding design, so please take a look at test branch https://github.com/shubham1206agra/App/tree/test-avatar

Screen.Recording.2023-12-03.at.11.42.34.PM.mov

What alternative solutions did you explore? (Optional)

NA

@shubham1206agra
Copy link
Contributor

@shawnborton Can you see the video uploaded here about the diagonal avatar, and see if the cases are correct? I have not adjusted size yet, but will do it later.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Dec 4, 2023

Proposal

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

In the LHN (not in #focus mode), the avatar for an expense should have the user's avatar at 40x40 with the small workspace avatar to the bottom right.

This one seems expected

So the problem here is

For the report, we should have the diagonal avatar pattern where both the workspace avatar and user avatar are the same height/width, but are diagonal from each other

What is the root cause of that problem?

In here, the condition will include the expense thread and IOU thread, so it will show subscript avatar for those expense threads and IOU threads, which we don't want.

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

We need to modify to show subscript avatar only if it's chat thread of workspace chats, similar to what we do for the workspace task report here.

function isWorkspaceThread(report: OnyxEntry<Report>): boolean {
    const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`] ?? null;
    return isChatThread(report) && !!getChatType(parentReport);
}

We have to check that the parentReport is a workspace chat here (similar to what we did for the workspace task report here)) because chat threads can be created inside the Expense report and money request as well, and they shouldn't be counted as workspace chat thread.

We can rename the method to isWorkspaceChatThread to be clear we're getting workspace chat thread.

What alternative solutions did you explore? (Optional)

Additionally check !!getChatType(report), but checking the parentReport should be enough.

@situchan
Copy link
Contributor

situchan commented Dec 4, 2023

We should hold this until discussion about expected behavior is concluded

discussion

@shawnborton
Copy link
Contributor

While I do think that converation has a ways to go, we should at least fix what's currently there before waiting for that convo to finish.

@shawnborton
Copy link
Contributor

Although cc @grgia in case this was something you were interested in fixing.

@shawnborton
Copy link
Contributor

In the very least, the solution should be this for now until we make any further, larger changes:
CleanShot 2023-12-04 at 09 27 17@2x

@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2023
@shubham1206agra
Copy link
Contributor

@Ollyws I updated my proposal

Copy link

melvin-bot bot commented Dec 7, 2023

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

Copy link

melvin-bot bot commented Dec 10, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Dec 11, 2023

@Ollyws, @peterdbarkerUK Still overdue 6 days?! Let's take care of this!

@Ollyws
Copy link
Contributor

Ollyws commented Dec 11, 2023

Am I correct in understanding that the only thing required for now is to the ensure the diagonal avatar pattern is added the Expense report and IOU report?
If so @shubham1206agra's proposal seems to have that covered.

@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2023
@shubham1206agra
Copy link
Contributor

@Ollyws I have my designs approved by the design team already

@Ollyws
Copy link
Contributor

Ollyws commented Dec 11, 2023

Ok, let's go with @shubham1206agra's proposal then.
🎀👀🎀 C+ reviewed

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 22, 2023
@melvin-bot melvin-bot bot changed the title [$500] Expense avatar and Report avatar in LHN look incorrect [HOLD for payment 2023-12-29] [$500] Expense avatar and Report avatar in LHN look incorrect Dec 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 22, 2023
Copy link

melvin-bot bot commented Dec 22, 2023

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

Copy link

melvin-bot bot commented Dec 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.15-5 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 2023-12-29. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Dec 22, 2023

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:

  • [@Ollyws / @shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@Ollyws / @shubham1206agra] 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:
  • [@Ollyws / @shubham1206agra] 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:
  • [@Ollyws / @shubham1206agra] Determine if we should create a regression test for this bug.
  • [@Ollyws / @shubham1206agra] 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.
  • [@peterdbarkerUK] 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 Dec 28, 2023
@peterdbarkerUK
Copy link
Contributor

Offer links are a bit squiffy, here are some updated links:

@Ollyws could you accept this one?
@shubham1206agra could you accept this one?

@shubham1206agra
Copy link
Contributor

Done

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

melvin-bot bot commented Jan 1, 2024

@rlinoz, @Ollyws, @peterdbarkerUK, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@peterdbarkerUK
Copy link
Contributor

Sweet, thanks guys:

$500 paid to @shubham1206agra
$500 paid to @Ollyws

Could you spin through the regression checklist?

@melvin-bot melvin-bot bot removed the Overdue label Jan 2, 2024
@Ollyws
Copy link
Contributor

Ollyws commented Jan 3, 2024

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR:

This was just a design update so no PR responsible.

  • 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:

N/A

  • 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:

N/A

  • Determine if we should create a regression test for this bug.

It might be worth adding to the monthly tests as it only requires a quick look.

@Ollyws
Copy link
Contributor

Ollyws commented Jan 3, 2024

Regression Test Proposal

1. Verify that LHN avatars are according to https://github.com/Expensify/App/issues/32413#issuecomment-1838749642

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jan 5, 2024
@rlinoz
Copy link
Contributor

rlinoz commented Jan 8, 2024

I am not familiar with how we add/remove things from the regression test, do you think it is worth adding this one @peterdbarkerUK ? Thinking that we will need to remove/change this test when we change how we represent each kind of chat.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 8, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

@rlinoz, @Ollyws, @peterdbarkerUK, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!

@Ollyws
Copy link
Contributor

Ollyws commented Jan 15, 2024

Good point, maybe I was being a little overzealous proposing a regression test here. Feel free to leave it off.

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

rlinoz commented Jan 17, 2024

So I guess we can close this one?

@melvin-bot melvin-bot bot added the Overdue label Jan 19, 2024
@peterdbarkerUK
Copy link
Contributor

I agree that we don't need to add regression tests, Olly is right this doesn't need much of a check closing!

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

10 participants