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

Highlight mentions in chat input #16330

Closed
wants to merge 12 commits into from
Closed

Highlight mentions in chat input #16330

wants to merge 12 commits into from

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Jun 20, 2023

fixes #16097

Summary

Highlight mentions in user input

Screenshot 2023-06-20 at 14 08 12

Reviewer notes

If you have any idea on how to overcome the issue described in the next section, please tell me.
I also tried to implement similar mentions in the test react-native app and the similar bug is there, but barely noticeable because the basic test app is much faster.
It is not a bug in status-go mentions implementation, because we are getting correct structure from there.
And it is not a bug in generated children Text components, they are also correct.
So I believe it is a react-native bug.

Testing notes

There is a known issue, steps to reproduce:

  • enter some mention
  • remove whitespace after mention, put the coma
  • start quick typing

Result: all typed characters get the style of the mention for a fraction of a second. If you remove some characters and start typing again - the effect disappears. On the physical iPhone 13 this is barely visible. On the Android simulator, it is very visible (but it is generally terribly slow)

Video:

Screen.Recording.2023-06-23.at.13.19.45.mov

I'm not sure how critical the issue is on physical Android.

status: ready

@vkjr vkjr self-assigned this Jun 20, 2023
@status-im-auto
Copy link
Member

status-im-auto commented Jun 20, 2023

Jenkins Builds

