Skip to content

[Due for payment 2025-05-27] Reports - Select all checkbox is selected by default when there is only empty report #62086

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

Open
2 of 8 tasks
mitarachim opened this issue May 15, 2025 · 12 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented May 15, 2025

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: 9.1.45-18
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught during regression testing, add the test name, ID and link from TestRail: #59804
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Search

Action Performed:

Precondition:

  • Log in with Expensifail account.
  • Account has no expenses.
  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Open FAB > Create report.
  4. Go to Reports.
  5. Go to Expense Reports.

Expected Result:

Select all checkbox will not be selected when there is only empty report.

Actual Result:

Select all checkbox is selected by default when there is only empty report.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6831933_1747300550772.20250515_171207.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @jliexpensify
@mitarachim mitarachim added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels May 15, 2025
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 15, 2025
Copy link

melvin-bot bot commented May 15, 2025

Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented May 15, 2025

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

Copy link
Contributor

👋 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 the Daily KSv2 label May 15, 2025
Copy link

melvin-bot bot commented May 15, 2025

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot removed the Hourly KSv2 label May 15, 2025
@nabi-ebrahimi
Copy link
Contributor

nabi-ebrahimi commented May 15, 2025

Proposal

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

The "Select All" checkbox in the Reports UI is incorrectly shown as selected by default when the list of reports (flattenedTransactions) is empty. This gives the misleading impression that something is selected when there is nothing to select.

What is the root cause of that problem?

The current logic for determining whether the "Select All" checkbox is checked only compares the selectedItemsLength with flattenedTransactions.length. When both values are 0, the checkbox appears checked, even though no items are actually present. This creates a false positive visual state. here

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

We can either disable the checkbox or update the condition for isChecked to ensure the checkbox is only considered checked if:

  • flattenedTransactions.length > 0, and
  • selectedItemsLength === flattenedTransactions.length
          isChecked={flattenedTransactions.length > 0 && selectedItemsLength === flattenedTransactions.length}

and here for accessibility

             accessibilityState={{checked: flattenedTransactions.length > 0 && selectedItemsLength === flattenedTransactions.length}}

This prevents the checkbox from appearing checked when there are no items.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

@nkdengineer
Copy link
Contributor

Proposal

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

Select all checkbox is selected by default when there is only empty report.

What is the root cause of that problem?

It comes from #59804. Now we also show the empty view for empty expense report then if we only have empty expense reports, the search page doesn't display the empty UI.

Then because both selectedItemsLength and flattenedTransactions.length are 0, the checkbox is checked.

<View style={[styles.flex1, !isKeyboardShown && safeAreaPaddingBottomStyle, containerStyle]}>
{tableHeaderVisible && (
<View style={[styles.searchListHeaderContainerStyle, styles.listTableHeader]}>
{canSelectMultiple && (
<Checkbox
accessibilityLabel={translate('workspace.people.selectAll')}
isChecked={selectedItemsLength === flattenedTransactions.length}

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

We should disable the checkbox when the flattenedTransactions is empty and update the checked condition to not show as checked if flattenedTransactions is an empty array

<Checkbox
    accessibilityLabel={translate('workspace.people.selectAll')}
    isChecked={flattenedTransactions.length > 0 && selectedItemsLength === flattenedTransactions.length}
    isIndeterminate={selectedItemsLength > 0 && selectedItemsLength !== flattenedTransactions.length}
    onPress={() => {
        onAllCheckboxPress();
    }}
    disabled={flattenedTransactions.length === 0}
/>

<View style={[styles.flex1, !isKeyboardShown && safeAreaPaddingBottomStyle, containerStyle]}>
{tableHeaderVisible && (
<View style={[styles.searchListHeaderContainerStyle, styles.listTableHeader]}>
{canSelectMultiple && (
<Checkbox
accessibilityLabel={translate('workspace.people.selectAll')}
isChecked={selectedItemsLength === flattenedTransactions.length}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@mountiny
Copy link
Contributor

It seems like the proposals are very similar. The first one was edited many times, and it seems that it was added after the @nkdengineer proposal. @nkdengineer, I will assign you now for this one.

@nabi-ebrahimi please try to post the proposals finished to avoid many edits

@nabi-ebrahimi
Copy link
Contributor

It seems like the proposals are very similar. The first one was edited many times, and it seems that it was added after the @nkdengineer proposal. @nkdengineer, I will assign you now for this one.

@nabi-ebrahimi please try to post the proposals finished to avoid many edits

Okay, but the changes were very minimal. And it wasn't after @nkdengineer . thanks

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 15, 2025
@francoisl francoisl removed the DeployBlockerCash This issue or pull request should block deployment label May 15, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 20, 2025
@melvin-bot melvin-bot bot changed the title Reports - Select all checkbox is selected by default when there is only empty report [Due for payment 2025-05-27] Reports - Select all checkbox is selected by default when there is only empty report May 20, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 20, 2025
Copy link

melvin-bot bot commented May 20, 2025

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

Copy link

melvin-bot bot commented May 20, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 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 2025-05-27. 🎊

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

Copy link

melvin-bot bot commented May 20, 2025

@allroundexperts @jliexpensify @allroundexperts The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@allroundexperts
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: This was a Deploy blocker originating from Empty report chat view #59804. The author should be aware of this.

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • Login to an account that does not have any expenses and workspaces

Test:

  1. Create a workspace
  2. Open FAB > Create report
  3. Go to Reports
  4. Go to Expense Reports

Verify that the "Select all checkbox" is not selectable when the report is empty

Do we agree 👍 or 👎

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. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants