logos-innovation-lab / waku-objects-playground

A simple waku chat application to play with and test waku objects
https://chat.wakuplay.im
Apache License 2.0
2 stars 1 forks source link

Display name change is inconsistent #217

Open agazso opened 1 year ago

agazso commented 1 year ago

I had a test account named a. I wanted to change the name to something more expressive but it does not let me delete the first character (which is the complete name in this case).

It lets me add new characters to the name, but then when deleting the name with backspace it lets it until there is one character, then when it reaches the last one it changes back to the full original name.

sugarpusher commented 1 year ago

Seems that this is being caused by this block to avoid empty strings in the name field, but that brings up the question - what should we do in that case? Does @david-gauquelin have any suggestions?

$: if (!$profile.loading && !name && !avatar) {
    name = $profile.name
    avatar = $profile.avatar
}
agazso commented 1 year ago

I can imagine two solutions:

  1. Display an error if the name is empty (or invalid). Do not change the name if it is empty and the user navigates away
  2. Restore the original name if the name is empty and the text component loses focus (also when the user navigates away)

The first is more user friendly because that way it can be indicated what is the problem and the user can understand. However currently there is no such error component in the design.

The second is easier to implement and do not require an extra component in the design.

lucille-bellepleure commented 1 year ago

At the moment of the user creation, we can also create a default random name, such as “2ab52c”.

sugarpusher commented 1 year ago

@agazso Seems like this got fixed at some point, I can't reproduce anymore. Not sure who fixed it. Can you please check if you still have the issue? Thanks!

agazso commented 1 year ago

Yes, I can still reproduce. If you have a one character name then you cannot delete it, therefore you cannot change it. If you have a longer name, then when you delete it all then it restores the name, therefore you cannot change it.

I suggest to do the 2nd solution that I outlined above, because it is easy to implement without having a need for a design of an error component.