Click to see older builds (69)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8f4ed5b #1 2023-06-20 13:16:13 ~6 min android-e2e 🤖apk 📲
8f4ed5b #1 2023-06-20 13:16:20 ~6 min ios 📄log
✔️ 8f4ed5b #1 2023-06-20 13:17:07 ~6 min android 🤖apk 📲
✔️ 8f4ed5b #1 2023-06-20 13:17:59 ~7 min tests 📄log
8f4ed5b #2 2023-06-20 13:26:31 ~2 min ios 📄log
✔️ b6ca94a #2 2023-06-20 13:55:03 ~5 min android-e2e 🤖apk 📲
✔️ b6ca94a #3 2023-06-20 13:56:21 ~7 min ios 📱ipa 📲
✔️ b6ca94a #2 2023-06-20 13:56:41 ~7 min android 🤖apk 📲
✔️ b6ca94a #2 2023-06-20 14:00:29 ~11 min tests 📄log
aad65bb #3 2023-06-20 14:17:03 ~7 min tests 📄log
✔️ aad65bb #4 2023-06-20 14:17:33 ~7 min ios 📱ipa 📲
✔️ aad65bb #3 2023-06-20 14:17:54 ~8 min android 🤖apk 📲
✔️ aad65bb #3 2023-06-20 14:19:25 ~9 min android-e2e 🤖apk 📲
✔️ 007a9fd #5 2023-06-20 15:13:05 ~5 min ios 📱ipa 📲
✔️ 007a9fd #4 2023-06-20 15:13:12 ~5 min android-e2e 🤖apk 📲
✔️ 007a9fd #4 2023-06-20 15:14:15 ~6 min android 🤖apk 📲
✔️ 007a9fd #4 2023-06-20 15:19:02 ~11 min tests 📄log
✔️ 93b334a #5 2023-06-23 12:14:49 ~6 min android-e2e 🤖apk 📲
✔️ 93b334a #5 2023-06-23 12:15:12 ~6 min android 🤖apk 📲
✔️ 93b334a #6 2023-06-23 12:16:19 ~7 min ios 📱ipa 📲
✔️ 93b334a #5 2023-06-23 12:18:27 ~9 min tests 📄log
✔️ cd47b59 #7 2023-06-26 13:47:24 ~6 min ios 📱ipa 📲
✔️ cd47b59 #6 2023-06-26 13:50:07 ~9 min android-e2e 🤖apk 📲
✔️ cd47b59 #6 2023-06-26 13:50:55 ~9 min android 🤖apk 📲
✔️ cd47b59 #6 2023-06-26 13:53:20 ~12 min tests 📄log
✔️ 3d31249 #8 2023-06-27 11:04:36 ~5 min ios 📱ipa 📲
✔️ 3d31249 #7 2023-06-27 11:04:51 ~5 min android-e2e 🤖apk 📲
✔️ 3d31249 #7 2023-06-27 11:06:39 ~7 min android 🤖apk 📲
✔️ 3d31249 #7 2023-06-27 11:07:23 ~8 min tests 📄log
✔️ be357b8 #9 2023-06-28 10:17:55 ~6 min ios 📱ipa 📲
✔️ be357b8 #8 2023-06-28 10:18:33 ~6 min android 🤖apk 📲
✔️ be357b8 #8 2023-06-28 10:18:45 ~7 min android-e2e 🤖apk 📲
✔️ be357b8 #8 2023-06-28 10:19:10 ~7 min tests 📄log
✔️ 88bf489 #10 2023-07-06 16:31:31 ~5 min ios 📱ipa 📲
✔️ 88bf489 #9 2023-07-06 16:32:33 ~6 min android-e2e 🤖apk 📲
✔️ 88bf489 #9 2023-07-06 16:33:03 ~7 min android 🤖apk 📲
✔️ 88bf489 #9 2023-07-06 16:34:34 ~8 min tests 📄log
✔️ 4f1e868 #11 2023-07-10 13:36:09 ~5 min ios 📱ipa 📲
✔️ 4f1e868 #10 2023-07-10 13:36:15 ~5 min android-e2e 🤖apk 📲
✔️ 4f1e868 #10 2023-07-10 13:36:17 ~5 min android 🤖apk 📲
✔️ 4f1e868 #10 2023-07-10 13:38:34 ~8 min tests 📄log
5d3f44d #12 2023-07-17 12:14:31 ~4 min tests 📄log
✔️ 5d3f44d #12 2023-07-17 12:18:33 ~8 min android-e2e 🤖apk 📲
✔️ 5d3f44d #13 2023-07-17 12:18:35 ~8 min ios 📱ipa 📲
✔️ 5d3f44d #12 2023-07-17 12:18:35 ~8 min android 🤖apk 📲
✔️ e46e4d8 #14 2023-07-17 12:28:28 ~7 min ios 📱ipa 📲
✔️ e46e4d8 #13 2023-07-17 12:28:37 ~7 min android 🤖apk 📲
✔️ e46e4d8 #13 2023-07-17 12:28:40 ~7 min tests 📄log
✔️ e46e4d8 #13 2023-07-17 12:28:40 ~7 min android-e2e 🤖apk 📲
✔️ c34288f #15 2023-07-20 09:02:40 ~7 min android-e2e 🤖apk 📲
✔️ c34288f #15 2023-07-20 09:03:45 ~8 min tests 📄log
✔️ c34288f #15 2023-07-20 09:04:07 ~9 min android 🤖apk 📲
✔️ c34288f #16 2023-07-20 09:05:02 ~10 min ios 📱ipa 📲
f9ce986 #16 2023-07-24 15:46:32 ~4 min tests 📄log
✔️ f9ce986 #16 2023-07-24 15:47:41 ~5 min android 🤖apk 📲
✔️ f9ce986 #16 2023-07-24 15:50:23 ~8 min android-e2e 🤖apk 📲
✔️ f9ce986 #17 2023-07-24 15:50:48 ~8 min ios 📱ipa 📲
✔️ 9fa23c9 #17 2023-07-24 16:49:04 ~6 min android-e2e 🤖apk 📲
✔️ 9fa23c9 #17 2023-07-24 16:49:06 ~6 min android 🤖apk 📲
✔️ 9fa23c9 #18 2023-07-24 16:49:33 ~6 min ios 📱ipa 📲
✔️ 9fa23c9 #17 2023-07-24 16:50:57 ~8 min tests 📄log
cad3215 #18 2023-07-25 15:39:34 ~2 min tests 📄log
cad3215 #18 2023-07-25 15:40:07 ~2 min android 📄log
cad3215 #18 2023-07-25 15:40:14 ~3 min android-e2e 📄log
cad3215 #19 2023-07-25 15:40:43 ~3 min ios 📄log
✔️ cc10044 #19 2023-07-26 09:49:43 ~8 min android-e2e 🤖apk 📲
✔️ cc10044 #19 2023-07-26 09:49:47 ~8 min android 🤖apk 📲
✔️ cc10044 #20 2023-07-26 09:50:06 ~8 min ios 📱ipa 📲
✔️ cc10044 #19 2023-07-26 09:51:17 ~9 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 2a1d0d9 #20 2023-07-26 12:46:36 ~9 min android-e2e 🤖apk 📲
✔️ 2a1d0d9 #20 2023-07-26 12:47:55 ~10 min tests 📄log
✔️ 2a1d0d9 #20 2023-07-26 12:48:42 ~11 min android 🤖apk 📲
✔️ 2a1d0d9 #21 2023-07-26 12:51:39 ~14 min ios 📱ipa 📲
✔️ aac9067 #22 2023-07-28 11:07:54 ~8 min ios 📱ipa 📲
✔️ aac9067 #21 2023-07-28 11:07:55 ~8 min android-e2e 🤖apk 📲
✔️ aac9067 #21 2023-07-28 11:07:55 ~8 min android 🤖apk 📲
✔️ aac9067 #21 2023-07-28 11:08:16 ~9 min tests 📄log

