Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.57k stars 2.91k forks source link

fix: add navigating back to Calendar on Chrome mWeb #52872

Open jacobkim9881 opened 1 day ago

jacobkim9881 commented 1 day ago

Explanation of Change

This PR fixes clicking device back button on Year Picker Modal at Chrom mWeb. This pr gives a sign to the modal to activate window.history.back() by event listener popstate. This pr only change <YearPickerModal> to give the sign. Rest feature is already added from another contributor.

Fixed Issues

$ https://github.com/Expensify/App/issues/52383 PROPOSAL: $ https://github.com/Expensify/App/issues/52383#issuecomment-2473437159

Tests

  1. Tap on "Settings" on the bottom of the screen at ND.
  2. Tap on "Profile"
  3. Scroll down to "Date of Birth" and open the tab.
  4. Tap on the year, to open the years list.
  5. Use device´s back button to return to calendar.
  6. Verify you land on the calendar tab again.
    • [x] Verify that no errors appear in the JS console

Offline tests

  1. Tap on "Settings" on the bottom of the screen at ND.
  2. Tap on "Profile"
  3. Scroll down to "Date of Birth" and open the tab.
  4. Tap on the year, to open the years list.
  5. Use device´s back button to return to calendar.
  6. Verify you land on the calendar tab again.

QA Steps

  1. Tap on "Settings" on the bottom of the screen at ND.
  2. Tap on "Profile"
  3. Scroll down to "Date of Birth" and open the tab.
  4. Tap on the year, to open the years list.
  5. Use device´s back button to return to calendar.
  6. Verify you land on the calendar tab again.

PR Author Checklist

Screenshots/Videos

Android: Native The fix must only work for Android mobile web(Android already has this feature). https://github.com/user-attachments/assets/c23d50cd-c462-4486-bbe8-e804d26f012e
Android: mWeb Chrome https://github.com/user-attachments/assets/67d05da9-4412-4a6e-bbfd-4ba37fb75d23
iOS: Native https://github.com/user-attachments/assets/15c39821-f364-463a-84e8-8fd76f6184a9 There is no back button for iOS devices.
iOS: mWeb Safari https://github.com/user-attachments/assets/8b615966-6602-4ac7-a5e1-941518a70b03 There is no back button for iOS devices.
MacOS: Chrome / Safari https://github.com/user-attachments/assets/efa457cc-5ae1-4ff6-af36-6ba5ebba5a9f The fix must only work for Android mobile web.
MacOS: Desktop https://github.com/user-attachments/assets/3e76c348-1c93-40bc-a33b-a71165d317d2
melvin-bot[bot] commented 1 day ago

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

melvin-bot[bot] commented 1 day ago

@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

hungvu193 commented 1 day ago

@jacobkim9881 Mind update the QA steps? It's mandatory 😄. Simply update it to Same as Tests.

hungvu193 commented 1 day ago

I wonder if we also handle back button press on Browser:

https://github.com/user-attachments/assets/e6471168-78ad-42b5-bef8-eb43d3106b80

jacobkim9881 commented 23 hours ago

@jacobkim9881 Mind update the QA steps? It's mandatory 😄. Simply update it to Same as Tests.

I haven't known it's mandatory 😅 I have updated QA steps.

jacobkim9881 commented 23 hours ago

I wonder if we also handle back button press on Browser

It also navigates from year picker modal to profile page w/o any fix on Browser. However the modal opens on RHP as users may click back button on the header.

hungvu193 commented 7 hours ago

I asked for confirmation here: https://github.com/Expensify/App/issues/52383#issuecomment-2490795474