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

[#13690] Fix visibility status color #13747

Merged
merged 2 commits into from
Aug 4, 2022

Conversation

ilmotta
Copy link
Contributor

@ilmotta ilmotta commented Aug 1, 2022

Fixes #13690

Summary

This PR fixes the visibility status color of the dot icon.

Review notes

This PR fixes the issue by introducing a new state called :ui/old? (true by default). Components that are directly impacted by the redesign can simply subscribe to the new state and react accordingly. Edit: thanks to reviewers, I could replace the new state with the existing atom utils.config.new-ui-enabled?.

AFAIU, the current approach to redesign on top of the existing design is to duplicate functions, using the suffix *-old. This seems to divert from re-frame's recommendation to derive the UI from the app db and also causes an explosion of duplicated functions throughout the codebase.

The duplicate+suffix strategy also leads to unnecessary changes to the call tree. For instance, some functions are duplicated because their downstream functions return a different color, but in reality, these parent functions have the exact same behavior. A concrete example, the parent component emoji-chat-icon-view depends on profile-photo-plus-dot-view, but it doesn't care what the inner component returns, so why should it change in a breaking way (var rename)? Of course, there are cases where it might be better duplicating a function, but most of the *-old ones I've seen could avoid such in-place changes.

If this new approach seems reasonable to y'all, perhaps future PRs could use the new subscription, which could help reduce the number of regressions while the redesign isn't finished.

Testing notes

For manually testing between the old/new design, you can dispatch the event below in a REPL:

(comment
  (re-frame.core/reg-event-fx
   :ui/toggle-old
   (fn [{:keys [db]}]
     {:db (update db :ui/old? not)}))

  (re-frame.core/dispatch [:ui/toggle-old]))

Edit: Use the existing effect to toggle the new UI.

(comment
  (re-frame.core/dispatch [:toggle-new-ui]))

The video below demonstrates the app already fixed, with the toggle on/off and how it affects the visibility status icon.

Peek.2022-08-02.08-51.mp4

Platforms

  • Android
  • iOS

Steps to test

To reproduce the bug:

The issue #13690 describes the steps to reproduce, but to summarize:

  1. Open Status.
  2. Open the chat with someone who's currently active and visible to you.
  3. Notice the slight difference between the green colors in the visibility status dot icon.

For QA purposes:

  1. Open Status with the fix from this PR.
  2. Open the chat with someone who's currently active and visible to you.
  3. Toggle between the new/old design and notice the visibility status icon is displayed with the expected green color.

Status: ready

@status-github-bot
Copy link

Hey @ilmotta, and thank you so much for making your first pull request in status-mobile! ❤️ Please help us make your experience better by filling out this brief questionnaire https://goo.gl/forms/uWqNcVpVz7OIopXg2

@status-github-bot status-github-bot bot added this to REVIEW in Pipeline for QA Aug 1, 2022
@status-im-auto
Copy link
Member

status-im-auto commented Aug 2, 2022

Jenkins Builds

Click to see older builds (10)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 48c1d4c #1 2022-08-02 00:02:54 ~10 min ios 📦ipa 📲
✔️ 48c1d4c #1 2022-08-02 00:04:16 ~12 min android-e2e 📦apk 📲
✔️ cf0ec7c #2 2022-08-02 10:49:04 ~9 min android-e2e 📦apk 📲
✔️ cf0ec7c #2 2022-08-02 10:49:10 ~9 min android 📦apk 📲
✔️ cf0ec7c #2 2022-08-02 10:54:28 ~15 min ios 📦ipa 📲
✔️ ed07d93 #3 2022-08-02 11:59:57 ~10 min ios 📦ipa 📲
✔️ ed07d93 #3 2022-08-02 12:01:06 ~11 min android 📦apk 📲
✔️ 79cb56a #4 2022-08-02 15:15:04 ~9 min android 📦apk 📲
✔️ 79cb56a #4 2022-08-02 15:15:39 ~10 min android-e2e 📦apk 📲
✔️ 79cb56a #4 2022-08-02 15:20:20 ~15 min ios 📦ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 99ce1dc #5 2022-08-03 11:49:15 ~9 min android-e2e 📦apk 📲
✔️ 99ce1dc #5 2022-08-03 11:50:08 ~10 min ios 📦ipa 📲
✔️ 99ce1dc #5 2022-08-03 11:50:39 ~10 min android 📦apk 📲
✔️ a5ac96b #6 2022-08-03 14:49:50 ~9 min ios 📦ipa 📲
✔️ a5ac96b #6 2022-08-03 14:51:01 ~11 min android-e2e 📦apk 📲
✔️ a5ac96b #6 2022-08-03 14:51:31 ~11 min android 📦apk 📲

src/status_im/subs.cljs Outdated Show resolved Hide resolved
src/status_im/db.cljs Outdated Show resolved Hide resolved
src/status_im/subs.cljs Outdated Show resolved Hide resolved
ilmotta added a commit to ilmotta/status-mobile that referenced this pull request Aug 2, 2022
@ilmotta ilmotta requested a review from flexsurfer August 2, 2022 16:56
@flexsurfer
Copy link
Member

@ilmotta , could you please rebase you branch onto develop, and resolve conflicts if any, thank you

@ilmotta ilmotta force-pushed the fix/visibility-status-color branch from 79cb56a to 99ce1dc Compare August 3, 2022 11:39
@flexsurfer flexsurfer moved this from REVIEW to E2E Tests in Pipeline for QA Aug 3, 2022
@status-im-auto
Copy link
Member

99% of end-end tests have passed

Total executed tests: 87
Failed tests: 1
Passed tests: 86
IDs of failed tests: 702076 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestPublicChatBrowserOneDeviceMerged:

    1. test_browser_delete_close_tabs, id: 702076

    Device 1: Find `Button` by `xpath`: `//*[contains(@text, 'bbc.com')]/../../../../*[@content-desc='empty-tab']`
    Device 1: Tap on found: Button

    critical/test_public_chat_browsing.py:423: in test_browser_delete_close_tabs web_page.element_by_text_part(urls['bbc.com']).wait_for_invisibility_of_element() ../views/base_element.py:144: in wait_for_invisibility_of_element raise TimeoutException

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    Passed tests (86)

    Click to expand

    Class TestRestoreOneDeviceMerged:

    1. test_restore_uppercase_whitespaces_seed_phrase_special_char_passw_logcat, id: 700748

    Class: TestRestoreOneDeviceMerged

    Device sessions

    2. test_restore_seed_phrase_field_validation, id: 700750

    Class: TestRestoreOneDeviceMerged

    Device sessions

    3. test_restore_account_migrate_multiaccount_to_keycard_no_db_saved_add_wallet_send_tx, id: 702189

    Class: TestRestoreOneDeviceMerged

    Device sessions

    4. test_restore_set_up_wallet_sign_phrase, id: 700749

    Class: TestRestoreOneDeviceMerged

    Device sessions

    Class TestPublicChatMultipleDeviceMerged:

    1. test_public_chat_unread_messages_counter, id: 5360

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    2. test_public_chat_links_with_previews_github_youtube_twitter_gif_send_enable, id: 700737

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    3. test_public_chat_unread_messages_counter_for_mention_relogin, id: 700718

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    4. test_public_chat_message_edit, id: 700734

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    5. test_public_chat_link_send_open, id: 700736

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    6. test_public_chat_emoji_send_copy_paste_reply, id: 700719

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    7. test_public_chat_message_send_check_timestamps_while_on_different_tab, id: 5313

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    8. test_public_chat_delete_chat_long_press, id: 5319

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    9. test_public_chat_message_delete, id: 700735

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    10. test_public_chat_mark_all_messages_as_read, id: 6270

    Class: TestPublicChatMultipleDeviceMerged

    Device sessions

    Class TestPairingSyncMultipleDevicesMerged:

    1. test_pairing_sync_initial_profile_picture, id: 702392

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    2. test_pairing_sync_initial_bookmarks, id: 702393

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    3. test_pairing_sync_initial_contacts_blocked_users, id: 702194

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    4. test_pairing_sync_public_chat_add_remove, id: 702199

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    5. test_pairing_sync_contacts_add_remove_set_nickname_ens, id: 702197

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    6. test_pairing_sync_initial_public_chats, id: 702195

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    7. test_pairing_sync_contacts_block_unblock, id: 702196

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    8. test_pairing_sync_1_1_chat_message, id: 702198

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    9. test_pairing_sync_clear_history, id: 702394

    Class: TestPairingSyncMultipleDevicesMerged

    Device sessions

    Class TestWalletManagementDeviceMerged:

    1. test_wallet_manage_assets, id: 700758

    Class: TestWalletManagementDeviceMerged

    Device sessions

    2. test_wallet_fetching_balance_after_offline_insufficient_funds_errors, id: 700766

    Class: TestWalletManagementDeviceMerged

    Device sessions

    3. test_wallet_add_account_seed_phrase_validation, id: 700762

    Class: TestWalletManagementDeviceMerged

    Device sessions

    4. test_wallet_tx_history_copy_tx_hash_on_cellular, id: 700756

    Class: TestWalletManagementDeviceMerged

    Device sessions

    5. test_wallet_add_hide_unhide_account_private_key, id: 700761

    Class: TestWalletManagementDeviceMerged

    Device sessions

    6. test_wallet_add_delete_watch_only_account, id: 700760

    Class: TestWalletManagementDeviceMerged

    Device sessions

    7. test_wallet_add_account_generate_new, id: 700759

    Class: TestWalletManagementDeviceMerged

    Device sessions

    Class TestContactBlockMigrateKeycardMultipleSharedDevices:

    1. test_keycard_command_send_tx_eth_1_1_chat, id: 702186

    Class: TestContactBlockMigrateKeycardMultipleSharedDevices

    Device sessions

    2. test_cellular_settings_on_off_public_chat_fetching_history, id: 702188

    Class: TestContactBlockMigrateKeycardMultipleSharedDevices

    Device sessions

    3. test_restore_account_migrate_multiaccount_to_keycard_db_saved, id: 702177

    Class: TestContactBlockMigrateKeycardMultipleSharedDevices

    Device sessions

    4. test_contact_add_remove_mention_default_username_nickname_public_chat, id: 702175

    Class: TestContactBlockMigrateKeycardMultipleSharedDevices

    Device sessions

    5. test_contact_block_unblock_public_chat_offline, id: 702176

    Class: TestContactBlockMigrateKeycardMultipleSharedDevices

    Device sessions

    Class TestSendTxDeviceMerged:

    1. test_send_tx_sign_message_2tx_in_batch_tx_filters_request_stt_testdapp, id: 5342

    Class: TestSendTxDeviceMerged

    Device sessions

    2. test_send_tx_token_8_decimals, id: 700764

    Class: TestSendTxDeviceMerged

    Device sessions

    3. test_send_tx_eth_check_logcat, id: 700763

    Class: TestSendTxDeviceMerged

    Device sessions

    4. test_send_tx_custom_token_18_decimals_invalid_password, id: 700765

    Class: TestSendTxDeviceMerged

    Device sessions

    5. test_send_tx_set_recipient_options, id: 700757

    Class: TestSendTxDeviceMerged

    Device sessions

    Class TestPublicChatBrowserOneDeviceMerged:

    1. test_public_chat_open_using_deep_link, id: 700739

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    2. test_public_chat_fetch_more_history, id: 5675

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    3. test_browser_offline, id: 702075

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    4. test_public_chat_copy_and_paste_message_in_chat_input, id: 5317

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    5. test_browser_connection_is_secure_not_secure_warning, id: 702073

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    6. test_browser_invalid_url, id: 702074

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    7. test_browser_web3_permissions_testdapp, id: 702078

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    8. test_public_chat_navigate_to_chat_when_relaunch, id: 5396

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    9. test_browser_bookmarks_create_edit_remove, id: 702077

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    10. test_browser_blocked_url, id: 702072

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    11. test_public_chat_tag_message, id: 700738

    Class: TestPublicChatBrowserOneDeviceMerged

    Device sessions

    Class TestCommandsMultipleDevicesMerged:

    1. test_1_1_chat_command_send_tx_eth_outgoing_tx_push, id: 6253

    Class: TestCommandsMultipleDevicesMerged

    Device sessions

    2. test_1_1_chat_command_request_and_send_tx_stt_in_1_1_chat_offline, id: 6263

    Class: TestCommandsMultipleDevicesMerged

    Device sessions

    3. test_1_1_chat_command_decline_eth_push_changing_state, id: 6265

    Class: TestCommandsMultipleDevicesMerged

    Device sessions

    Class TestGroupChatMultipleDeviceMerged:

    1. test_group_chat_highligted, id: 5756

    Class: TestGroupChatMultipleDeviceMerged

    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 700731

    Class: TestGroupChatMultipleDeviceMerged

    Device sessions

    3. test_group_chat_push_system_messages_when_invited, id: 3994

    Class: TestGroupChatMultipleDeviceMerged

    Device sessions

    4. test_group_chat_add_new_member_activity_centre, id: 700732

    Class: TestGroupChatMultipleDeviceMerged

    Device sessions

    5. test_group_chat_offline_pn, id: 3998

    Class: TestGroupChatMultipleDeviceMerged

    Device sessions

    6. test_group_chat_leave_relogin, id: 3997

    Class: TestGroupChatMultipleDeviceMerged

    Device sessions

    Class TestOnboardingOneDeviceMerged:

    1. test_onboarding_cant_sign_in_with_invalid_password_logcat, id: 700746

    Class: TestOnboardingOneDeviceMerged

    Device sessions

    2. test_onboarding_backup_seed_phrase_restore_same_login_logcat, id: 700745

    Class: TestOnboardingOneDeviceMerged

    Device sessions

    3. test_onboarding_share_contact_address, id: 700743

    Class: TestOnboardingOneDeviceMerged

    Device sessions

    4. test_onboarding_add_new_multiaccount_username_by_position_pass_validation, id: 700747

    Class: TestOnboardingOneDeviceMerged

    Device sessions

    5. test_onboarding_home_initial_popup, id: 700742

    Class: TestOnboardingOneDeviceMerged

    Device sessions

    6. test_onboarding_share_wallet_address, id: 700744

    Class: TestOnboardingOneDeviceMerged

    Device sessions

    Class TestOneToOneChatMultipleSharedDevices:

    1. test_1_1_chat_text_message_edit_delete_push_disappear, id: 695843

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 5310

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    3. test_1_1_chat_emoji_send_reply_and_open_link, id: 5373

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    4. test_1_1_chat_non_latin_message_to_newly_added_contact_with_profile_picture_on_different_networks, id: 5315

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    5. test_1_1_chat_text_message_with_push, id: 6316

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    6. test_1_1_chat_push_emoji, id: 6283

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    7. test_1_1_chat_message_reaction, id: 6315

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    8. test_1_1_chat_image_send_save_reply, id: 6305

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    9. test_1_1_chat_delete_via_delete_button_relogin, id: 5387

    Class: TestOneToOneChatMultipleSharedDevices

    Device sessions

    Class TestKeycardTxOneDeviceMerged:

    1. test_keycard_send_tx_eth, id: 700767

    Class: TestKeycardTxOneDeviceMerged

    Device sessions

    2. test_keycard_relogin_after_restore, id: 700768

    Class: TestKeycardTxOneDeviceMerged

    Device sessions

    3. test_keycard_send_tx_sign_message_request_stt_testdapp, id: 700769

    Class: TestKeycardTxOneDeviceMerged

    Device sessions

    4. test_keycard_create_account_unlock_same_seed, id: 5689

    Class: TestKeycardTxOneDeviceMerged

    Device sessions

    5. test_keycard_wallet_recover_pairing_check_balance_after_offline_tx_history, id: 700770

    Class: TestKeycardTxOneDeviceMerged

    Device sessions

    Class TestEnsStickersMultipleDevicesMerged:

    1. test_sticker_1_1_public_chat_mainnet, id: 702157

    Class: TestEnsStickersMultipleDevicesMerged

    Device sessions

    2. test_ens_command_send_tx_eth_1_1_chat, id: 702153

    Class: TestEnsStickersMultipleDevicesMerged

    Device sessions

    3. test_ens_mention_nickname_1_1_chat, id: 702155

    Class: TestEnsStickersMultipleDevicesMerged

    Device sessions

    4. test_ens_mention_push_highlighted_public_chat, id: 702156

    Class: TestEnsStickersMultipleDevicesMerged

    Device sessions

    5. test_ens_purchased_in_profile, id: 702152

    Class: TestEnsStickersMultipleDevicesMerged

    Device sessions

    6. test_start_new_chat_public_key_validation, id: 702158

    Class: TestEnsStickersMultipleDevicesMerged

    Device sessions

    Copy link
    Member

    @flexsurfer flexsurfer left a comment

    Choose a reason for hiding this comment

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

    great job, thank you

    @qoqobolo qoqobolo moved this from E2E Tests to IN TESTING in Pipeline for QA Aug 3, 2022
    @qoqobolo qoqobolo self-assigned this Aug 3, 2022
    @qoqobolo
    Copy link
    Contributor

    qoqobolo commented Aug 3, 2022

    Hey @ilmotta, thank you for your contribution and for the fix!
    Found an issue, take a look, please.

    ISSUE 1: Missing colors for the online status indicator in the Profile view in the dropdown menu

    Steps:

    1. Create an account
    2. Open Profile

    OS: Android, iOS

    Actual result:

    video_2022-08-03_15-28-10.mp4

    Expected result:

    IMG_1193.MP4

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Aug 3, 2022

    Missing colors for the online status indicator in the Profile view in the dropdown menu

    Hey @qoqobolo, I'll most definitely try to fix this today. Thanks for finding this out.

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Aug 3, 2022

    Missing colors for the online status indicator in the Profile view in the dropdown menu

    @qoqobolo, I just fixed the problem in commit a5ac96b

    I would like to call your attention to an existing bug in the develop branch that I haven't fixed because it wasn't part of the issue's scope of this PR (see #13690), but if you think I should fix it no worries, I could give it a try.

    Here's the problem: when the new design is enabled in the develop branch, the status colors still use the current (old) design.

    @Parveshdhull
    Copy link
    Member

    Parveshdhull commented Aug 3, 2022

    Here's the problem: when the new design is enabled in the develop branch, the status colors still use the current (old) design.

    Hi, thank you for the screenshot, looks like in the new UI, the visibility status drop-down is also not aligning.
    As the new UI is still in WIP, and we have not yet worked on profile section, maybe we can fix both of the issues when we redesign the profile section. What do you think @qoqobolo?

    UPD: Looks like the status updates drop-down issue is introduced in #13717, as we now allow the switcher to draw on the status-bar, we also need to consider the status-bar's height for calculating the dropdown's position. Created issue for that #13758

    For the issue about dot color in profile section, I think we can leave them for now, as we didn't redesigned this screen yet.

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Aug 3, 2022

    Sounds good to me @Parveshdhull. Thanks for taking a look at the problem.

    @qoqobolo
    Copy link
    Contributor

    qoqobolo commented Aug 4, 2022

    Hi, thank you for the screenshot, looks like in the new UI, the visibility status drop-down is also not aligning.
    As the new UI is still in WIP, and we have not yet worked on profile section, maybe we can fix both of the issues when we redesign the profile section. What do you think @qoqobolo?

    Agree. We are not yet subjecting the new UI to comprehensive testing, as many parts are still WIP.
    So yes, those issues can be fixed and tested later.

    @qoqobolo
    Copy link
    Contributor

    qoqobolo commented Aug 4, 2022

    I just fixed the problem in commit a5ac96b

    Thanks @ilmotta!
    PR is tested and can be merged.

    @qoqobolo qoqobolo moved this from IN TESTING to MERGE in Pipeline for QA Aug 4, 2022
    @flexsurfer flexsurfer merged commit cdbd85f into status-im:develop Aug 4, 2022
    Pipeline for QA automation moved this from MERGE to DONE Aug 4, 2022
    chrispader pushed a commit to chrispader/status-mobile that referenced this pull request Aug 4, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    online visibility indicator color is different on chat screen and home
    5 participants