Skip to content

Commit

Permalink
feat: hyperlinks for chat (#3252)
Browse files Browse the repository at this point in the history
* Added new button to chat bubble + some layout fixes + show on hover

* Added paste logic and hasValue check for clipboard

* Added logic to show paste popup anywhere from anywhere + paste logic

* Fixed some logic + prefabs

* Fixed functionality + paste prefab tweaks

* missing changes

* Post dev merge fix

* Changes to Chat Entries to be properly reused prefabs

* Fixed chat scale

* Fixed paste popup canvas ref

* Fixed some rect issues with own chats

* Fix after merge

* Extracted design consts into SO for easier access

* Update ChatEntryConfigurationSO.cs

* fixed chat scale

* Re-added missing paste popup position marker

* Added character limit check when pasting text

* Added context menu with copy  option

* fixed closing task

* Update ChatController.cs

* Fixed non masked frame on chats

* Fixes from CR

* Added clipboard manager service class to handle clipboard operations and callbacks

* Added handling of hyperlink

* Fixed assembly refs for hyperlink handler + added settings

* Fixed some circular dependencies on assemblies used in the chat classes

* Fixed reference to plugin using proper bus to send events

* Added logic to handle cursor changes + hyperlink styling

* Added logic for highlighting using styles

* Fixed highlight change from one link to another

* Fixed hyperlink handler

* Applied new pattern for view element with dependencies

* fixed and removed redundancies

* Changes to Input validation

* Fixed validator when doing backspaces

* Added remaining regex + fixes when deleting text

* Small tweaks + enabled nametags in chat bubbles

* Extracted chat input box functionality from chatview into its own game object

* Fixed missing ref

* Fixed other references

* Improved logic on validated Input field

* more tweaks to validated input field

* Improved efficiency of validator

* Fixes to regex and validation on backspace

* Fixed regex to handle better TAG placement when removing characters

* Fixed character counting

* Optimized hyperlink validation and stringbuilder uses + added scene position validation

* Fixed ref for Change Realm Prompt

* Fixed Confirmation message for change realm prompt

* Tweaked some logic on hyperlink handler to improve efficiency + removed color from style of highlighted links

* Fixed assembly ref dependency hell using chat command bus

* fixed chat prefab refs

* Fixed dependencies for hyperlink handler

* Fixed issue with repeated matches overwriting the results

* Removed unused code + added comments + small tweaks to names + fixed issue with pasting

* Fixed input validation upon pasting and with commands

* Added better support for more website patterns

* Fixed realm change prompt text

* tweak to file so it can be changed from editor

* Applied comments from PR
  • Loading branch information
fcolarich authored Feb 3, 2025
1 parent 3287913 commit ce29578
Show file tree
Hide file tree
Showing 98 changed files with 1,698 additions and 14,420 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ MonoBehaviour:
<CloseButton>k__BackingField: {fileID: 6350800476113885467}
<ContinueButton>k__BackingField: {fileID: 4323582271544481263}
<CancelButton>k__BackingField: {fileID: 2493130869277956874}
<MessageText>k__BackingField: {fileID: 0}
<MessageText>k__BackingField: {fileID: 2120140030454988638}
<RealmText>k__BackingField: {fileID: 5324196972733275058}
--- !u!222 &799493355526906641
CanvasRenderer:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"GUID:ac3295688c7c22745a96e6ac34718181",
"GUID:8322ea9340a544c59ddc56d4793eac74",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:e0eedfa2deb9406daf86fd8368728e39",
"GUID:e49b0e838d4f4d6194cd8f9ed5309820"
"GUID:e0eedfa2deb9406daf86fd8368728e39"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override UniTask WaitForCloseIntentAsync(CancellationToken ct)
return UniTask.CompletedTask;

return UniTask.WhenAny(
viewInstance.CloseButton.OnClickAsync(ct),
viewInstance!.CloseButton.OnClickAsync(ct),
viewInstance.CancelButton.OnClickAsync(ct),
viewInstance.ContinueButton.OnClickAsync(ct));
}
Expand All @@ -61,7 +61,7 @@ private void RequestChangeRealm(string message, string realm, Action<ChangeRealm
resultCallback?.Invoke(ChangeRealmPromptResultType.Approved);
else
{
viewInstance.MessageText.text = message;
viewInstance!.MessageText.text = message;
viewInstance.RealmText.text = realm;
}
}
Expand Down
69 changes: 10 additions & 59 deletions Explorer/Assets/DCL/Chat/Assets/Chat.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e8facb6a795b74627b44b47cb560e799, type: 3}
m_Name:
m_EditorClassIdentifier:
inputField: {fileID: 5622104160664987093}
inputFieldRectTransform: {fileID: 1115583169272015923}
inputField: {fileID: 4092135091884069058}
inputFieldRectTransform: {fileID: 6520705227176678513}
contentRectTransform: {fileID: 8211434791048164212}
minimumHeight: 40
--- !u!1 &9152785347356188261
Expand Down Expand Up @@ -278,28 +278,12 @@ MonoBehaviour:
<canvas>k__BackingField: {fileID: 6099333271793956856}
<raycaster>k__BackingField: {fileID: 2110952359374055602}
BackgroundFadeTime: 0.2
MaxMessageLength: 250
chatBubblesToggle: {fileID: 4830781885806626314}
emojiPanel: {fileID: 8642591472055175998}
emojiSuggestionPanel: {fileID: 5472059768468074674}
inputField: {fileID: 5622104160664987093}
characterCounter: {fileID: 5274648269416443391}
chatInputBox: {fileID: 5059819421467020040}
panelBackgroundCanvasGroup: {fileID: 4742269820946521976}
emojiPanelButton: {fileID: 5796404896790943328}
closeChatButton: {fileID: 1104092725699042680}
pastePopupPosition: {fileID: 8997778028803641515}
chatMessageViewer: {fileID: 682925133115260549}
emojiPanelConfiguration: {fileID: 11400000, guid: 51646f2adc3264ba7bf9b4f90febbd22, type: 2}
emojiMappingJson: {fileID: 4900000, guid: 7355ae17e96e64b9592813524510dc45, type: 3}
emojiSectionViewPrefab: {fileID: 7843218067654608663, guid: d4552d3a2432742f58c63ba71bdfb50e, type: 3}
emojiButtonPrefab: {fileID: 8273076807335735701, guid: 7d0a647adf3334ee1a142e7bf69f128d, type: 3}
emojiSuggestionViewPrefab: {fileID: -5260165294436727257, guid: 5bc332aa8fd2147cab980e20e64bec03, type: 3}
addEmojiAudio: {fileID: 11400000, guid: ab59a5b2a814f02419850961fc490805, type: 2}
openEmojiPanelAudio: {fileID: 11400000, guid: abc438e2962540549b414d54fbc89eed, type: 2}
chatSendMessageAudio: {fileID: 11400000, guid: efe341aa011f4c8428d3246fa65ef5b0, type: 2}
chatReceiveMessageAudio: {fileID: 11400000, guid: 1c179628ffe816f4c9be1ba12630f97f, type: 2}
chatInputTextAudio: {fileID: 11400000, guid: d6b0660efe9c3954c937d083f8aa9c98, type: 2}
enterInputAudio: {fileID: 11400000, guid: 8703731941d082441b7bc7c6e9720b34, type: 2}
--- !u!1001 &1890474067062928347
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -402,31 +386,9 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 1533203949891575784, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5274648269416443391 stripped
--- !u!114 &4092135091884069058 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5985002989317627428, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d52b8ae7e003f4dac8bc233a9bec4eff, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5472059768468074674 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5894360322644460393, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ede92f1128314ccab26c2f0389e572f4, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5622104160664987093 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6069139085487838734, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_CorrespondingSourceObject: {fileID: 2519340724717527833, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
Expand All @@ -435,31 +397,20 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5796404896790943328 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5353838427765777851, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8fef2260eb7f54392b8c68f9874d1d28, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8642591472055175998 stripped
--- !u!114 &5059819421467020040 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7911970236011968741, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_CorrespondingSourceObject: {fileID: 6630502416812194003, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2ebd3771315604fc09ca02ca37850846, type: 3}
m_Script: {fileID: 11500000, guid: 18b5dde3d1a0473dbcf0d7305ac86c38, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &8997778028803641515 stripped
--- !u!224 &6520705227176678513 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7413724693438948208, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_CorrespondingSourceObject: {fileID: 4630372213285562282, guid: 754fd4e2bb7828240808af9ce37feb93, type: 3}
m_PrefabInstance: {fileID: 1890474067062928347}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1949774983281342339
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 6709421707846502462}
m_Modifications:
- target: {fileID: 2681651048344826938, guid: 66cddfcb263aafe499942012249d5b00, type: 3}
propertyPath: m_isRichText
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4356320699868230769, guid: 66cddfcb263aafe499942012249d5b00, type: 3}
propertyPath: styleSheet
value:
objectReference: {fileID: 11400000, guid: 3675d28be476ed544a0b350da26e2d70, type: 2}
- target: {fileID: 5238833002639546345, guid: 66cddfcb263aafe499942012249d5b00, type: 3}
propertyPath: m_Name
value: MessageContentElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 5118336956721699336}
- component: {fileID: 2681651048344826938}
- component: {fileID: 7487901908219479282}
- component: {fileID: 4356320699868230769}
m_Layer: 5
m_Name: ChatEntryMessageContentElement
m_TagString: Untagged
Expand Down Expand Up @@ -167,3 +168,18 @@ MonoBehaviour:
<messageContentRectTransform>k__BackingField: {fileID: 8258041763941702871}
<messageContentSizeFitter>k__BackingField: {fileID: 5118336956721699336}
<messageContentText>k__BackingField: {fileID: 2681651048344826938}
<hyperlinkHandler>k__BackingField: {fileID: 4356320699868230769}
--- !u!114 &4356320699868230769
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5238833002639546345}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 71db578cd89a48d0903a2e608024fcd5, type: 3}
m_Name:
m_EditorClassIdentifier:
textComponent: {fileID: 2681651048344826938}
styleSheet: {fileID: 11400000, guid: 3675d28be476ed544a0b350da26e2d70, type: 2}
Loading

0 comments on commit ce29578

Please sign in to comment.