Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix react-navigation drawer history issues on web/mWeb #2458

Merged
merged 3 commits into from
Apr 21, 2021

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Apr 19, 2021

Details

This PR adds a custom action to use with react-navigation when navigating to report routes. This is necessary since the default behavior on web and mobile web is to call window.history.replaceState() in most cases since navigating to the Report screen with new params does not add an entry to the history stack.

There might be a way to propose a fix for this in react-navigation itself, but I'm unsure whether this is the intended behavior and for now this gives us the desired behavior. react-navigation is intended to be extensible so I'm assuming this solution is OK.

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/157550
Fixes #2028

Tests

QA Steps (web, mobile-web)

  1. Open the app and sign in
  2. Select a chat
  3. Verify you are brought to that chat (if mWeb verify the chat slides into view)
  4. Press the browser back button
  5. Verify that you return to the previous chat (if mWeb verify that we are brought to the LHN)
  6. Test navigating to several chats without pressing the browser back button
  7. Press the browser back button and verify that we are brought to all the previous chats (on mWeb we should first see the LHN but be able to slide the LHN to the left to reveal the chat)

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@marcaaron marcaaron self-assigned this Apr 19, 2021
@marcaaron marcaaron marked this pull request as ready for review April 19, 2021 18:31
@marcaaron marcaaron requested a review from a team as a code owner April 19, 2021 18:31
@MelvinBot MelvinBot requested review from deetergp and removed request for a team April 19, 2021 18:31
Copy link
Contributor

@deetergp deetergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but testing I noticed that, though it does work as advertised, the highlighting showing which chat you are on does not follow suit. Is that a blocker for this PR or is it a different problem?

chatHistory.mp4

@marcaaron
Copy link
Contributor Author

Is that a blocker for this PR or is it a different problem?

I think so, since it's technically a regression from how things work now. Lemme take a quick look. I think I know why it happens.

@marcaaron
Copy link
Contributor Author

Updated!

Copy link
Contributor

@deetergp deetergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:chefkiss: LGTM!

chatHistory2.mp4

@deetergp deetergp merged commit ba69ba1 into main Apr 21, 2021
@deetergp deetergp deleted the marcaaron-browserHistoryFix branch April 21, 2021 18:26
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented May 8, 2021

🚀 Deployed to production in version: 1.0.39-5🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Chat] Fix backspace to return to previous chat
3 participants