status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.87k stars 983 forks source link

Message - Composer - Mentions not resolving in editor #16097

Open J-Son89 opened 1 year ago

J-Son89 commented 1 year ago

Currently the mentions show no clear UI to the user that the mention has been correctly resolved.

Composer_for_Mobile_Figma_2023-05-30_16-41-12

See the designs for how this should look: https://www.figma.com/file/wA8Epdki2OWa8Vr067PCNQ/Composer-for-Mobile?type=design&node-id=5530-358489&t=1xpxUi8twtiGgxdm-0

flexsurfer commented 1 year ago

cc @qfrank

qfrank commented 1 year ago

Hello @vkjr ! are you going to modify the corresponding part on status-go also or just fix the part of UI ?

vkjr commented 1 year ago

@qfrank, not sure yet, currently figuring out the best way to implement this. Do you have something in mind regarding status-go?

qfrank commented 1 year ago

The status-go mention-related API will return an input-segments array, which should include which parts are text and which are mentions. For example, for the text message: ‘hello @john1 , how are you’, the input-segments should contain [[:text 'hello ‘] [:mention ‘@john1’] [:text ’ ,how are you’]]. So the front-end only needs to traverse the input-segments to render the interface. But I need to verify whether the relevant status-go code works as I expected. @vkjr

vkjr commented 1 year ago

@qfrank, yes, you talk more about messages that we already store in status-go, and when I touched that part of the code, splitting the text into sections worked well. This issue is about writing the new message and displaying it correctly while user still types and before message was sent, so most probably status-go won't be involved

qfrank commented 1 year ago

splitting the text into sections worked well

okay, glad to know this! so you may reuse it as it will calculate suggestion( input-segments will get updated) while typing, there is also something like AtIdxs in state you could use, it's up to you

qfrank commented 1 year ago

Oh, i proberbly missunderstand you, are you familiar with on-change-text ? it involved with status-go , relate PR

vkjr commented 1 year ago

Oh, I misunderstood you too) I thought you are talking about already existing messages! No, wasn't aware of this status-go call, thank you for pointing to it, will dig deeper! :)

qfrank commented 1 year ago

I can help check if InputSegments works as expected so that you may reuse it , the implementation for mention is complex :) , i rewrote it , I will check it tomorrow

vkjr commented 1 year ago

Thank you!

qfrank commented 1 year ago

Hi @vkjr , I've made a simple test, in general, input-segments should work just like this example:

For example, for the text message: ‘hello @John1 , how are you’, the input-segments should contain [[:text 'hello ‘] [:mention ‘@John1’] [:text ’ ,how are you’]]

vkjr commented 1 year ago

Hi @vkjr , I've made a simple test, in general, input-segments should work just like this example:

Thank you!

churik commented 9 months ago

Should be reimplemented taking into account https://github.com/status-im/status-mobile/pull/16330#issuecomment-1691405548

cc @vkjr