Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

feat: Add unicode character support for default avatars

Open noobbbbb opened this issue 1 year ago • 14 comments

This PR allows non-alphanumeric characters to appear as the default avatar for users and channels. (but only for strings allowed in the settings)

Proposed changes (including videos or screenshots)

Issue(s)

Closes #33602

Steps to test or reproduce

Further comments

noobbbbb avatar Nov 05 '24 01:11 noobbbbb

Looks like this PR is ready to merge! 🎉 If you have any trouble, please check the PR guidelines

dionisio-bot[bot] avatar Nov 05 '24 01:11 dionisio-bot[bot]

🦋 Changeset detected

Latest commit: d9f72797c1e1d46b25183948310cad3d4604bd0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Nov 05 '24 01:11 changeset-bot[bot]

Can someone please tell me... In the “Run rossjrw/pr-preview-action@v1” step of the “ CI / deploy-preview (pull_request) ‘ stage, I get the error ’Error: Resource not accessible by integration”, How can I resolve this issue?

noobbbbb avatar Nov 05 '24 01:11 noobbbbb

Can someone please tell me... In the “Run rossjrw/pr-preview-action@v1” step of the “ CI / deploy-preview (pull_request) ‘ stage, I get the error ’Error: Resource not accessible by integration”, How can I resolve this issue?

don't worry about it.. this is not required to merge the PR, but the tests are..

also, do you mind explaining your use case? what character do you want to have used on avatars?

sampaiodiego avatar Nov 05 '24 19:11 sampaiodiego

don't worry about it.. this is not required to merge the PR, but the tests are..

also, do you mind explaining your use case? what character do you want to have used on avatars?

Thank you for your support. Regarding the characters we would like to use for the default avatar, specifically the Japanese string.

eg.) Channel “公式” -> “公” is displayed. User “山田 太郎” -> “山” is displayed.

In both cases, we would like to be able to display anything that can pass the validation patterns specified in “UTF8_User_Names_Validation” and “UTF8_Channel_Names_Validation”, rather than being limited to alphanumeric characters.

noobbbbb avatar Nov 06 '24 01:11 noobbbbb

Could you help me again?

but the tests are...

Test UI (EE) / MongoDB 5.0 (2/5) - Alpine (Official) (pull_request)  Failing after 6m

I don't know why the error occurs. What should I do?

noobbbbb avatar Nov 07 '24 01:11 noobbbbb

It seems to have succeeded except for “CI / deploy-preview (pull_request)”.

@sampaiodiego Could you review this? And if everything is ok, could you merge this?

noobbbbb avatar Nov 08 '24 00:11 noobbbbb

Hmmm... I can't get the test to pass again. What could be the cause?

noobbbbb avatar Nov 13 '24 08:11 noobbbbb

It looks like it might be some JIRA integration failing... does it pass locally?

Gustrb avatar Nov 13 '24 08:11 Gustrb

@gabriellsh @Gustrb Please resolve the conversation.

noobbbbb avatar Nov 14 '24 04:11 noobbbbb

Thanks for the changes @noobbbbb ! Looking much better now, I'll drop a new review soon

gabriellsh avatar Dec 02 '24 16:12 gabriellsh

Please add a changeset stating the changes you've made, besides that, looking good to me :)

Gustrb avatar Dec 09 '24 17:12 Gustrb

Please add a changeset stating the changes you've made, besides that, looking good to me :)

I added a changeset. However, this is my first attempt, so I may be wrong.

noobbbbb avatar Dec 10 '24 06:12 noobbbbb

hey @noobbbbb it is pretty good, if you are curious about how changeset should be written you can take a look at our manual: https://developer.rocket.chat/v1/docs/development-workflow#adding-changeset-to-your-pull-request

Gustrb avatar Dec 10 '24 11:12 Gustrb

Thanks for the changes @noobbbbb ! Looking much better now, I'll drop a new review soon

@gabriellsh Have you reviewed it? Please let me know if I missed something.

noobbbbb avatar Jan 28 '25 00:01 noobbbbb

Looks good to me :)

Gustrb avatar Feb 10 '25 18:02 Gustrb

Trying to run here, getting this error on meteor console: image And Avatars are not being shown: image Nor channels avatars: image

I just checkout the code, yarn, yarn build and yarn dsv to run. There is something more that need to be done?

jeanfbrito avatar Feb 20 '25 00:02 jeanfbrito

Added [0-9a-zA-Z\-_.\p{L}\p{N}\s]+ to accept the characters image

But frontend dont accept them, it should accept? image image

@noobbbbb please add steps to test to the description of the PR.

jeanfbrito avatar Feb 20 '25 14:02 jeanfbrito

Tested using .+ regex and it worked. image

jeanfbrito avatar Feb 20 '25 16:02 jeanfbrito

@noobbbbb please add steps to test to the description of the PR.

@jeanfbrito Thank you for your feedback! I have added the steps to test. Please let me know if you need any further updates.

noobbbbb avatar Feb 21 '25 00:02 noobbbbb

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 59.44%. Comparing base (71fc001) to head (d9f7279). Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #33882   +/-   ##
========================================
  Coverage    59.43%   59.44%           
========================================
  Files         2829     2829           
  Lines        68323    68326    +3     
  Branches     15131    15131           
========================================
+ Hits         40611    40614    +3     
  Misses       25054    25054           
  Partials      2658     2658           

codecov[bot] avatar Feb 21 '25 16:02 codecov[bot]

Thanks @noobbbbb for the contribution! It'll most likely be available at 7.5 release.

gabriellsh avatar Feb 25 '25 12:02 gabriellsh