Skip to content

[Payment Due 26Feb] [$250] Android - Reports - Tap on expands shows nothing in selection mode #78111

Closed

Description

@jponikarchuk

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: v9.2.82-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #76175
Email or phone of affected tester (no customers): ndk.2303+150@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Pixel 7a/ Android 16
App Component: Search

Action Performed:

Preconditions: New log in to account which has expenses from atleast 2 other users

  1. Open hybrid app
  2. Navigate to Reports
  3. Enter 'group-by: from' in Search input field
  4. Hold any row to trigger selection mode
  5. Expand other rows

Expected Result:

Taps on expand button, expenses will be shown

Actual Result:

Taps on expand button, nothing is shown

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022002016164090131181
  • Upwork Job ID: 2002016164090131181
  • Last Price Increase: 2025-12-19
Issue OwnerCurrent Issue Owner: @suneox

Activity

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

    @melvin-bot

    Triggered auto assignment to @brianlee-expensify (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. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BZ Test Jan 26Lauren R running tests on removing BZ from certain parts in issue flows
    on Dec 19, 2025
  4. changed the title [-]Android - Reports - Tap on expands shows nothing in selection mode[/-] [+][$250] Android - Reports - Tap on expands shows nothing in selection mode[/+] on Dec 19, 2025
  5. melvin-bot commented on Dec 19, 2025

    @melvin-bot
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 19, 2025
  7. melvin-bot commented on Dec 19, 2025

    @melvin-bot

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

  8. btkcodedev commented on Dec 19, 2025

    @btkcodedev
    Contributor

    Proposal

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

    On Android, when viewing the Reports page with group-by: from enabled and entering selection mode (by long-pressing any row), tapping the expand button on other rows does nothing.
    The expenses that should appear under the expanded row remain hidden, preventing users from viewing or selecting nested transactions.

    What is the root cause of that problem?

    The expand button is implemented as a PressableWithFeedback component inside the AnimatedCollapsible component, which is nested within another PressableWithFeedback component that wraps the entire row in TransactionGroupListItem.

    When a user taps the expand button in mobile selection mode on Android, the touch event propagates to the parent row's PressableWithFeedback, triggering its onPress handler instead of (or in addition to) the expand button's onExpandIconPress handler.

    The parent row's onPress handler executes logic that either calls onSelectRow() for expense reports or handleToggle() for grouped transactions. However, in mobile selection mode, this behavior is incorrect because:

    1. Row presses in selection mode should not trigger navigation or selection actions
    2. Only explicit checkbox interactions and expand button presses should be handled
    3. The parent row's onPress interferes with the expand button's functionality

    Current problematic code:

    const onPress = useCallback(() => {
        if (isExpenseReportType || transactions.length === 0) {
            onSelectRow(item, transactionPreviewData);
        }
        if (!isExpenseReportType) {
            handleToggle();
        }
    }, [isExpenseReportType, transactions.length, onSelectRow, transactionPreviewData, item, handleToggle]);

    This handler doesn't check for mobile selection mode, so it always executes when the row (or any nested element) is pressed.

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

    Add a check for mobile selection mode in the parent row's onPress handler to prevent it from executing when users are in selection mode on mobile devices. This will allow the expand button's own onPress handler to work properly without interference.

    Changes: (src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx)

    1. Add isMobileSelectionModeEnabled check from Onyx in TransactionGroupListItem.tsx
    2. Modify the onPress callback to return early when in mobile selection mode on narrow layouts
    3. This ensures the expand button press only triggers its own handler (onExpandIconPress)

    Updated code:

    // Add the Onyx subscription
    const [isMobileSelectionModeEnabled] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE, {canBeMissing: true});
    
    // Update the onPress handler
    const onPress = useCallback(() => {
        // In mobile selection mode, row presses should not trigger selection or expansion
        // Users should only interact via checkboxes and the expand button
        if (isMobileSelectionModeEnabled && !isLargeScreenWidth) {
            return;
        }
        if (isExpenseReportType || transactions.length === 0) {
            onSelectRow(item, transactionPreviewData);
        }
        if (!isExpenseReportType) {
            handleToggle();
        }
    }, [isMobileSelectionModeEnabled, isLargeScreenWidth, isExpenseReportType, transactions.length, onSelectRow, transactionPreviewData, item, handleToggle]);

    What alternative solutions did you explore?

    The chosen solution is a minimal, focused fix that addresses the root cause directly. By checking the selection mode state in the parent's onPress handler, we maintain the existing component structure while properly handling the selection mode behavior. The fix is isolated to one component, easy to test, and doesn't affect desktop or non-selection mode behavior.

  9. mohammadjafarinejad commented on Dec 19, 2025

    @mohammadjafarinejad
    Contributor

    Proposal

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

    Taps on expand button in selection mode shows nothing.

    What is the root cause of that problem?

    In onExpandIconPress, when isEmpty && !shouldDisplayEmptyView is true (group-by mode with no loaded transactions), the else if prevents searchTransactions() from being called. Additionally, onPress (which handles row taps) doesn't call searchTransactions() at all when toggling expansion:

    const onExpandIconPress = useCallback(() => {
    if (isEmpty && !shouldDisplayEmptyView) {
    onPress();
    } else if (groupItem.transactionsQueryJSON && !isExpanded) {
    searchTransactions();
    }
    handleToggle();
    }, [isEmpty, shouldDisplayEmptyView, groupItem.transactionsQueryJSON, isExpanded, handleToggle, onPress, searchTransactions]);

    const onPress = useCallback(() => {
    if (isExpenseReportType || transactions.length === 0) {
    onSelectRow(item, transactionPreviewData);
    }
    if (!isExpenseReportType) {
    handleToggle();
    }
    }, [isExpenseReportType, transactions.length, onSelectRow, transactionPreviewData, item, handleToggle]);

    So when expanding in selection mode, transactions are never fetched.

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

    1. In onPress: Add searchTransactions() call when expanding non-expense-report types
    const onPress = useCallback(() => {
        if (isExpenseReportType || transactions.length === 0) {
            onSelectRow(item, transactionPreviewData);
        }
        if (!isExpenseReportType) {
            if (groupItem.transactionsQueryJSON && !isExpanded) {
                searchTransactions();
            }
            handleToggle();
        }
    }, [isExpenseReportType, transactions.length, onSelectRow, transactionPreviewData, item, handleToggle, groupItem.transactionsQueryJSON, isExpanded, searchTransactions]);
    1. In onExpandIconPress: Change else if to if so both conditions execute independently (Optionally)
    const onExpandIconPress = useCallback(() => {
        if (isEmpty && !shouldDisplayEmptyView) {
            onPress();
        }
        if (groupItem.transactionsQueryJSON && !isExpanded) {
            searchTransactions();
        }
        handleToggle();
    }, [isEmpty, shouldDisplayEmptyView, groupItem.transactionsQueryJSON, isExpanded, handleToggle, onPress, searchTransactions]);

    What alternative solutions did you explore? (Optional)

    None

  10. 40 remaining items

  11. suneox commented on Feb 25, 2026

    @suneox
    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.

      No offending PR identified: This is a long-standing bug from the original implementation and the same solution to refetch transaction when expanding at PR is missed handling logic would cause the expanded state to change twice when clicking the icon.

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

      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.

    Regression Test Proposal

    Test:

    1. Navigate to Reports
    2. Enter 'group-by: from' in Search input field
    3. Hold any row to trigger selection mode
    4. Tab on icon chevron down icon (or item) to expand other rows

    Verify: Expenses will be shown

    Do we agree 👍 or 👎

  12. added
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 26, 2026
  13. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 26, 2026
  14. melvin-bot commented on Feb 26, 2026

    @melvin-bot

    Current assignee @suneox is eligible for the External assigner, not assigning anyone new.

  15. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    BZ Test Jan 26Lauren R running tests on removing BZ from certain parts in issue flows
    on Feb 26, 2026
  16. laurenreidexpensify commented on Feb 26, 2026

    @laurenreidexpensify
    Contributor

    Payment Summary

  17. laurenreidexpensify commented on Feb 26, 2026

    @laurenreidexpensify
    Contributor

    Payment Summary

  18. trjExpensify commented on Mar 2, 2026

    @trjExpensify
    Contributor

    approved $250 for @suneox.

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions