-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: hyperlinks for chat #3252
feat: hyperlinks for chat #3252
Conversation
…' into feat/chat/copy_paste
…' into feat/chat/hyperlinks
Windows and Mac build successfull in Unity Cloud! You can find a link to the downloadable artifact below.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job! I left some comments, nothing too important, so green light!
Explorer/Assets/DCL/ScenesDebug/ScenesConsistency/ChatTeleports/ChatTeleport.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/HyperlinkHandler/InputFieldsValidator.cs
Outdated
Show resolved
Hide resolved
…issue with pasting
Tested on Windows ✅ Test performed: Evidence: Untitled.Video.-.Made.With.Clipchamp.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this PR change?
Implements #3095
This implements 2 reusable components, a ValidatedInputText, that makes sure all text that is input in the associated TMP_InputText component is properly validated (included when doing backspaces or pasting text) and a reusable HyperlinkHandlerElement that can be put next to any TMP_Text component and will allow to display hyperlinks and react to them correctly.
I also extracted all Input Box functionality into its own element (which in the near future will be further broken down when extracting the emojis logic).
And did a bunch of file movements to break some circular assembly refs, introducing a chat command bus, to send commands through it and reduce the number of dependencies on the chat commands themselves. There are a lot of bad uses of chat commands referencing stuff they shouldnt through dubious paths. We should not do it xD
How to test the changes?
Check that all chat interactions work as expected, including commands.
While testing all this, try removing characters with backspace or delete keys, to test that links break (or not) when they should.
Check that only valid scenes are detected as links (including the weird ass parcels on the right side with weird coords), to detect parcel addresses they must not be preceded or followed by any other character, except a blank space. So
-150,150
is valid buta150,150
is not.Check that web addresses are correctly detected as such, accepted formats are:
http://www.something.cc
https://www.something.cc
www.something.cc
https://something.cc
something.cc
it also supports more complex subdomains like www.something.cc/somethingelse
Check that world addresses are correctly detected, their format is
something.dcl.eth
, again, it must not be preceded or followed by any other character (except white spaces).Check that only allowed rich text tags work, for now, only bold and italics work ( and ) any other tag will be converted to a similar character that is inert for our purposes.
Check that multiple links of different or same type can coexist in the same message without issues and that they open correctly the expected window when clicked.
Check that after sending the messages the message in the chat is shown in color and that when you hover over the link, it gets underlined correctly (only when you hover over it) and when unhovering it should return to its original blue color. When you click on it, depending on the type of link, a popup will show to make sure you wanna open that link or go to that scene/world. Also the cursor should change to a hand thingy when hovering over the link.
Make sure all types of links work as expected and that no weird behaviour is experienced when hovering (like text getting scrambled or showing rich text tags).
There might be some issues when pasting text that include links, specially when using Ctrl+V. But that will be handled in another PR.