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

New mentions design #15799

Merged
merged 7 commits into from
May 4, 2023
Merged

New mentions design #15799

merged 7 commits into from
May 4, 2023

Conversation

OmarBasem
Copy link
Contributor

@OmarBasem OmarBasem commented May 3, 2023

fixes: #15331

This PR implements mentions new UI design for the new composer.

Note: the new composer is still a work in progress and is still disabled on develop. Sill one more issue to go: #15747

@OmarBasem OmarBasem self-assigned this May 3, 2023
@status-im-auto
Copy link
Member

status-im-auto commented May 3, 2023

Jenkins Builds

Click to see older builds (12)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ b29b479 #1 2023-05-03 10:15:04 ~5 min android-e2e 🤖apk 📲
✔️ b29b479 #1 2023-05-03 10:16:16 ~6 min tests 📄log
✔️ b29b479 #1 2023-05-03 10:16:22 ~6 min android 🤖apk 📲
✔️ b29b479 #1 2023-05-03 10:16:29 ~6 min ios 📱ipa 📲
✔️ 1456e39 #2 2023-05-03 11:08:46 ~6 min android 🤖apk 📲
✔️ 1456e39 #2 2023-05-03 11:08:50 ~6 min android-e2e 🤖apk 📲
✔️ 1456e39 #2 2023-05-03 11:09:32 ~7 min ios 📱ipa 📲
✔️ 1456e39 #2 2023-05-03 11:12:10 ~9 min tests 📄log
78ad0e5 #3 2023-05-03 14:13:48 ~5 min tests 📄log
✔️ 78ad0e5 #3 2023-05-03 14:14:51 ~6 min ios 📱ipa 📲
✔️ 78ad0e5 #3 2023-05-03 14:15:05 ~7 min android-e2e 🤖apk 📲
✔️ 78ad0e5 #3 2023-05-03 14:16:12 ~8 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4e5ad86 #4 2023-05-03 14:23:18 ~5 min android-e2e 🤖apk 📲
✔️ 4e5ad86 #4 2023-05-03 14:23:50 ~6 min android 🤖apk 📲
✔️ 4e5ad86 #4 2023-05-03 14:25:23 ~7 min ios 📱ipa 📲
✔️ 4e5ad86 #4 2023-05-03 14:25:52 ~8 min tests 📄log
✔️ eb16f4b #6 2023-05-04 05:24:23 ~5 min tests 📄log
✔️ eb16f4b #6 2023-05-04 05:24:54 ~6 min android-e2e 🤖apk 📲
✔️ eb16f4b #6 2023-05-04 05:24:58 ~6 min android 🤖apk 📲
✔️ eb16f4b #6 2023-05-04 05:25:08 ~6 min ios 📱ipa 📲

@OmarBasem OmarBasem requested review from J-Son89 and ajayesivan May 3, 2023 10:17
@OmarBasem OmarBasem requested a review from ilmotta May 3, 2023 14:20
Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

Thanks @OmarBasem, this is my last round of review here. LGTM

For future iterations, it would be good to optimize the way mentions are being processed and rendered.

  1. Every pressed key causes all the mention logic to be triggered (including events). The text input is being parsed too frequently by status-go, and this causes a considerable overhead in the rendering pipeline. Enable the debug logs to see. This existed before your PR, so I'm just sharing if you didn't know. This is VERY expensive. We should protect high frequency events with something similar to utils.debouce/debounce-and-dispatch. You might be interested in this @qfrank, it's quite sensible to fix.
  2. The mention items on the FlatList at the top of the chat are being re-rendered on every key press after @, even though they didn't change (from the user's perspective).
  3. This one I mentioned in another thread in this PR, but we're double-rendering f-view on every key press due to the duplicated state suggestions-atom. Maybe there's a way to fix this while still retaining the animation behavior, but I have no practical solution to share.
  4. The mention suggestions position is being recalculated on every key press after @, even though it's position is the same. We should memoize the calculation. Again another good reason to keep these kinds of functions pure, since memoization is only reliable on pure functions.

So I'd say it's worth in another PR to attack these problems because we need the chat input to be as smooth as we can make it.


