Skip to content

[$250] Can't select an empty report from the Reports > Reports page #70591

Closed

Description

@m-natarajan

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: 9.2.14-1
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 (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Navigate to any workspace chat
  2. Create an empty report
  3. Navigate to Reports > reports
  4. Click on the checkbox to select the empty report

Expected Result:

The report is selectable by clicking the checkbox and have an option to delete

Actual Result:

Unable to select the report and not allowed curser type displayed on hover

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

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

On which of our officially supported platforms was this issue tested:

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

Screenshots/Videos

+++ Add any screenshot/video evidence

+++

CleanShot.2025-09-15.at.16.19.39.mp4
Recording.1652.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue Owner

Current Issue Owner: @lorretheboy

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 15, 2025
  2. melvin-bot commented on Sep 15, 2025

    @melvin-bot

    Triggered auto assignment to @twisterdotcom (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.

  3. daledah commented on Sep 15, 2025

    @daledah
    Contributor

    Looks like it's expected - #59804 (comment)

  4. shawnborton commented on Sep 15, 2025

    @shawnborton
    Contributor

    Yeah, we've decided that is not what we want though - we want to be able to select the report and delete it.

  5. lorretheboy commented on Sep 15, 2025

    @lorretheboy
    Contributor

    Proposal

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

    Unable to select the report and not allowed curser type displayed on hover

    What is the root cause of that problem?

    Improvement

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

    1. We should update Checkbox in ReportListItemHeader
                            disabled={!!isDisabled}
    ...
                            style={[styles.cursorUnset, StyleUtils.getCheckboxPressableStyle()]}

    <Checkbox
    onPress={() => onCheckboxPress?.(reportItem as unknown as TItem)}
    isChecked={isSelectAllChecked}
    isIndeterminate={isIndeterminate}
    containerStyle={[StyleUtils.getCheckboxContainerStyle(20), StyleUtils.getMultiselectListStyles(!!reportItem.isSelected, !!reportItem.isDisabled)]}
    disabled={!!isDisabled || reportItem.isDisabledCheckbox}
    accessibilityLabel={reportItem.text ?? ''}
    shouldStopMouseDownPropagation
    style={[styles.cursorUnset, StyleUtils.getCheckboxPressableStyle(), reportItem.isDisabledCheckbox && styles.cursorDisabled]}
    />

    1. Update TransactionGroupListItem to support select all functionality
        const isEmpty = transactions.length === 0;
    
        // For empty reports, check if the report itself is selected
        const isEmptyReportSelected = isEmpty && isGroupByReports && item?.keyForList && selectedTransactions[item.keyForList]?.isSelected;
        const isSelectAllChecked = isEmptyReportSelected || (selectedItemsLength === transactions.length && transactions.length > 0);

    const isSelectAllChecked = selectedItemsLength === transactions.length && transactions.length > 0;

    In here, we should remove isEmpty check, or we can remove the variable and pass directly isDisabled to the component

    const isDisabledOrEmpty = isEmpty || isDisabled;

    In Search, we should update flattenedItems

            const flattenedItems = areItemsGrouped
                ? (data as TransactionGroupListItemType[]).flatMap((item) => {
                    // For empty reports, count the report itself as a selectable item
                    if (item.transactions.length === 0 && isTransactionReportGroupListItemType(item)) {
                        return [item];
                    }
                    // For regular reports, count all transactions
                    return item.transactions;
                })
                : data;

    const flattenedItems = areItemsGrouped ? (data as TransactionGroupListItemType[]).flatMap((item) => item.transactions) : data;

    In here, we should handle empty reports - treat the report itself as selectable

    const currentTransactions = itemTransactions ?? item.transactions;
    
                // Handle empty reports - treat the report itself as selectable
                if (currentTransactions.length === 0 && isTransactionReportGroupListItemType(item)) {
                    const reportKey = item.keyForList;
                    if (!reportKey) {
                        return;
                    }
    
                    if (selectedTransactions[reportKey]?.isSelected) {
                        // Deselect the empty report
                        const reducedSelectedTransactions: SelectedTransactions = {...selectedTransactions};
                        delete reducedSelectedTransactions[reportKey];
                        setSelectedTransactions(reducedSelectedTransactions, data);
                        return;
                    }
    
                    // Select the empty report
                    setSelectedTransactions(
                        {
                            ...selectedTransactions,
                            [reportKey]: {
                                isSelected: true,
                                canDelete: true,
                                canHold: false,
                                isHeld: false,
                                canUnhold: false,
                                canChangeReport: false,
                                action: item.action ?? CONST.SEARCH.ACTION_TYPES.VIEW,
                                reportID: item.reportID,
                                policyID: item.policyID,
                                amount: 0,
                                convertedAmount: 0,
                                convertedCurrency: '',
                            },
                        },
                        data,
                    );
                    return;
                }

    const currentTransactions = itemTransactions ?? item.transactions;

    Finally, here update to

             const allSelections = (data as TransactionGroupListItemType[]).flatMap((item) => {
                    // Handle empty reports - select the report itself
                    if (item.transactions.length === 0 && isTransactionReportGroupListItemType(item) && item.keyForList) {
                        return [[item.keyForList, {
                            isSelected: true,
                            canDelete: true,
                            canHold: false,
                            isHeld: false,
                            canUnhold: false,
                            canChangeReport: false,
                            action: item.action ?? CONST.SEARCH.ACTION_TYPES.VIEW,
                            reportID: item.reportID,
                            policyID: item.policyID,
                            amount: 0,
                            convertedAmount: 0,
                            convertedCurrency: '',
                        }]];
                    }
    
                    // Handle regular reports with transactions
                    return item.transactions
                        .filter((t) => !isTransactionPendingDelete(t))
                        .map((transactionItem) => mapTransactionItemToSelectedEntry(transactionItem, reportActionsArray, outstandingReportsByPolicyID));
                });
    
                setSelectedTransactions(
                    Object.fromEntries(allSelections),
                    data,
                );

    setSelectedTransactions(
    Object.fromEntries(
    (data as TransactionGroupListItemType[]).flatMap((item) =>
    item.transactions
    .filter((t) => !isTransactionPendingDelete(t))
    .map((transactionItem) => mapTransactionItemToSelectedEntry(transactionItem, reportActionsArray, outstandingReportsByPolicyID)),
    ),
    ),

    Note: We may have some refactor to reduce duplicated code such in select empty report data

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

    NA

    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.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 15, 2025
  7. changed the title [-]Can't select an empty report from the Reports > Reports page[/-] [+][$250] Can't select an empty report from the Reports > Reports page[/+] on Sep 15, 2025
  8. melvin-bot commented on Sep 15, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 15, 2025
  10. melvin-bot commented on Sep 15, 2025

    @melvin-bot

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

  11. nkdengineer commented on Sep 16, 2025

    @nkdengineer
    Contributor

    @shawnborton On the Reports page, we don't support deleting a report.

  12. 112 remaining items

  13. lorretheboy commented on Feb 17, 2026

    @lorretheboy
    Contributor

    @eh2077 PR is up for review now. Thx for waiting

  14. eh2077 commented on Mar 9, 2026

    @eh2077
    Contributor

    BugZero Checklist:

    • [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: new feature.

    • [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: NA.

    • [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: https://github.com/Expensify/Expensify/issues/609375

    Regression Test Proposal

    Precondition:

    • NA

    Test:

    1. Navigate to any workspace chat
    2. Create an empty report
    3. Navigate to Reports > reports
    4. Click on the checkbox to select the empty report
    5. Verify it's able to delete empty report

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-b629-a057-f50a-1922f8d02a04
  15. eh2077 commented on Mar 9, 2026

    @eh2077
    Contributor

    👋 @twisterdotcom This is due for payment. There were several back-and-forths, and the new features were eventually made to work smoothly after multiple versions and follow-up PRs. The original task was moderately complex, but the scope expanded somewhat as we included additional relevant missing features and fixed related bugs. It would be greatly appreciated if the regression penalty could be exempted. Thx 🙇

  16. twisterdotcom commented on Mar 9, 2026

    @twisterdotcom
    Contributor

    No worries. Payment Summary:

    • @eh2077 paid $250 via NewDot Requests (C+)
    • @lorretheboy paid $250 via Upwork (Matt A paid on 2026-07-07 via Upwork, deets below)
  17. lorretheboy commented on Mar 11, 2026

    @lorretheboy
    Contributor

    @twisterdotcom I'm waiting for the payout on upwork

  18. twisterdotcom commented on Mar 11, 2026

    @twisterdotcom
    Contributor
  19. JmillsExpensify commented on Mar 13, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @eh2077

  20. lorretheboy commented on Jul 3, 2026

    @lorretheboy
    Contributor

    This has been paid by us @lorretheboy: https://www.upwork.com/nx/wm/workroom/42211076/overview

    @twisterdotcom Sorry for the late bump. I audited the payment again today and found that the contract above is for this issue #72717

    However, the issue here #70591 is not yet pay. I think you pasted the wrong upwork job

    The job for this issue is still pending on my end

    Image

    cc @mallenexpensify since you are the person who is in charge of payment currently

    Just in case I missed anything about payment, please correct me. Thank you again

  21. mallenexpensify commented on Jul 7, 2026

    @mallenexpensify
    Contributor

    @lorretheboy can you please accept the job below? Please reply here and tag me once you have.

    https://www.upwork.com/jobs/~022074496389804984826

    I checked the issue number and title by searching, none were paid

    Image Image
  22. lorretheboy commented on Jul 7, 2026

    @lorretheboy
    Contributor

    @mallenexpensify Thanks. I accepted the offer

  23. mallenexpensify commented on Jul 7, 2026

    @mallenexpensify
    Contributor

    @lorretheboy paid, summary updated above. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions