Skip to content

[HOLD for payment 2025-01-17] [$250] Add confirmation dialog on unsaved changes #53679

Closed

Description

@dubielzyk-expensify

Problem

When users fill in details in the app (e.g. description on an expense) and tap back or the scrim/overlay by mistake, the user loses everything they filled it. This can be particularly annoying if you submit an expense and fill in multiple details only to misclick and have to start over. We saw this multiple times during our usability study.

Solution

To remedy this, let's add a confirmation dialog on these sort of interactions by throwing up a confirmation dialog for unsaved changes. Here's a video to demonstrate:

CleanShot.2024-12-06.at.15.13.09.mp4

Notes:

  • If the value isn't changed, we should show the warning.
  • Clicking Discard continues the action of the user (if back, go back. If scrim/overlay, closer the right-hand-pane) without saving the value.
  • Any movement away from the screen should trigger the confirmation dialog (given the value has changed)

Questions:

  • Can this be applied systematically or do we have to go through all flows? If not, we should probably start with Submit expense to try it out and continue from there.

cc @Expensify/design @JmillsExpensify @trjExpensify

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864985847950506437
  • Upwork Job ID: 1864985847950506437
  • Last Price Increase: 2024-12-06
  • Automatic offers:
    • ahmedGaber93 | Reviewer | 105308658
Issue OwnerCurrent Issue Owner: @abekkala

Activity

  1. nkdengineer commented on Dec 6, 2024

    @nkdengineer
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-12-06 05:23:17 UTC.

    Proposal

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

    Add confirmation dialog on unsaved changes

    What is the root cause of that problem?

    New feature

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

    1. Create a new component DiscardChangeModal based on ConfirmModal
    2. Create a new state like isShowDiscardChangeModal
    3. Will set isShowDiscardChangeModal as true when moving away from the screen without saving the value.

    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.

  2. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    Triggered auto assignment to @abekkala (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

  3. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    ⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

  4. trjExpensify commented on Dec 6, 2024

    @trjExpensify
    Contributor

    @dubielzyk-expensify make sure you add Bug or New feature labels to issues like this, to get it assigned out to a BZ member to manage and progress.

  5. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

  6. moved this to Bugs and Follow Up Issues in #expensify-bugson Dec 6, 2024
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 6, 2024
  8. changed the title [-]Add confirmation dialog on unsaved changes[/-] [+][$250] Add confirmation dialog on unsaved changes[/+] on Dec 6, 2024
  9. 39 remaining items

  10. melvin-bot commented on Jan 10, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.82-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-01-17. 🎊

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

  11. melvin-bot commented on Jan 10, 2025

    @melvin-bot

    BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@ahmedGaber93] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
    • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
  12. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Jan 14, 2025
  13. ahmedGaber93 commented on Jan 15, 2025

    @ahmedGaber93
    Contributor

    BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    Regression Test Proposal

    1. Open submit expense flow page
    2. Enter amount and proceed to the confirmation page
    3. Open the Description form and keep the input empty
    4. Go back
    5. Verify the page closes
    6. Open the page again
    7. Type anything
    8. Go back
    9. Verify there is a discard confirmation modal
    10. Press Cancel
    11. Verify the modal closes, but the page doesn't close
    12. Repeat step 8-9
    13. Press Discard changes
    14. Verify the modal and page closes
    15. Repeat step 6-7
    16. Save the changes
    17. Verify the page closes and the change is saved
    18. Repeat the same test (step 3-17) for Merchant field and Verify it has the same behavior in steps 5, 9, 11, 14, 17.
  14. abekkala commented on Jan 15, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR JAN 17

    • Fix: @bernhardoj [$250, if no regressions] Payment via NewDot
    • PR Review: @ahmedGaber93 [$250, if no regressions] Payment via NewDot
  15. abekkala commented on Jan 15, 2025

    @abekkala
    Contributor

    @ahmedGaber93 irt to the regression step proposal. I feel like there should be a Step 19 which verifies the expected outcome Verify..., if you're repeating steps wouldn't there be another outcome that should be verified? is that correct?

  16. bernhardoj commented on Jan 16, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  17. ahmedGaber93 commented on Jan 16, 2025

    @ahmedGaber93
    Contributor

    Repeat step 3-17 but for Merchant field

    @abekkala steps from 3-17 already contain Verify steps 5, 9, 11, 14, 17. But I agree it need to be more clear.

    - Repeat step 3-17 but for Merchant field
    + Repeat the same test (step 3-17) for Merchant field and Verify it has the same behavior in steps 5, 9, 11, 14, 17.

    Updated!

  18. abekkala commented on Jan 17, 2025

    @abekkala
    Contributor

    this got a little buried so I'll paste again for better visibility:

    PAYMENT SUMMARY FOR JAN 17

  19. moved this from Hold for Payment to Done in #expensify-bugson Jan 17, 2025
  20. JmillsExpensify commented on Jan 22, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  21. JmillsExpensify commented on Feb 10, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @ahmedGaber93

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 productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions