App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-12-06] The Android hardware back button does not minimise the app when pressed on the LHN/home screen

Open kp17211 opened this issue 5 years ago • 79 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Click on an a chat from the LHN
  2. Once you're in the chat, press the back button to navigate back to the LHN/home screen
  3. From the LHN/home screen, press the back button again

Expected Result:

  • When pressing the back button on the LHN/home screen, the app should be minimised (exited).

Actual Result:

  • When pressing the back button on the LHN/home screen, we navigate back to the previous chat that users was in.

Workaround:

  • None

Platform:

Where is this issue occurring?

  • [ ] Web
  • [ ] iOS
  • [x] Android
  • [ ] Desktop App
  • [ ] Mobile Web

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Upwork URL: https://www.upwork.com/jobs/~017e60e720f6f9aca8

View all open jobs on Upwork

kp17211 avatar Jul 24 '21 11:07 kp17211

Triggered auto assignment to @mallenexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Jul 24 '21 11:07 MelvinBot

I don't have Android, trying to find someone on the CM team to triage

mallenexpensify avatar Jul 26 '21 17:07 mallenexpensify

Assigning to @laurenreidexpensify for review since she has Android and I don't.

mallenexpensify avatar Jul 26 '21 18:07 mallenexpensify

To me this is reproducible.

parasharrajat avatar Jul 26 '21 18:07 parasharrajat

@kp17211 @parasharrajat I'm trying to reproduce this and a bit confused.

  • Am on my Chats page
  • tap into a chat
  • within chat, tap top left hand < icon
  • taken back to chat page
  • swipe left as the generic Android "back" action
  • am taken to the chat I was just in

Am I missing something? Isn't this the expected behaviour?

laurenreidexpensify avatar Jul 27 '21 11:07 laurenreidexpensify

am taken to the chat I was just in

This is an issue.

the flow should be

  1. You click on any chat from LHN.
  2. It takes you to the chat.
  3. You click back button on android phone.
  4. It takes you back to chat list / LHN.
  5. You press the hardward back button again.
  6. App should minimize.
  7. But it will take you back to the recent open chat.

parasharrajat avatar Jul 27 '21 11:07 parasharrajat

Ah got it - okay yes I can confirm this is the behaviour then. Will send this to our engineering team for next review.

laurenreidexpensify avatar Jul 27 '21 17:07 laurenreidexpensify

Triggered auto assignment to @flodnv (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Jul 27 '21 17:07 MelvinBot

I could've sworn this was a feature and not a bug (granted, that I found strange as well). What's the behavior on iOS?

flodnv avatar Jul 28 '21 11:07 flodnv

What's the behavior on iOS?

I don't believe iOS has a "back" hardware button (at least most of their devices don't) so I think this only applies in Android.

I agree this should be fixed eventually, it's how most (if not all) Android apps work, so I'll take this over and making it External

Looks like these resources could be helpful:

  • https://reactnative.dev/docs/backhandler
  • https://reactnavigation.org/docs/custom-android-back-button-handling/
  • Conversation in #expensify-open-source about using hooks here

Beamanator avatar Aug 03 '21 13:08 Beamanator

Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Aug 03 '21 13:08 MelvinBot

The title of this issue is a bit generic and the steps in the OP are a little confusing, so it would be good to spruce this up before posting to Upwork. Before I make the updates, am I right in thinking the issue here is isolated to: The Android hardware back button does not minimise the app when pressed on the LHN/home screen?

Then the Action Performed reproduction steps are:

  1. Click on an a chat from the LHN
  2. Once you're in the chat, press the back button to navigate back to the LHN/home screen
  3. From the LHN/home screen, press the back button again

Expected Results

  • When pressing the back button on the LHN/home screen, the app should be minimised (exited).

Actual Results

  • When pressing the back button on the LHN/home screen, we navigate back to the previous chat that users was in.

Let me know if that's correct and I'll update the issue. 👍 Also, not sure if it's helpful to reference for the implementation approach, but we had some wider inconsistencies with the Android back button a little while back here.

trjExpensify avatar Aug 03 '21 14:08 trjExpensify

We should first look into React-navigation. It was previously fixed but after the upgrade of react-navigation to v6 broke that fix.

parasharrajat avatar Aug 03 '21 15:08 parasharrajat

Nice @trjExpensify that looks like a great summary! 👍

Beamanator avatar Aug 03 '21 16:08 Beamanator

Cool, updated. Upwork job is here. @kp17211 are you interested in applying seeing as though you raised this issue?

trjExpensify avatar Aug 03 '21 18:08 trjExpensify

Hello @trjExpensify yes I want to work on this issue

kp17211 avatar Aug 04 '21 04:08 kp17211

@kp17211 I think what @trjExpensify was asking was if you want to submit a proposal for the fix :D

Beamanator avatar Aug 04 '21 08:08 Beamanator

Not overdue, just waiting for proposals

Beamanator avatar Aug 06 '21 12:08 Beamanator

Changing priority to weekly as we wait for proposals

Beamanator avatar Aug 09 '21 09:08 Beamanator

@Beamanator I'm interested to work on the job. Submitted proposal at Upwork.

Aamer-Rasheed avatar Aug 09 '21 13:08 Aamer-Rasheed