[input-with-mentions]
(reduce (fn
[styled-text [chunk-type chunk-content]]
(cond
Copy link
Member

Choose a reason for hiding this comment

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

(condp = chunk-type
   :text  (conj..
   :mention (conj ...)

Avoids case as it's not safe and it's a bit more compact than just cond

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@vkjr vkjr changed the title Highlight mentions in chat input [WIP] Highlight mentions in chat input Jun 20, 2023
input-text)}})))
300)))
[(some #(= :mention (first %)) (seq input-with-mentions))]))
#_(defn edit-mentions
Copy link
Member

Choose a reason for hiding this comment

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

probably you should include a TODO here with a link for the issue to restore this functionality 👍

[quo2.theme :as theme]))
[quo2.theme :as theme]
[quo2.core :as quo]))

Copy link
Member

Choose a reason for hiding this comment

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

extra new line

(effects/update-input-mention props state subs)
(effects/edit-mentions props state subs)
(effects/update-input-mention state subs)
#_(effects/edit-mentions props state subs)
Copy link
Member

Choose a reason for hiding this comment

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

maybe same TODO here?

Copy link
Contributor Author

@vkjr vkjr Jun 22, 2023

Choose a reason for hiding this comment

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

@J-Son89, it is "wip" PR, created for the sake of getting ios builds for device) Don't need a review yet, since it is not a final version, there is still a bug that I'm trying to solve) All code pieces that are not needed will be removed of course, not commented)

Copy link
Member

Choose a reason for hiding this comment

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

Apologies, I missed that. Please ignore my comments so 😅

@vkjr vkjr changed the title [WIP] Highlight mentions in chat input Highlight mentions in chat input Jun 23, 2023
Copy link
Member

@J-Son89 J-Son89 left a comment

Choose a reason for hiding this comment

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

nice @vkjr!

