Skip to content

[Due for payment 2025-10-28] [$250] Selection state and header not updating correctly when resizing expense report #69251

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.1.99-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: @daledah
Slack conversation (hyperlinked to channel name): #Open Source

Action Performed:

Scenario 1: Incorrect selection state after resizing

  1. Go to workspace chat
  2. Create two expenses
  3. Open the expense report
  4. Select one expense and observe the header state (correct)
  5. Deselect the expense
  6. Resize the screen to a smaller width (<800px)
  7. Select one expense
  8. Observe that the header now incorrectly shows “Select multiple” view
  9. Resize the screen back to large screen (>800px) and observe the state

Scenario 2: Header not updating on resize in selection mode

  1. Open expense chat
  2. Create two expenses
  3. Open the expense report
  4. Select one expense (enter selection mode)
  5. Resize the screen to small (<800px)
  6. Observe that the header does not adapt to the small-screen layout

Expected Result:

There's a checkbox displayed inside each expense row, with checked state for selected expense, The header is updated to "Select multiple" view

Actual Result:

There's no checkboxes shown on expense rows to indicate selection state, The header is not updated to "Select multiple" view

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
Screen.Recording.2025-08-26.at.00.47.01.mp4
Screen.Recording.2025-08-26.at.00.26.23.mp4
Image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021968479782341761773
  • Upwork Job ID: 1968479782341761773
  • Last Price Increase: 2025-09-25
  • Automatic offers:
    • daledah | Contributor | 108963337
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @VictoriaExpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @adelekennedy (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. m-natarajan commented on Aug 26, 2025

    @m-natarajan
    Author

    Proposal by @daledah

    Proposal

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

    Workspace empty state animation is not centered on Android

    What is the root cause of that problem?

    Currently we don't handle selection mode when there's changes in the selected expense state in SearchContextProvider
    We already have logics for this issue inside SelectionListWithModal

    useEffect(() => {
    // We can access 0 index safely as we are not displaying multiple sections in table view
    const selectedItems =
    selectedItemsProp ??
    sections[0].data.filter((item) => {
    if (isSelected) {
    return isSelected(item);
    }
    return !!item.isSelected;
    });
    selectionRef.current = selectedItems.length;
    if (!isSmallScreenWidth) {
    if (selectedItems.length === 0 && isMobileSelectionModeEnabled) {
    turnOffMobileSelectionMode();
    }
    return;
    }
    if (!isFocused) {
    return;
    }
    if (!wasSelectionOnRef.current && selectedItems.length > 0) {
    wasSelectionOnRef.current = true;
    }
    if (selectedItems.length > 0 && !isMobileSelectionModeEnabled) {
    turnOnMobileSelectionMode();
    } else if (selectedItems.length === 0 && isMobileSelectionModeEnabled && !wasSelectionOnRef.current) {
    turnOffMobileSelectionMode();
    }
    // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
    }, [sections, selectedItemsProp, isMobileSelectionModeEnabled, isSmallScreenWidth, isSelected, isFocused]);

    So similar issue is not reproducible in other lists.

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

    We should implement logics similar to SelectionListWithModal for SearchContextProvider. We can move it to a hook like "useHandleSelectionMode" and use it in both SelectionListWithModal and SearchContextProvider to prevent repetitive code.

    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.

  4. daledah commented on Aug 26, 2025

    @daledah
    Contributor

    Added an additional proposal for the Scenario 1

    Proposal

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

    Expense report header is not updated when resizing screen in selection mode

    What is the root cause of that problem?

    Only in small screen, when selecting the expense, isMobileSelectionModeEnabled is set to true.

    if (!isMobileSelectionModeEnabled) {
    turnOnMobileSelectionMode();
    }

    We show only HeaderWithBackButton when isMobileSelectionModeEnabled, without taking screensize into account
    if (isMobileSelectionModeEnabled) {
    // If mobile selection mode is enabled but only one or no transactions remain, turn it off
    if (transactions.length <= 1) {
    turnOffMobileSelectionMode();
    }
    return (
    <HeaderWithBackButton
    title={translate('common.selectMultiple')}
    onBackButtonPress={() => {
    clearSelectedTransactions(true);
    turnOffMobileSelectionMode();
    }}
    />
    );
    }

    So when resizing to bigger width, the header is not updated to expected view.

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

    We should add shouldUseNarrowLayout check to here

    if (isMobileSelectionModeEnabled) {

    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)

    NA
    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.

  5. melvin-bot commented on Aug 29, 2025

    @melvin-bot

    @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  6. melvin-bot commented on Sep 2, 2025

    @melvin-bot

    @adelekennedy 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  7. melvin-bot commented on Sep 4, 2025

    @melvin-bot

    @adelekennedy Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  8. melvin-bot commented on Sep 8, 2025

    @melvin-bot

    @adelekennedy 12 days overdue. Walking. Toward. The. Light...

  9. melvin-bot commented on Sep 9, 2025

    @melvin-bot

    @adelekennedy this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  10. melvin-bot commented on Sep 11, 2025

    @melvin-bot

    This issue has not been updated in over 14 days. @adelekennedy eroding to Weekly issue.

  11. 61 remaining items

  12. added
    ReviewingHas a PR in review
    and removed on Nov 3, 2025
  13. daledah commented on Nov 3, 2025

    @daledah
    Contributor

    @ZhenjaHorbach we have a follow up pr here

  14. ZhenjaHorbach commented on Nov 13, 2025

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

    Unfortunately, I did not find a suitable PR

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

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

    Scenario 1: Incorrect selection state after resizing

    1. Go to workspace chat
    2. Create two expenses
    3. Open the expense report
    4. Select one expense and observe the header state (correct)
    5. Deselect the expense
    6. Resize the screen to a smaller width (<800px)
    7. Select one expense
    8. Observe that the header now shows “Select multiple” view
    9. Resize the screen back to large screen (>800px) and observe the state
    10. Verify that: The header updates to the state similar to step 4

    Scenario 2: Header not updating on resize in selection mode

    1. Open expense chat
    2. Create two expenses
    3. Open the expense report
    4. Select one expense (enter selection mode)
    5. Resize the screen to small (<800px)
    6. Verify that: There's a checkbox displayed inside each expense row, with checked state for selected expense. The header is updated to "Select multiple" view

    Scenario 3:

    1. Create WS > enable category/tag and add some category/tags
    2. Select a category/tag from the list by long press and press select
    3. Verify that: The Select option can activate the bulk selection feature

    Do we agree 👍 or 👎

  15. ZhenjaHorbach commented on Nov 13, 2025

    @ZhenjaHorbach
    Contributor

    @VictoriaExpensify
    We are ready for payment!

  16. VictoriaExpensify commented on Nov 18, 2025

    @VictoriaExpensify
    Contributor

    Request to add reg test to BrowserStack raised - https://github.com/Expensify/Expensify/issues/569077

  17. VictoriaExpensify commented on Nov 18, 2025

    @VictoriaExpensify
    Contributor

    Payment Summary:
    C: @daledah paid $250 via Upwork
    C+: @ZhenjaHorbach owed $250 via NewDot

    Thanks!

  18. ZhenjaHorbach commented on Nov 18, 2025

    @ZhenjaHorbach
    Contributor

    Requested in ND!

  19. JmillsExpensify commented on Nov 20, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @ZhenjaHorbach

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 contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions