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

[#8940] Redesign Back, swipe-to-the-left and hardware device Back but… #9215

Merged
merged 1 commit into from
Oct 18, 2019

Conversation

flexsurfer
Copy link
Member

@flexsurfer flexsurfer commented Oct 15, 2019

partially #8940

the first step of navigation improvement, for v1 we want to avoid broken app states, so i added a list of views there it's possible to navigate back safely

@flexsurfer flexsurfer requested a review from a team as a code owner October 15, 2019 12:36
@flexsurfer flexsurfer self-assigned this Oct 15, 2019
@ghost
Copy link

ghost commented Oct 15, 2019

Pull Request Checklist

  • Docs: Updated the documentation, if affected
  • Docs: Added or updated inline comments explaining intention of the code
  • Tests: Ensured that all new UI elements have been assigned accessibility IDs
  • Tests: Signaled need for E2E tests with label, if applicable
  • Tests: Briefly described what was tested and what platforms were used
  • UI: In case of UI changes, ensured that UI matches Figma
  • UI: In case of UI changes, requested review from a Core UI designer
  • UI: In case of UI changes, included screenshots of implementation

@status-im-auto
Copy link
Member

status-im-auto commented Oct 15, 2019

Jenkins Builds

Click to see older builds (19)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e799f54 #1 2019-10-15 12:48:11 ~11 min ios 📦ipa 📲
e799f54 #1 2019-10-15 12:50:07 ~13 min android-e2e 📄log
e799f54 #1 2019-10-15 12:50:17 ~13 min android 📄log
✔️ e799f54 #1 2019-10-15 12:50:21 ~13 min macos 📦dmg
✔️ e799f54 #1 2019-10-15 12:50:34 ~13 min windows 📦exe
✔️ e799f54 #1 2019-10-15 12:53:09 ~16 min linux 📦App
✔️ e81c58c #2 2019-10-16 11:25:30 ~13 min android 📦apk 📲
✔️ e81c58c #2 2019-10-16 11:29:08 ~17 min android-e2e 📦apk 📲
✔️ e81c58c #2 2019-10-16 11:30:20 ~18 min linux 📦App
✔️ e81c58c #2 2019-10-16 11:32:15 ~20 min windows 📦exe
✔️ e81c58c #2 2019-10-16 11:35:44 ~23 min ios 📦ipa 📲
✔️ e81c58c #2 2019-10-16 11:48:45 ~36 min macos 📦dmg
✔️ fe5312d #3 2019-10-18 10:57:51 ~11 min ios 📦ipa 📲
✔️ fe5312d #3 2019-10-18 10:58:08 ~12 min windows 📦exe
✔️ fe5312d #3 2019-10-18 10:59:28 ~13 min linux 📦App
fe5312d #3 2019-10-18 10:59:39 ~13 min android-e2e 📄log
fe5312d #3 2019-10-18 11:00:03 ~14 min android 📄log
✔️ fe5312d #3 2019-10-18 11:01:15 ~15 min macos 📦dmg
✔️ fe5312d #4 2019-10-18 13:27:31 ~11 min android 📦apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9a1c783 #4 2019-10-18 14:08:23 ~12 min ios 📦ipa 📲
✔️ 9a1c783 #4 2019-10-18 14:09:09 ~13 min android-e2e 📦apk 📲
✔️ 9a1c783 #5 2019-10-18 14:09:13 ~13 min android 📦apk 📲
✔️ 9a1c783 #4 2019-10-18 14:11:43 ~15 min macos 📦dmg
c3a8ba8 #5 2019-10-18 14:21:56 ~12 min android-e2e 📄log
c3a8ba8 #6 2019-10-18 14:22:07 ~12 min android 📄log
✔️ c3a8ba8 #5 2019-10-18 14:23:43 ~14 min linux 📦App
✔️ c3a8ba8 #5 2019-10-18 14:24:33 ~14 min windows 📦exe
✔️ c3a8ba8 #5 2019-10-18 14:28:43 ~19 min ios 📦ipa 📲
✔️ c3a8ba8 #5 2019-10-18 14:39:37 ~30 min macos 📦dmg
✔️ c3a8ba8 #7 2019-10-18 14:53:14 ~10 min android 📦apk 📲
✔️ c3a8ba8 #6 2019-10-18 14:58:29 ~8 min android-e2e 📦apk 📲

@flexsurfer flexsurfer requested review from vitvly and dmitryn and removed request for a team October 16, 2019 11:14
@@ -0,0 +1,29 @@
(ns status-im.ui.screens.routing.back-actions)

(def back-actions {:chat :default
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't you use :intro-wizard/navigate-back for some screens here?

Copy link
Member Author

Choose a reason for hiding this comment

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

no for now, this PR is only to prevent broken states of the app, later we could decide what to do with cancel actions

Copy link
Contributor

Choose a reason for hiding this comment

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

but what does it mean for this action? it prevents hardware button and 3 finger slide back but if you press the cancel button it works?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Hardware back button is not prevented here, it still works.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's no way to disable hw back button unless resorting to RN's BackHandler.

@statustestbot
Copy link

98% of end-end tests have passed

Total executed tests: 98
Failed tests: 2
Passed tests: 96

Failed tests (2)

Click to expand
1. test_modify_transaction_fee_values

Device 1: Tap on SignButton
Device 1: Looking for an element by text: 'intrinsic gas too low'

Device 1: 'BaseText' is not found on the screen; also Unexpected Alert is shown: 'Consider it complete after 12 confirmations on the network.'

Device sessions

2. test_send_two_transactions_one_after_another_in_dapp

Device 1: Tap on OkButton
Device 1: Looking for an element by text: 'Sign with password'

Second send transaction screen did not appear!

Device sessions

Passed tests (96)

Click to expand
1. test_user_can_switch_network
Device sessions

2. test_block_user_from_public_chat
Device sessions

3. test_filters_from_daap
Device sessions

4. test_copy_and_paste_messages
Device sessions

5. test_send_transaction_from_daap
Device sessions

6. test_onboarding_screen_when_requesting_tokens_for_recovered_account
Device sessions

7. test_connection_is_secure
Device sessions

8. test_deploy_contract_from_daap
Device sessions

9. test_redirect_to_public_chat_tapping_tag_message
Device sessions

10. test_remove_member_from_group_chat
Device sessions

11. test_delete_one_to_one_chat_via_delete_button
Device sessions

12. test_mobile_data_usage_popup_continue_syncing
Device sessions

13. test_clear_history_of_group_chat_via_group_view
Device sessions

14. test_decline_invitation_to_group_chat
Device sessions

15. test_open_transaction_on_etherscan
Device sessions

16. test_pass_phrase_validation
Device sessions

17. test_open_blocked_site
Device sessions

18. test_public_chat_messaging
Device sessions

19. test_open_chat_by_pasting_public_key
Device sessions

20. test_add_custom_token
Device sessions

21. test_long_press_to_delete_1_1_chat
Device sessions

22. test_password_in_logcat_sign_in
Device sessions

23. test_set_profile_picture
Device sessions

24. test_text_message_1_1_chat
Device sessions

25. test_add_to_contacts
Device sessions

26. test_sign_typed_message
Device sessions

27. test_home_view
Device sessions

28. test_send_and_open_links
Device sessions

29. test_unread_messages_counter_1_1_chat
Device sessions

30. test_can_use_purchased_stickers_on_recovered_account
Device sessions

31. test_ens_in_public_chat
Device sessions

32. test_logcat_send_transaction_from_daap
Device sessions

33. test_copy_contact_code_and_wallet_address
Device sessions

34. test_collectible_from_wallet_opens_in_browser_view
Device sessions

35. test_send_message_in_group_chat
Device sessions

36. test_logcat_send_transaction_from_wallet
Device sessions

37. test_account_recovery_with_uppercase_recovery_phrase
Device sessions

38. test_send_token_with_7_decimals
Device sessions

39. test_offline_messaging_1_1_chat
Device sessions

40. test_fetch_more_history_in_empty_chat
Device sessions

41. test_delete_group_chat_via_delete_button
Device sessions

42. test_token_with_more_than_allowed_decimals (TestRail link is not found)
Device sessions

43. test_send_eth_from_wallet_to_address
Device sessions

44. test_contact_profile_view
Device sessions

45. test_add_account_to_multiaccount_instance
Device sessions

46. test_send_funds_between_accounts_in_multiaccount_instance
Device sessions

47. test_request_eth_in_status_test_dapp
Device sessions

48. test_manage_assets
Device sessions

49. test_create_new_group_chat
Device sessions

50. test_wallet_set_up
Device sessions

51. test_long_press_to_delete_public_chat
Device sessions

52. test_send_emoji
Device sessions

53. test_search_chat_on_home
Device sessions

54. test_block_user_from_one_to_one_header
Device sessions

55. test_logcat_recovering_account
Device sessions

56. test_mobile_data_usage_popup_stop_syncing
Device sessions

57. test_can_add_existing_ens
Device sessions

58. test_transaction_wrong_password_wallet
Device sessions

59. test_pair_devices_sync_name_photo_public_group_chats
Device sessions

60. test_install_pack_and_send_sticker
Device sessions

61. test_pair_devices_sync_one_to_one_contacts
Device sessions

62. test_delete_public_chat_via_delete_button
Device sessions

63. test_messaging_in_different_networks
Device sessions

64. test_logcat_backup_recovery_phrase
Device sessions

65. test_add_new_group_chat_member
Device sessions

66. test_logcat_sign_message_from_daap
Device sessions

67. test_switch_users_and_add_new_account
Device sessions

68. test_mobile_data_usage_settings
Device sessions

69. test_make_admin_member_of_group_chat
Device sessions

70. test_long_press_delete_clear_all_dapps
Device sessions

71. test_send_stt_from_wallet
Device sessions

72. test_login_with_new_account
Device sessions

73. test_insufficient_funds_wallet_positive_balance
Device sessions

74. test_request_public_key_status_test_daap
Device sessions

75. test_start_chat_with_ens
Device sessions

76. test_add_contact_from_public_chat
Device sessions

77. test_user_can_see_all_own_assets_after_account_recovering
Device sessions

78. test_send_message_to_newly_added_contact
Device sessions

79. test_password_in_logcat_creating_account
Device sessions

80. test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed
Device sessions

81. test_backup_recovery_phrase
Device sessions

82. test_public_chat_clear_history
Device sessions

83. test_offline_status
Device sessions

84. test_open_google_com_via_open_dapp
Device sessions

85. test_unread_messages_counter_public_chat
Device sessions

86. test_sign_message_from_daap
Device sessions

87. test_user_can_remove_profile_picture
Device sessions

88. test_send_two_transactions_in_batch_in_dapp
Device sessions

89. test_share_contact_code_and_wallet_address
Device sessions

90. test_message_marked_as_sent_in_1_1_chat
Device sessions

91. test_need_help_section
Device sessions

92. test_refresh_button_browsing_app_webview
Device sessions

93. test_backup_recovery_phrase_warning_from_wallet
Device sessions

94. test_log_level_and_fleet
Device sessions

95. test_group_chat_system_messages
Device sessions

96. test_open_public_chat_using_deep_link
Device sessions

@rachelhamlin
Copy link
Contributor

@flexsurfer what should we test in this PR?

@flexsurfer
Copy link
Member Author

so now there is a list of screens where you can use hardware back button on android or swipe on ios, for most onboarding screens and keycard screens hardware button or swipe will be unavailable

@flexsurfer
Copy link
Member Author

@siphiuel @dmitryn, please review

@@ -0,0 +1,29 @@
(ns status-im.ui.screens.routing.back-actions)

(def back-actions {:chat :default
Copy link
Contributor

Choose a reason for hiding this comment

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

Hardware back button is not prevented here, it still works.

(fn [action state]
(let [event (get back-actions/back-actions @view-id)]
(when (and (= (.-type action) (.-BACK navigation/navigation-actions)) event (not= :default event))
(re-frame/dispatch [event]))
Copy link
Contributor

Choose a reason for hiding this comment

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

This dispatch is never invoked currently. So this means that create.core/intro-step-back is never invoked on Android hardware back or iOS swipe, and recover.core/cancel-pressed is never invoked for actions included above + clicking on the Back arrow. So wizard state is not updated. This causes e.g. these issues:

  1. If one presses Android's hardware back on Onboarding's Select account screen, and then generates keys again, they are redirected to Select key storage screen bypassing Select account screen
  2. On Basic recovery's Select storage screen clicking on Cancel is not going to show any confirmation dialog.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe there are some more, but maybe we can get rid of wizard state being dependent on a specific step

Copy link
Member Author

Choose a reason for hiding this comment

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

i didn't whitelist onboarding screens, so they will work fine because you can't use hardware buttons on them

Copy link
Member Author

@flexsurfer flexsurfer Oct 18, 2019

Choose a reason for hiding this comment

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

don't want to mess with wizard state in this PR, but we could try to get rid of it for sure

;; This atom stores event vector
;; to be dispatched when a react-navigation's BACK
;; actions is invoked
(def wizard-back-event (atom nil))
Copy link
Contributor

@vitvly vitvly Oct 17, 2019

Choose a reason for hiding this comment

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

Kudos for removing this atom in favor of back-actions, it was whacky.

(let [event (get back-actions/back-actions @view-id)]
(when (and (= (.-type action) (.-BACK navigation/navigation-actions)) event (not= :default event))
(re-frame/dispatch [event]))
(default-get-state-for-action action state))))
Copy link
Contributor

Choose a reason for hiding this comment

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

For now we're always popping the item from stack here, disregarding whatever might happen in event handler, but when Cancel processing is in place (and thus a possibility to block navigation action), how should this work? Currently screens.navigation/processing-back-event? exists, will there be some alternative?

Copy link
Member Author

Choose a reason for hiding this comment

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

we could try to find an alternative after v1, for now Cancel screens just ignore hardware button or swipe

@flexsurfer
Copy link
Member Author

@siphiuel thanks, added fix for Android https://github.com/status-im/status-react/pull/9215/files#diff-f65399a61bf325c3844d2b6b43bf1829R53
so my idea in this PR just to allow hardware button on Android or swipe on iOS only on whitelisted screens

@flexsurfer flexsurfer requested a review from vitvly October 18, 2019 11:46
…tons to align the behavior

Signed-off-by: Andrey Shovkoplyas <[email protected]>
@flexsurfer flexsurfer merged commit cbe17cb into develop Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants