From aefdac1115db9e13019209e2c8c9be6f62dec657 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Tue, 20 Jul 2021 22:41:49 -0400 Subject: [PATCH 1/5] Fix error when hovering over non-emoji reactions Signed-off-by: Robin Townsend --- src/HtmlUtils.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index 3c34bf6837..00734f69f8 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -79,8 +79,8 @@ function mightContainEmoji(str: string): boolean { * @return {String} The shortcode (such as :thumbup:) */ export function unicodeToShortcode(char: string): string { - const shortcodes = getEmojiFromUnicode(char).shortcodes; - return shortcodes.length > 0 ? `:${shortcodes[0]}:` : ''; + const shortcodes = getEmojiFromUnicode(char)?.shortcodes; + return shortcodes && shortcodes.length > 0 ? `:${shortcodes[0]}:` : ''; } export function processHtmlForSending(html: string): string { From a6308229fbca38a7af9da75b7cca433d462b1ad2 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Wed, 21 Jul 2021 08:42:42 +0200 Subject: [PATCH 2/5] Add spoiler support for message bubbles --- res/css/views/rooms/_EventTile.scss | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 72328fab77..8c6c6cb62d 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -226,25 +226,6 @@ $hover-select-border: 4px; overflow-y: hidden; } - /* Spoiler stuff */ - .mx_EventTile_spoiler { - cursor: pointer; - } - - .mx_EventTile_spoiler_reason { - color: $event-timestamp-color; - font-size: $font-11px; - } - - .mx_EventTile_spoiler_content { - filter: blur(5px) saturate(0.1) sepia(1); - transition-duration: 0.5s; - } - - .mx_EventTile_spoiler.visible > .mx_EventTile_spoiler_content { - filter: none; - } - &:hover.mx_EventTile_verified .mx_EventTile_line, &:hover.mx_EventTile_unverified .mx_EventTile_line, &:hover.mx_EventTile_unknown .mx_EventTile_line { @@ -307,6 +288,25 @@ $hover-select-border: 4px; } } +/* Spoiler stuff */ +.mx_EventTile_spoiler { + cursor: pointer; +} + +.mx_EventTile_spoiler_reason { + color: $event-timestamp-color; + font-size: $font-11px; +} + +.mx_EventTile_spoiler_content { + filter: blur(5px) saturate(0.1) sepia(1); + transition-duration: 0.5s; +} + +.mx_EventTile_spoiler.visible > .mx_EventTile_spoiler_content { + filter: none; +} + .mx_RoomView_timeline_rr_enabled { .mx_EventTile:not([data-layout=bubble]) { From 1d1d93ed147f8dbaa665a3ac31d8cf4f19c79bfe Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Wed, 21 Jul 2021 03:17:55 -0400 Subject: [PATCH 3/5] Apply code review suggestion Signed-off-by: Robin Townsend --- src/HtmlUtils.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index 00734f69f8..b125ddeeb5 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -80,7 +80,7 @@ function mightContainEmoji(str: string): boolean { */ export function unicodeToShortcode(char: string): string { const shortcodes = getEmojiFromUnicode(char)?.shortcodes; - return shortcodes && shortcodes.length > 0 ? `:${shortcodes[0]}:` : ''; + return shortcodes?.length ? `:${shortcodes[0]}:` : ''; } export function processHtmlForSending(html: string): string { From 6d9ac1de172bda54d462b6e2b0c46398383ff610 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Wed, 21 Jul 2021 09:34:30 +0200 Subject: [PATCH 4/5] Fix font slider preview for message bubbles --- .../views/settings/tabs/user/_AppearanceUserSettingsTab.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/res/css/views/settings/tabs/user/_AppearanceUserSettingsTab.scss b/res/css/views/settings/tabs/user/_AppearanceUserSettingsTab.scss index 94983a60bf..9bc583ea93 100644 --- a/res/css/views/settings/tabs/user/_AppearanceUserSettingsTab.scss +++ b/res/css/views/settings/tabs/user/_AppearanceUserSettingsTab.scss @@ -45,6 +45,11 @@ limitations under the License. border-radius: 10px; padding: 0 16px 9px 16px; pointer-events: none; + display: flow-root; + + .mx_EventTile[data-layout=bubble] { + margin-top: 30px; + } .mx_EventTile_msgOption { display: none; From ae51653348ac920f2036ea0f18799f02a6b7d9ab Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Wed, 21 Jul 2021 12:41:02 +0200 Subject: [PATCH 5/5] Add null guard for room prop in EventTile --- src/components/structures/MessagePanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 514cf4db09..5bfe759508 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -743,7 +743,7 @@ export default class MessagePanel extends React.Component { enableFlair={this.props.enableFlair} showReadReceipts={this.props.showReadReceipts} callEventGrouper={callEventGrouper} - hideSender={this.props.room.getMembers().length <= 2 && this.props.layout === Layout.Bubble} + hideSender={this.props.room?.getMembers().length <= 2 && this.props.layout === Layout.Bubble} /> , );