(defn view
[props state animations max-height cursor-pos]
(let [suggestions-atom (reagent/atom {})]
Copy link
Contributor

Choose a reason for hiding this comment

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

This atom doesn't need to live here, since it's only used by f-view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moving it to f-view causes the suggestions list not to appear when typing '@'

OmarBasem added 6 commits May 4, 2023 09:16
review

lint

review

udpates

updates

updates

udpates

updates

updates

lint

updates

composer shell button

updates

updates

updates

updates

updates

updates

updates

updates

updates

updates

updates

updates

updates
@OmarBasem OmarBasem force-pushed the new-mentions-design branch from 4e5ad86 to 9268060 Compare May 4, 2023 05:17
@pavloburykh pavloburykh self-assigned this May 4, 2023
@OmarBasem
Copy link
Contributor Author

@pavloburykh as I informed you yesterday we will do testing on the final PR. I need to merge this one now for dependency.

@pavloburykh
Copy link
Contributor

@pavloburykh as I informed you yesterday we will do testing on the final PR. I need to merge this one now for dependency.

@OmarBasem yeah, I remember. But I see that e2e has not been automatically triggered for this PR so I have launched e2e run manually.

@OmarBasem
Copy link
Contributor Author

@pavloburykh Oh okay, I will wait for e2e

@pavloburykh
Copy link
Contributor

@pavloburykh Oh okay, I will wait for e2e

I will let you know once e2e run is finished

@OmarBasem
Copy link
Contributor Author

OmarBasem commented May 4, 2023

For future iterations, it would be good to optimize the way mentions are being processed and rendered.

Thanks @ilmotta for your review. I will consider further performance optimizations for another PR.

@status-im-auto
Copy link
Member

83% of end-end tests have passed

Total executed tests: 30
Failed tests: 5
Passed tests: 25
IDs of failed tests: 702958,702786,702894,702957,702838 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_mentions_push_notification, id: 702786

    # STEP: Admin gets push notification with the mention and tap it
    Device 1: Getting PN by 'user_1'

    critical/test_public_chat_browsing.py:713: in test_community_mentions_push_notification
        self.errors.verify_no_errors()
    base_test_case.py:184: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification with the mention was not received by admin
    



    Device sessions

    2. test_community_contact_block_unblock_offline, id: 702894

    Device 1: Looking for a message by text: Hurray! unblocked
    Device 1: Find ChatElementByText by xpath: //*[starts-with(@text,'Hurray! unblocked')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']

    critical/test_public_chat_browsing.py:611: in test_community_contact_block_unblock_offline
        chat_element.find_element()
    ../views/chat_view.py:134: in find_element
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatElementByText by xpath:`//*[starts-with(@text,'Hurray! unblocked')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    3. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Verifying that 'hello' is under today
    Device 2: Looking for a message by text: hello

    critical/test_public_chat_browsing.py:410: in test_community_message_send_check_timestamps_sender_username
        channel.verify_message_is_under_today_text(message, self.errors)
    ../views/chat_view.py:927: in verify_message_is_under_today_text
        message_element.wait_for_visibility_of_element()
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element 
    

    [[blocked by 14797]]

    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958

    Device 2: Clearing history in chat 'user1' by long press
    Device 2: Looking for chat: 'user1'

    medium/test_activity_center.py:290: in test_activity_center_admin_notification_accept_swipe
        self.home_2.clear_chat_long_press(self.username_1)
    ../views/home_view.py:444: in clear_chat_long_press
        self.get_chat(username).long_press_element()
    ../views/base_element.py:292: in long_press_element
        element = self.find_element()
    ../views/home_view.py:64: in find_element
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElement by xpath:`//*[@content-desc='chat-name-text'][starts-with(@text,'user1')]/..` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    2. test_activity_center_mentions, id: 702957

    Device 2: Type @ to ChatMessageInput
    Device 2: Find SendMessageButton by accessibility id: send-message-button

    medium/test_activity_center.py:259: in test_activity_center_mentions
        self.channel_2.send_message_button.click()
    ../views/base_element.py:91: in click
        self.find_element().click()
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 2: SendMessageButton by accessibility id: `send-message-button` is not found on the screen
    



    Device sessions

    Passed tests (25)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    2. test_1_1_chat_edit_message, id: 702855
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    5. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    6. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    7. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    8. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    9. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    3. test_community_leave, id: 702845
    Device sessions

    4. test_community_unread_messages_badge, id: 702841
    Device sessions

    5. test_community_message_delete, id: 702839
    Device sessions

    6. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    7. test_community_message_edit, id: 702843
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    @OmarBasem e2e run has finished. I believe failed e2e are related to the new composer changes. We will address those issues in the final PR as discussed.

    One question: is this expected that mention list in current PR does not correspond to new mentions design?

    Actual result:

    photo_2023-05-04 12 07 08

    Expected result:

    https://www.figma.com/file/wA8Epdki2OWa8Vr067PCNQ/Composer-for-Mobile?node-id=2706-263349&t=fhHFSqIw6nRFMboK-0

    Composer for Mobile – Figma 2023-05-04 12-08-18

    @OmarBasem OmarBasem merged commit 7e54aa0 into develop May 4, 2023
    @OmarBasem OmarBasem deleted the new-mentions-design branch May 4, 2023 09:12
    @OmarBasem
    Copy link
    Contributor Author

    OmarBasem commented May 4, 2023

    @pavloburykh that's from the old composer. The new design is implemented but still disabled.

    Feel free to log any issues from e2e here: #15747

    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.

    Mentions new design
    6 participants