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

Implement share button inside profile settings #19559

Merged

Conversation

seanstrom
Copy link
Member

@seanstrom seanstrom commented Apr 8, 2024

fixes #19550

Summary

  • This PR attempts to implement the share button inside the profile settings view
  • Additionally, this PR attempts to define an :open-share event and :open-share-fx effect for managing the opening of the react share-sheet.
    • And this PR attempts to refactor several usages of opening the react share-sheet to use the newly defined :open-share event with re-frame dispatch.

Platforms

  • Android
  • iOS

Areas that maybe impacted

Functional
  • Profile settings share button
  • Contact's profile share action
  • Contact's share profile screen
  • Share action inside Share view
  • Wallet share action
  • Community channel share action
  • Potentially anywhere else that involves sharing (?)

Steps to test

Here's a video demonstrating how to test each share button while logged in as a user who has already one contact.

Screen.Recording.2024-04-08.at.10.18.19.mov

Before and after screenshots comparison

Before

Here's a video of the existing behaviour for the share button inside the profile-settings screen.

Screen.Recording.2024-04-08.at.10.11.51.mov

After

Here's a video of the updated behaviour for the share button inside the profile-settings screen.

Screen.Recording.2024-04-08.at.10.11.12.mov

status: ready

@seanstrom seanstrom requested review from clauxx and ibrkhalil April 8, 2024 09:24
@seanstrom seanstrom self-assigned this Apr 8, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Apr 8, 2024

Jenkins Builds

