Skip to content

[regression] [HOLD til 03-04-2024] Expense - Expanded confirmation page is collapsed when returning from Amount #36077

Closed

Description

@lanitochka17

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.38-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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Start manual request flow
  4. Proceed to confirmation page
  5. Click Show more to expand the page
  6. Click Date > back button
  7. Note that the page is not collapsed
  8. Repeat Step 5 with Date, Merchant, Description and Amount

Expected Result:

When returning to confirmation page from each row, the confirmation page will remain expanded

Actual Result:

When returning to confirmation page from Amount, the confirmation page is collapsed

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

Add any screenshot/video evidence

Bug6370907_1707338508460.20240208_015624.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b2c64eb58af55274
  • Upwork Job ID: 1755336478259703808
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • shubham1206agra | Contributor | 0

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 7, 2024
  2. changed the title [-]Expense - Expanded confirmation page is collapsed when returning from Amount[/-] [+][$500] Expense - Expanded confirmation page is collapsed when returning from Amount[/+] on Feb 7, 2024
  3. melvin-bot commented on Feb 7, 2024

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 7, 2024
  5. melvin-bot commented on Feb 7, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 7, 2024

    @melvin-bot

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

  7. lanitochka17 commented on Feb 7, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #wave5
    CC @dylanexpensify

  8. Krishna2323 commented on Feb 7, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Expense - Expanded confirmation page is collapsed when returning from Amount

    What is the root cause of that problem?

    Due to conditional rendering the component unmounts and the shouldExpandFields sets back to false state, which is the initial state.

    {isLoading ? (
    <FullScreenLoadingIndicator />
    ) : (
    <MoneyRequestConfirmationList

    // This loading indicator is shown because the transaction originalCurrency is being updated later than the component mounts.
    // To prevent the component from rendering with the wrong currency, we show a loading indicator until the correct currency is set.
    const isLoading = !!(transaction && transaction.originalCurrency);

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

    Move the const [shouldExpandFields, toggleShouldExpandFields] = useReducer((state) => !state, false); to parent component IOURequestStepConfirmation and update its value in MoneyTemporaryForRefactorRequestConfirmationList.

        // Add this in `IOURequestStepConfirmation`and pass `shouldExpandFields` & `toggleShouldExpandFields` to `MoneyRequestConfirmationList` as props
        // A flag and a toggler for showing the rest of the form fields
        const [shouldExpandFields, toggleShouldExpandFields] = useReducer((state) => !state, false);

    PS: I don't think it will cause a optimization issue if we are re-render just for amount update.

    Result

    show_more_expand.mp4
  9. ZhenjaHorbach commented on Feb 7, 2024

    @ZhenjaHorbach
    Contributor

    Proposal

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

    Expense - Expanded confirmation page is collapsed when returning from Amount

    What is the root cause of that problem?

    Actually this is an expected issue

    {isLoading ? (
    <FullScreenLoadingIndicator />
    ) : (
    <MoneyRequestConfirmationList

    Since when we open the screen we always show the loader and reset the MoneyRequestConfirmationList screen including the state of shouldExpandFields

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

    To fix this issue we can refactor a bit this code

    I don't see any reason to reset all component
    Instead, I would suggest using opacity
    And when isLoading is true we just hide this component

    Which will be much more optimized than constantly rendering the component.

                        {isLoading && <FullScreenLoadingIndicator />}
                        <View style={[styles.flex1, isLoading && styles.opacity0]}>
                            <MoneyRequestConfirmationList >
                        </View>
    

    {isLoading ? (
    <FullScreenLoadingIndicator />
    ) : (
    <MoneyRequestConfirmationList

    Screen.Recording.2024-02-07.at.22.24.39.mov

    What alternative solutions did you explore? (Optional)

    NA

  10. abzokhattab commented on Feb 7, 2024

    @abzokhattab
    Contributor

    Proposal

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

    Expense - Expanded confirmation page is collapsed when returning from Amount

    What is the root cause of that problem?

    the confirmation page was rerendered because of the switching between loading and listing the component

    {isLoading ? (
    <FullScreenLoadingIndicator />
    ) : (
    <MoneyRequestConfirmationList

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

    we need to move the isloading condition and this inside the MoneyRequestConfirmationList to prevent rerendering

    alternatively

    we can keep the isloading condition and pass the value to a new prop we need to define ->isLoading in the MoneyRequestConfirmationList component

  11. Pujan92 commented on Feb 8, 2024

    @Pujan92
    Contributor

    Isn't it regression from #34075?

  12. 21 remaining items

  13. melvin-bot commented on Feb 15, 2024

    @melvin-bot

    📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

    Offer link
    Upwork job
    Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
    Keep in mind: Code of Conduct | Contributing 📖

  14. stephanieelliott commented on Feb 15, 2024

    @stephanieelliott
    Contributor

    @abzokhattab For context, sometimes new issues are created by our QA team under the assumption that it is a bug, and we don't yet realize that it is actually a regression. So the standard labels are applied (which includes Help Wanted) and the issue is treated like a basic bug issue until someone (usually the C+) realizes that it's a regression and notes it on the issue, and the original PR author and/or C+ confirms it.

    The Help Wanted label just means that the issue is labeled External but no one has been assigned on the issue to fix it -- it is auto-removed once there is an assignee on the issue. So I understand why that's probably confusing in this case. However in the case of regressions, the original PR author will always be assigned to fix it as we do not pay for regressions (i.e. you'll get paid fixing the original issue, but we do not pay for fixing any regressions that you caused).

  15. changed the title [-][$500] Expense - Expanded confirmation page is collapsed when returning from Amount[/-] [+][regression] Expense - Expanded confirmation page is collapsed when returning from Amount[/+] on Feb 15, 2024
  16. abzokhattab commented on Feb 15, 2024

    @abzokhattab
    Contributor

    Aha i see … thanks you so much for the clarification @stephanieelliott

  17. melvin-bot commented on Feb 18, 2024

    @melvin-bot

    Triggered auto assignment to @rlinoz, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  18. hoangzinh commented on Feb 18, 2024

    @hoangzinh
    Contributor

    hi @rlinoz could you help to 2nd review the PR here #36586? Thanks

  19. stephanieelliott commented on Feb 19, 2024

    @stephanieelliott
    Contributor

    PR is on staging

  20. stephanieelliott commented on Feb 27, 2024

    @stephanieelliott
    Contributor

    The PR was deployed to prod today. Putting a 7 day hold on this just for good measure, but no payment is due seeing as this is a regression.

  21. changed the title [-][regression] Expense - Expanded confirmation page is collapsed when returning from Amount[/-] [+][regression] [HOLD til 02-26-2024] Expense - Expanded confirmation page is collapsed when returning from Amount[/+] on Feb 27, 2024
  22. changed the title [-][regression] [HOLD til 02-26-2024] Expense - Expanded confirmation page is collapsed when returning from Amount[/-] [+][regression] [HOLD til 03-04-2024] Expense - Expanded confirmation page is collapsed when returning from Amount[/+] on Feb 29, 2024
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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions