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

[$500] Workspace-Some workspaces are shown in bold and some not #35766

Closed
3 of 6 tasks
izarutskaya opened this issue Feb 3, 2024 · 14 comments
Closed
3 of 6 tasks

[$500] Workspace-Some workspaces are shown in bold and some not #35766

izarutskaya opened this issue Feb 3, 2024 · 14 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering 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

@izarutskaya
Copy link

izarutskaya commented Feb 3, 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: 1.4.36
Reproducible in staging?: Y
Reproducible in production?: N
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:

Pre-condition: open account with many workspaces created

  1. Go to https://staging.new.expensify.com/
  2. Tap in top right icon
  3. Scroll down list of workspaces

Expected Result:

All workspaces should be displayed in same manner.

Actual Result:

Some workspaces are shown in bold and some not.

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

Bug6366196_1706985592680.az_recorder_20240203_015705.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015db9082b5dbefc79
  • Upwork Job ID: 1753900794333388800
  • Last Price Increase: 2024-02-03
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment 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 Feb 3, 2024
Copy link

melvin-bot bot commented Feb 3, 2024

Job added to Upwork: https://www.upwork.com/jobs/~015db9082b5dbefc79

@melvin-bot melvin-bot bot changed the title Workspace-Some workspaces are shown in bold and some not [$500] Workspace-Some workspaces are shown in bold and some not Feb 3, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 3, 2024
Copy link

melvin-bot bot commented Feb 3, 2024

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

Copy link

melvin-bot bot commented Feb 3, 2024

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

Copy link
Contributor

github-actions bot commented Feb 3, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Hourly KSv2 labels Feb 3, 2024
Copy link

melvin-bot bot commented Feb 3, 2024

Triggered auto assignment to @marcaaron (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@izarutskaya
Copy link
Author

We think that this bug might be related to #vip-vsb
CC @quinthar

@ZhenjaHorbach

This comment was marked as off-topic.

@puneet2715
Copy link

@ZhenjaHorbach then the actual bug is that some workspace names are not getting the bold font even after having a green or red dot, meanwhile some have bold text even without a dot.

Copy link

melvin-bot bot commented Feb 3, 2024

📣 @puneet2715! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@muas19
Copy link

muas19 commented Feb 3, 2024

Proposal

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

Some workspaces are shown in bold and some not.

What is the root cause of that problem?

There might be a delay from onyx when new data is returned for a policy in
This line

boldStyle: hasUnreadData(policy?.id),

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

We could pass a false type to the hasBoldStyle or remove it altogether since the unread have their own green/red dots.

What alternative solutions did you explore? (Optional)

@ikevin127
Copy link
Contributor

Proposal

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

Some workspaces names are not shown in bold text when they are supposed to due to either having red / green brick indicators.

What is the root cause of that problem?

App/src/libs/ReportUtils.ts

Lines 3569 to 3578 in 3ab4e6e

function isUnread(report: OnyxEntry<Report>): boolean {
if (!report) {
return false;
}
// lastVisibleActionCreated and lastReadTime are both datetime strings and can be compared directly
const lastVisibleActionCreated = report.lastVisibleActionCreated ?? '';
const lastReadTime = report.lastReadTime ?? '';
return lastReadTime < lastVisibleActionCreated;
}

Both getWorkspacesUnreadStatuses and ReportUtils.isUnread functions are working as expected. If there's any unread report within a workspace (policy) based on the code block above -> the isUnread will return true for that said report which is part of the workspace -> therefore we will see the workspace name text having the bold style.

If what we want here as expected result is to keep the workspace name in bold style when there's no unread reports, but we have red / green brick indicators present then the problem is we're missing an additional condition where we set the boldStyle: hasUnreadData(policy?.id).

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

Within the WorkspaceSwitcherPage component, add additional condition to boldStyle as follows:

  • boldStyle: hasUnreadData(policy?.id) || !!getIndicatorTypeForPolicy(policy?.id)

this way if within any of that workspace's reports there's any kind of indicator present -> the workspace name text will have the bold style until the indicator is resolved by the user within the report that is causing it.

Videos

iOS: Native
Before After
Screen.Recording.2024-02-04.at.15.53.24.mov
b89f75a4-a9fb-467c-b867-5a44fabd4d3f.mp4

@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Feb 5, 2024
@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2024

This is not a blocker, I actually think this is expected behaviour

@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2024

This is a dupe of existing issue with better issue body/ repro steps here #35682

@mountiny mountiny closed this as completed Feb 5, 2024
@trjExpensify
Copy link
Contributor

Right, if the workspace in question has chats with unread messages, the row should be bold. We don't add a GBR for unread messages.

That said, I think there's a bug with the bold rows, as logged here: #35682

Perhaps this issue is just a dupe.

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 Engineering 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

10 participants