Click to see older builds (47)
Commit #️⃣ Finished (UTC) Duration Platform Result
4d87f88 #1 2024-04-08 09:27:51 ~2 min tests 📄log
✔️ 4d87f88 #1 2024-04-08 09:32:14 ~7 min android-e2e 🤖apk 📲
✔️ 4d87f88 #1 2024-04-08 09:32:18 ~7 min android 🤖apk 📲
✔️ 4d87f88 #1 2024-04-08 09:36:48 ~11 min ios 📱ipa 📲
d4091b6 #2 2024-04-08 11:48:00 ~4 min tests 📄log
49f6d07 #3 2024-04-08 11:56:14 ~8 min tests 📄log
✔️ 49f6d07 #3 2024-04-08 12:00:27 ~12 min android-e2e 🤖apk 📲
✔️ 49f6d07 #3 2024-04-08 12:03:01 ~14 min android 🤖apk 📲
49f6d07 #3 2024-04-08 12:07:17 ~19 min ios 📄log
✔️ 06b8eee #5 2024-04-08 12:37:29 ~3 min tests 📄log
✔️ 06b8eee #5 2024-04-08 12:39:21 ~5 min android-e2e 🤖apk 📲
✔️ 06b8eee #5 2024-04-08 12:39:33 ~6 min android 🤖apk 📲
✔️ 06b8eee #5 2024-04-08 12:43:45 ~10 min ios 📱ipa 📲
✔️ 069513b #6 2024-04-08 13:34:20 ~4 min tests 📄log
✔️ 069513b #6 2024-04-08 13:36:55 ~7 min android 🤖apk 📲
✔️ 069513b #6 2024-04-08 13:37:15 ~7 min android-e2e 🤖apk 📲
✔️ 069513b #6 2024-04-08 13:42:06 ~12 min ios 📱ipa 📲
✔️ bee9a8f #7 2024-04-08 14:12:54 ~7 min tests 📄log
✔️ bee9a8f #7 2024-04-08 14:13:12 ~7 min android-e2e 🤖apk 📲
✔️ bee9a8f #7 2024-04-08 14:14:15 ~8 min android 🤖apk 📲
✔️ 1a731bf #8 2024-04-08 14:20:47 ~4 min tests 📄log
✔️ 86144f4 #9 2024-04-08 14:25:09 ~4 min tests 📄log
✔️ 86144f4 #9 2024-04-08 14:27:50 ~7 min android-e2e 🤖apk 📲
✔️ 86144f4 #9 2024-04-08 14:28:51 ~8 min android 🤖apk 📲
✔️ 355d795 #10 2024-04-08 14:34:04 ~4 min tests 📄log
✔️ 1a4dbda #11 2024-04-08 14:39:14 ~4 min tests 📄log
✔️ 1a4dbda #11 2024-04-08 14:41:10 ~6 min android-e2e 🤖apk 📲
✔️ 1a4dbda #11 2024-04-08 14:42:02 ~6 min android 🤖apk 📲
✔️ 3d337b4 #12 2024-04-08 14:53:57 ~4 min tests 📄log
✔️ 3d337b4 #12 2024-04-08 14:55:25 ~5 min android-e2e 🤖apk 📲
✔️ 3d337b4 #12 2024-04-08 14:56:50 ~7 min android 🤖apk 📲
✔️ 3d337b4 #12 2024-04-08 14:59:52 ~10 min ios 📱ipa 📲
✔️ c3d4c4c #13 2024-04-09 11:49:00 ~4 min tests 📄log
✔️ c3d4c4c #13 2024-04-09 11:51:51 ~7 min android-e2e 🤖apk 📲
✔️ c3d4c4c #13 2024-04-09 11:51:56 ~7 min android 🤖apk 📲
✔️ c3d4c4c #13 2024-04-09 12:04:20 ~19 min ios 📱ipa 📲
✔️ ef72d21 #14 2024-04-10 14:25:03 ~4 min tests 📄log
✔️ ef72d21 #14 2024-04-10 14:26:48 ~6 min android 🤖apk 📲
✔️ ef72d21 #14 2024-04-10 14:27:31 ~6 min android-e2e 🤖apk 📲
✔️ ef72d21 #14 2024-04-10 14:57:50 ~37 min ios 📱ipa 📲
✔️ d531aca #15 2024-04-12 17:57:45 ~4 min tests 📄log
✔️ d531aca #15 2024-04-12 17:59:13 ~5 min android-e2e 🤖apk 📲
✔️ d531aca #15 2024-04-12 18:00:28 ~6 min android 🤖apk 📲
✔️ d531aca #15 2024-04-12 18:04:07 ~10 min ios 📱ipa 📲
✔️ a4fab04 #16 2024-04-16 07:59:12 ~6 min android-e2e 🤖apk 📲
✔️ a4fab04 #16 2024-04-16 07:59:18 ~6 min android 🤖apk 📲
✔️ a4fab04 #16 2024-04-16 08:02:27 ~9 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 45d1e9e #17 2024-04-16 10:13:10 ~3 min tests 📄log
✔️ 45d1e9e #17 2024-04-16 10:16:10 ~6 min android-e2e 🤖apk 📲
✔️ 45d1e9e #17 2024-04-16 10:16:18 ~7 min android 🤖apk 📲
✔️ 45d1e9e #17 2024-04-16 10:21:26 ~12 min ios 📱ipa 📲
✔️ 28bee80 #18 2024-04-16 11:15:03 ~4 min tests 📄log
✔️ 28bee80 #18 2024-04-16 11:18:19 ~7 min android-e2e 🤖apk 📲
✔️ 28bee80 #18 2024-04-16 11:18:30 ~7 min android 🤖apk 📲
✔️ 28bee80 #18 2024-04-16 11:20:30 ~9 min ios 📱ipa 📲

@seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch 2 times, most recently from 48cef09 to 06b8eee Compare April 8, 2024 12:33
Copy link
Member Author

@seanstrom seanstrom left a comment

Choose a reason for hiding this comment

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

Added some self-review comments

src/react_native/core.cljs Show resolved Hide resolved
src/react_native/share.cljs Outdated Show resolved Hide resolved
src/status_im/common/lightbox/effects.cljs Outdated Show resolved Hide resolved
src/status_im/navigation/effects.cljs Outdated Show resolved Hide resolved
src/status_im/events.cljs Show resolved Hide resolved
@seanstrom seanstrom requested review from clauxx and J-Son89 April 8, 2024 12:45
@seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch from 069513b to bee9a8f Compare April 8, 2024 14:05
Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

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