Comment on lines -136 to +127
(if (string/ends-with? text "@")
(rf/dispatch [:mention/on-change-text text])
(debounce/debounce-and-dispatch [:mention/on-change-text text] 300)))
(rf/dispatch [:mention/on-change-text text]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? I think this is to avoid many calls to status-go for mentions cc @qfrank

Copy link
Contributor

Choose a reason for hiding this comment

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

Also would like to know why 🙂

Copy link
Contributor Author

@vkjr vkjr Jun 27, 2023

Choose a reason for hiding this comment

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

@OmarBasem, @qfrank, two things:

  1. we need to get updated text structure from status-go as quick as possible, because while it is not updated, highlighting is not applied

  2. With previous logic I experienced a bug. Imagine that user is going to type "hello @". The order of event is:

  • user types "hello"
  • user types whitespace after "hello", on-change-text scheduled with delay and with content "hello "
  • user types "@", on-change-text immediately processed and current text input becomes "hello @"
  • scheduled on-change-text processed with delay and current text get backs to the "hello ", which results in losing the "@"

Copy link
Contributor

@qfrank qfrank Jun 27, 2023

Choose a reason for hiding this comment

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

emm.. what if we enhance debounce/debounce-and-dispatch to make it support dispatch immediately if user input end with @ ? @vkjr

Copy link
Contributor Author

@vkjr vkjr Jun 27, 2023

Choose a reason for hiding this comment

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

@qfrank, I think debounce-and-dispatch is too general to make this change, because it works not only with on-change-text, but even if we add this hack, that won't eliminate the problem with slow highlight updating.
Imagine that user typed @asd and continued quick typing. All the symbols after "@" won't be highlighted because while user quickly types, events not sent and updated text structure is not received from status-go

Copy link
Contributor

@qfrank qfrank Jun 27, 2023

Choose a reason for hiding this comment

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

yeah, quick typing would make weired behavior. 😅

debounce-and-dispatch is too general

what if make a new function like debounce-and-dispatch and add an extra trigger condition to the actual invoking e.g. the number of user input characters reached a specific value. just my thoughts , it's up to you, if we found performance issue with mention, there still exist spaces to improve in status-go side 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qfrank, I think right now it is more a preliminary optimization) Let's see if there are any issues with existing implementation and then start improving, wdyt? I'm currently more concerned about that bug with highlighting that is in the description. I believe it can be a showstopper on slow devices :-/

Copy link
Contributor

Choose a reason for hiding this comment

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

agree

@status-im-auto
Copy link
Member

79% of end-end tests have passed

Total executed tests: 33
Failed tests: 7
Passed tests: 26
IDs of failed tests: 702783,702958,702732,702894,702731,702745,703133 

Failed tests (7)

Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    Device 1: Tap on found: ProfileSendMessageButton
    Device 1: Find `Text` by `xpath`: `//*[@content-desc='user-avatar']/../following-sibling::android.widget.TextView`

    critical/test_public_chat_browsing.py:391: in test_restore_multiaccount_with_waku_backup_remove_switch
        shown_name_text = chat.user_name_text_new_UI.text
    ../views/base_element.py:391: in text
        text = self.find_element().text
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 1: Text by xpath: `//*[@content-desc='user-avatar']/../following-sibling::android.widget.TextView` is not found on the screen
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. 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:783: 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

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958

    Device 1: Looking for activity center element: 'user2'
    Device 1: Find Button by xpath: //*[contains(@text, 'user2')]/ancestor::*[@content-desc='activity']//*[@content-desc="activity-title"]

    medium/test_activity_center.py:331: in test_activity_center_admin_notification_accept_swipe
        if reply_element.title.text != 'Join request':
    ../views/base_element.py:209: in text
        return self.find_element().text
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[contains(@text, 'user2')]/ancestor::*[@content-desc='activity']//*[@content-desc="activity-title"]` is not found on the screen
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    # STEP: Device1 goes back online and checks that 1-1 chat will be fetched
    Device 1: Looking for a message by text: test message

    critical/chats/test_1_1_public_chats.py:1252: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:182: 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 Sending after back up online! 
    

    [[Issue with messages not being sent for a long time]]

    Device sessions

    2. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Find MemberPhoto by xpath: //*[starts-with(@text,'profile_photo')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='user-avatar']
    Device 2: Image differs from template to 5.542638442095589 percents

    critical/chats/test_1_1_public_chats.py:1076: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Image of user in 1-1 chat is too different from template!
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Passed tests (26)

    Click to expand

    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

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    2. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    3. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    4. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    5. test_community_message_edit, id: 702843
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_unread_messages_badge, id: 702841
    Device sessions

    8. test_community_mentions_push_notification, id: 702786
    Device sessions

    9. test_community_one_image_send_reply, id: 702859
    Device sessions

    10. test_community_several_images_send_reply, id: 703194
    Device sessions

    11. test_community_leave, id: 702845
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    3. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    4. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    5. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    6. test_1_1_chat_edit_message, id: 702855
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    2. test_group_chat_offline_pn, id: 702808
    Device sessions

    @pavloburykh pavloburykh self-assigned this Jun 28, 2023
    @pavloburykh
    Copy link
    Contributor

    @vkjr hi! Could you please clarify if recent commits is just rebasing or some additional changes? Asking case currently I am testing builds from 2023-06-27. As there is IOS blocker in develop I will not be able to test recent rebased PR build as it it will contain this bug.

    @vkjr
    Copy link
    Contributor Author

    vkjr commented Jun 28, 2023

    @pavloburykh, there is no additional functionality, I just rebased to the latest develop before figuring out there is a blocker :-/ Testing yesterday's build is fine, no changes since then)

    @pavloburykh
    Copy link
    Contributor

    @pavloburykh, there is no additional functionality, I just rebased to the latest develop before figuring out there is a blocker :-/ Testing yesterday's build is fine, no changes since then)

    Thank you @vkjr !

    @qfrank
    Copy link
    Contributor

    qfrank commented Jul 26, 2023

    update: just merged one small PR into this PR, can you help check if the typing experience becomes better? cc @qoqobolo thank you

    @qoqobolo
    Copy link
    Contributor

    update: just merged one small PR into this PR, can you help check if the typing experience becomes better? cc @qoqobolo thank you

    @qfrank Just checked the latest build 2a1d0d9 and can say that the typing experience definitely got better, thank you.

    But there are two new issues:

    ISSUE 4: No mentions suggested when typing @

    Steps:

    1. Open chat/community channel
    2. Type @

    Actual result: no suggestions
    Screenshot 2023-07-26 at 19 41 14

    ISSUE 5: Text stays in composer after the message is sent

    Steps:

    1. Open chat/community channel
    2. Type some text
    3. Hit Send
    video_2023-07-26_19-44-49.mp4

    @churik
    Copy link
    Member

    churik commented Jul 27, 2023

    @Francesca-G can we get a design opinion on the necessity of this feature?

    @pedro-et
    Copy link

    Text cant stay in composer after being sent.

    @churik
    Copy link
    Member

    churik commented Jul 27, 2023

    @pedro-et I'm asking about #16330 (comment) :)

    @qfrank
    Copy link
    Contributor

    qfrank commented Jul 27, 2023

    thank you for your feedback @qoqobolo , issue 4-5 can be easily resolved, but i found something new, i'll push the fix later cc @vkjr

    @churik
    Copy link
    Member

    churik commented Jul 28, 2023

    @qfrank @vkjr

    Here is the context

    My apologies for postponing the feature, taking into amount all the bugs and regression, I'd descope it for now.
    сс @cammellos

    @churik churik added the blocked label Jul 28, 2023
    @vkjr
    Copy link
    Contributor Author

    vkjr commented Jul 28, 2023

    @churik, thank you for bringing up the discussion with design team!
    I think we anyway need to get back to it and solve all related issues, because, as far as I understand, in future we want to have different stylings in text edit field (like making text bold). So this PR is a ground for similar future changes)

    @qfrank
    Copy link
    Contributor

    qfrank commented Jul 28, 2023

    issue 4-5 should be resolved also the chance of cursor jump should be fair low now, but let's stop here ATM and maybe get back to it and continue in some time in the future :)

    @J-Son89
    Copy link
    Member

    J-Son89 commented Jul 28, 2023

    @churik, thank you for bringing up the discussion with design team! I think we anyway need to get back to it and solve all related issues, because, as far as I understand, in future we want to have different stylings in text edit field (like making text bold). So this PR is a ground for similar future changes)

    @vkjr, @churik - if the issue is to what you described just now, that we want to be able to handle multiple stylings - perhaps a way to go about this is to instead just work on this component in isolation as it is in the design system.
    https://www.figma.com/file/WQZcp6S0EnzxdTL4taoKDv/Design-System-for-Mobile?type=design&node-id=3271-65639&mode=design&t=vvVr4Fa8c3f7jqmh-4 (although no bold text here - perhaps need to be updated to include this example too?)

    Currently almost none of the design system components related to messaging are in our quo2 component library (I believe there was some initial confusion about how to make these components separate to our state management system and that's why it was not done this way - this should be easy to do ).
    Maybe we can correctly add this component to the design system and implement the styling etc correctly so that it will be (hopefully) straightforward then to hook this up when the chat is in a stable state to add in this feature?

    (def mention
    {:color (colors/theme-colors colors/primary-50
    colors/primary-60)
    :background-color colors/primary-50-opa-10
    Copy link
    Member

    Choose a reason for hiding this comment

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

    I think this color might be wrong - it should be based on the chat color or the users custom color?
    Screenshot 2023-07-28 at 12 13 29

    @flexsurfer flexsurfer closed this Aug 24, 2023
    @John-44
    Copy link

    John-44 commented Aug 24, 2023

    @vkjr there is an issue that disrupts the input order in the composer completely, which can be fixed only with the app reopening (please, wait for designers to reply to the questions below before proceeding with fixing)

    ISSUE 3: cutting the part of mention leads to autocomplete of the composer with an unrelated value

    Steps:

    1. open 1-1 chat, start typing
    2. type @, select the user
    3. select part of mention, tap on Cut, and continue to type

    Expected result: can continue

    Actual result:

    FILE.2023-07-25.14.27.29.mp4
    OS: Android 13 (Google Pixel 7)

    @Francesca-G

    I'm contemplating several issues that already have been mentioned:

    1. PR still does not implement the feature according to design, so there is still @ in the input field in the front of each mention
    2. As mentioned here it added more complexity to the message input field and therefore may affect performance.
    3. it is a source of bugs like ISSUE3 (see above) and frankly if I put on the scale the weight of real benefit from this feature and potential risks it may cause, I'd prefer to live without it.
      WDYT?

    @vkjr @J-Son89 my apologies, I know that it is not the right timing to push back on the feature, but seeing more and more risks just I'm compelled to ask one more time - is it required?

    cc @John-44

    Sorry @churik , only just seeing this comment now.

    If it makes development easier I think it's fine if we don't support partial deletions of @ mentions. What I mean by this is that once an @ mention (e.g. "@John_") has been entered/finalised in the composer, if the caret is positioned immediately to the right of the finalised @ mention and the user presses backspace then the whole @ mention should be deleted (not just the last letter in the @ mention).

    In terms of selection behaviour, if it helps development I think it's also fine if finalised @ mentions are treated for the purposes of selection as a single block e.g. the whole of the @ mention counts as a single letter and it's not possible to select some but not all of letters in the @ mention.

    Making these two changes would make it impossible to delete just part of a finalized @ mention.

    Do the above only if it helps with development.

    I may have misunderstood something about the problem or the question being asked. If I have, please clarify.

    cc'ing @vkjr @J-Son89 @qfrank @pedro-et @qoqobolo

    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.

    Message - Composer - Mentions not resolving in editor