Sorry for the hectic review

src/status_im/navigation/effects.cljs Outdated Show resolved Hide resolved
src/status_im/navigation/effects.cljs Outdated Show resolved Hide resolved
@seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch from 86144f4 to 355d795 Compare April 8, 2024 14:29
@seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch from 1a4dbda to 3d337b4 Compare April 8, 2024 14:49
@status-im-auto
Copy link
Member

88% of end-end tests have passed

Total executed tests: 52
Failed tests: 5
Expected to fail tests: 1
Passed tests: 46
IDs of failed tests: 704613,702783,703297,703202,702775 
IDs of expected to fail tests: 703503 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_send_image_save_and_share, id: 703297

    Device 3: Find `ChatsTab` by `accessibility id`: `chats-stack-tab`
    Device 3: Tap on found: ChatsTab

    critical/chats/test_group_chat.py:283: in test_group_chat_send_image_save_and_share
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Not expected image is shown to the admin.
    E    Not expected image is shown to the member_2.
    



    Device sessions

    2. test_group_chat_reactions, id: 703202

    Device 1: Find Button by accessibility id: authors-for-reaction-5
    Device 1: Tap on found: Button

    critical/chats/test_group_chat.py:211: in test_group_chat_reactions
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Incorrect reactions count for user admin after changing the reactions
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    Device 2: Find Text by xpath: //*[starts-with(@text,'test message')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_1_1_public_chats.py:614: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not changed to Delivered, it's Sent after back up online!
    



    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613

    Device 1: Find Button by xpath: //*[@text="open community"]
    Device 1: Tap on found: Button

    critical/test_deep_and_universal_links.py:69: in test_links_open_universal_links_from_chat
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Community 'Closed communtiy for e2e' was not requested to join by the url https://status.app/c/G0UAAGS9MeHbo_RoNMnOhOKTCo-fDDbgBCCyNNSN7qrzTqIgLem56TyzYYLf36askV7yGcros8muAdgB#zQ3shVWCcsH94vjf7WrFqBXx5MMAui2EPYMBme8ntACNWWVN3
    



    Device sessions

    2. test_links_deep_links, id: 702775

    Device 1: Find BrowserTab by accessibility id: browser-stack-tab
    Device 1: Tap on found: BrowserTab

    critical/test_deep_and_universal_links.py:112: in test_links_deep_links
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Community 'Closed communtiy for e2e' was not requested to join by the deep link status.app://c/G0UAAGS9MeHbo_RoNMnOhOKTCo-fDDbgBCCyNNSN7qrzTqIgLem56TyzYYLf36askV7yGcros8muAdgB#zQ3shVWCcsH94vjf7WrFqBXx5MMAui2EPYMBme8ntACNWWVN3
    



    Device sessions

    Expected to fail tests (1)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Passed tests (46)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_mute_chat, id: 703495
    Device sessions

    3. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    4. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    4. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    5. test_1_1_chat_edit_message, id: 702855
    Device sessions

    6. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    7. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    8. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    Device sessions

    2. test_wallet_send_eth, id: 727229
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    3. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    5. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    6. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    2. test_wallet_add_remove_watch_only_account, id: 727232
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    @seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch from 3d337b4 to c3d4c4c Compare April 9, 2024 11:44
    @VolodLytvynenko VolodLytvynenko self-assigned this Apr 10, 2024
    @status-im-auto
    Copy link
    Member

    40% of end-end tests have passed

    Total executed tests: 5
    Failed tests: 3
    Expected to fail tests: 0
    Passed tests: 2
    
    IDs of failed tests: 702775,704613,702783 
    

    Failed tests (3)

    Click to expand
  • Rerun failed tests

  • Class TestDeepLinksOneDevice:

    1. test_links_deep_links, id: 702775

    Device 1: Find `BrowserTab` by `accessibility id`: `browser-stack-tab`
    Device 1: Tap on found: BrowserTab

    critical/test_deep_and_universal_links.py:112: in test_links_deep_links
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Community 'closed community' was not requested to join by the deep link status.app://c/G00AAGS9TbI9mSR-ZNmFrhRjNuEeXAAbcAIUaLLJyjMOG3ACJQ12oIHD78QhzO9s_T5bUeU7rnATWJg3mGgTUemrAg==#zQ3shspPKCZ1VPVQ9dLXGufUGvGphjxVwrcZ6rkZc7S39T4b3
    



    Device sessions

    2. test_links_open_universal_links_from_chat, id: 704613

    Device 1: Find Button by xpath: //*[@text="open community"]
    Device 1: Tap on found: Button

    critical/test_deep_and_universal_links.py:69: in test_links_open_universal_links_from_chat
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Community 'closed community' was not requested to join by the url https://status.app/c/G00AAGS9TbI9mSR-ZNmFrhRjNuEeXAAbcAIUaLLJyjMOG3ACJQ12oIHD78QhzO9s_T5bUeU7rnATWJg3mGgTUemrAg==#zQ3shspPKCZ1VPVQ9dLXGufUGvGphjxVwrcZ6rkZc7S39T4b3
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    Device 2: Find Text by xpath: //*[starts-with(@text,'test message')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_1_1_public_chats.py:614: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not changed to Delivered, it's Sent after back up online!
    



    Device sessions

    Passed tests (2)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Apr 10, 2024

    Hi @seanstrom, here's an issue that I'm not sure is related to the scope of this PR. Please let me know if it will be addressed in the current PR, otherwise, can be fixed in a separate follow-up.

    PR_ISSUE 1: Wrong text is shown system device share drawer while sharing own profile

    Steps:

    1. Go your profile
    2. Tap 'share'

    Actual result:

    'Connect with new share button' text is shown in the share device's system drawer
    image

    Expected result:

    "My profile on Status" text is shown
    image

    https://www.figma.com/file/PiN0uwRgZj4L9U4N7xO7Xb/Profile-for-Mobile?type=design&node-id=3802-259522&mode=design&t=bER4ncK0x1ysPefS-0

    OS:

    • IOS

    Devices:

    • iPhone 11 Pro Max, IOS 17

    @seanstrom
    Copy link
    Member Author

    @VolodLytvynenko I think we can fix that issue in a separate PR, thanks for finding it! 🙏

    @seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch from c3d4c4c to ef72d21 Compare April 10, 2024 14:20
    @seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch 3 times, most recently from a4fab04 to 45d1e9e Compare April 16, 2024 10:08
    @seanstrom seanstrom force-pushed the seanstrom/implement-share-button-inside-profile-settings branch from 45d1e9e to 28bee80 Compare April 16, 2024 11:10
    @seanstrom seanstrom merged commit 61974da into develop Apr 16, 2024
    6 checks passed
    @seanstrom seanstrom deleted the seanstrom/implement-share-button-inside-profile-settings branch April 16, 2024 11:26
    ibrkhalil pushed a commit that referenced this pull request Apr 16, 2024
    * tweak: implement the share button inside the profile settings page
    
    * chore: define event and effect handler for opening share sheet
    
    * tidy: refactor share buttons to use open-share event
    
    * tidy: refactor open-share effect to use react-native-share bindings
    
    * tidy: remove unused code for old bindings to react share sheet
    
    * tidy: move effects.share/open definition to navigation effects
    
    * tweak: ensure navigation effects are loaded
    
    * tidy: use open-share dispatch in ui
    
    * tidy: use open-share dispatch instead of calling open function directly
    
    * tidy: refactor react-native.share/open to only receive options and return promise
    
    * tidy: refactor open-share effect to receive map of content and handlers
    
    * tidy: replace strings with keywords
    
    * tweak: always handle failure case when opening share-sheet
    
    * tweak: rename :content to :options
    
    * fix: conditionally call on-error
    
    * tweak: add extra information when logging error from attempting to share-sheet
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Add the share functionality to the Profile share button
    6 participants