From 4b1a1c7db9a53de7677ec09dfa12276859e1abf3 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Sat, 5 Feb 2022 14:57:00 -0600 Subject: [PATCH] Squashed commit of the following: commit d361a4d7dc18bd7c722ed76a894ebee8e5a50ed5 Author: Henry Jameson Date: Fri Feb 4 14:20:56 2022 +0200 fix overflows commit 571e73a346996f1bcdecb6545b44351a65fee3cb Author: Henry Jameson Date: Thu Feb 3 23:13:28 2022 +0200 better approach to unescaping commit 39ecb338830a71c015688e7ec45e16e1151983d3 Author: Henry Jameson Date: Thu Feb 3 22:58:12 2022 +0200 fix amps in links commit 0f0193130963123998d3247426f3b3c9c60f2aa2 Author: Henry Jameson Date: Thu Feb 3 22:52:41 2022 +0200 make chat messages behave same as posts for animated gifs commit a9830ff4913a56a3ff097505a4e65bb61117b4d5 Author: Henry Jameson Date: Thu Feb 3 22:50:32 2022 +0200 support width/height img attributes commit 9a6363431d8f17cc1ee027eb498181d157fefdb7 Author: Henry Jameson Date: Thu Feb 3 22:41:38 2022 +0200 lint commit ea6114f63c972ac974f8e3055b93ae3340b6e85b Author: Henry Jameson Date: Thu Feb 3 22:36:13 2022 +0200 better phrasing? commit bfb3a4364be3f71f7c46056aeb8972f04a072703 Author: Henry Jameson Date: Thu Feb 3 22:34:57 2022 +0200 options to disable (You)s and highlighting of yourself commit 6d3229b1a10a6547d5c0ebcf47a65f03a0f9c690 Author: Henry Jameson Date: Thu Feb 3 22:23:28 2022 +0200 fix poast mentions tripping commit 06042569f1d2f2c7217917459df007adbb113e53 Author: Henry Jameson Date: Thu Feb 3 22:10:45 2022 +0200 fix alignment issues Signed-off-by: Sam Therapy --- src/components/chat_message/chat_message.scss | 7 +++++++ src/components/mention_link/mention_link.js | 8 +++++++- src/components/mention_link/mention_link.scss | 12 ++++++++---- src/components/mention_link/mention_link.vue | 4 ++-- src/components/mentions_line/mentions_line.scss | 7 ++----- src/components/popover/popover.vue | 2 +- src/components/rich_content/rich_content.jsx | 3 ++- src/components/settings_modal/tabs/general_tab.vue | 10 ++++++++++ src/components/status/status.scss | 13 ++++++++++--- src/components/status/status.vue | 2 +- src/components/status_body/status_body.scss | 2 +- src/components/still-image/still-image.js | 11 ++++++++++- src/components/still-image/still-image.vue | 1 + src/i18n/en.json | 2 ++ src/modules/config.js | 2 ++ src/modules/instance.js | 2 ++ .../html_converter/html_tree_converter.service.js | 3 ++- 17 files changed, 70 insertions(+), 21 deletions(-) diff --git a/src/components/chat_message/chat_message.scss b/src/components/chat_message/chat_message.scss index fcfa7c8a..5445d9f7 100644 --- a/src/components/chat_message/chat_message.scss +++ b/src/components/chat_message/chat_message.scss @@ -1,6 +1,7 @@ @import '../../_variables.scss'; .chat-message-wrapper { + &.hovered-message-chain { .animated.Avatar { canvas { @@ -40,6 +41,12 @@ .chat-message { display: flex; padding-bottom: 0.5em; + + .status-body:hover { + --_still-image-img-visibility: visible; + --_still-image-canvas-visibility: hidden; + --_still-image-label-visibility: hidden; + } } .avatar-wrapper { diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 5209907d..55eea195 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -87,7 +87,7 @@ const MentionLink = { classnames () { return [ { - '-you': this.isYou, + '-you': this.isYou && this.shouldBoldenYou, '-highlighted': this.highlight }, this.highlightType @@ -115,6 +115,12 @@ const MentionLink = { shouldShowAvatar () { return this.mergedConfig.mentionLinkShowAvatar }, + shouldShowYous () { + return this.mergedConfig.mentionLinkShowYous + }, + shouldBoldenYou () { + return this.mergedConfig.mentionLinkBoldenYou + }, shouldFadeDomain () { return this.mergedConfig.mentionLinkFadeDomain }, diff --git a/src/components/mention_link/mention_link.scss b/src/components/mention_link/mention_link.scss index 03306dcc..c7db7fb9 100644 --- a/src/components/mention_link/mention_link.scss +++ b/src/components/mention_link/mention_link.scss @@ -3,12 +3,12 @@ .MentionLink { position: relative; white-space: normal; - display: inline-block; + display: inline; color: var(--link); & .new, & .original { - display: inline-block; + display: inline; border-radius: 2px; } @@ -38,8 +38,8 @@ user-select: all; } - .short.-with-tooltip, - .you { + & .short.-with-tooltip, + & .you { user-select: none; } @@ -48,6 +48,10 @@ white-space: nowrap; } + .shortName { + white-space: normal; + } + .new { &.-you { & .shortName, diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index ac20eb5a..d8ab79fb 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -45,8 +45,8 @@ v-html="'@' + serverName" /> {{ $t('status.you') }} diff --git a/src/components/mentions_line/mentions_line.scss b/src/components/mentions_line/mentions_line.scss index b9d5c14a..1a485860 100644 --- a/src/components/mentions_line/mentions_line.scss +++ b/src/components/mentions_line/mentions_line.scss @@ -1,11 +1,8 @@ .MentionsLine { + word-break: break-all; + .showMoreLess { white-space: normal; color: var(--link); } - - .fullExtraMentions, - .mention-link:not(:last-child) { - margin-right: 0.25em; - } } diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index 2e78a09e..8588b351 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -33,7 +33,7 @@ @import '../../_variables.scss'; .popover-trigger-button { - display: block; + display: inline-block; } .popover { diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index c0d20c5e..46bc661a 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -120,7 +120,8 @@ export default Vue.component('RichContent', { // don't include spaces when processing mentions - we'll include them // in MentionsLine lastSpacing = item - return currentMentions !== null ? item.trim() : item + // Don't remove last space in a container (fixes poast mentions) + return (index !== array.length - 1) && (currentMentions !== null) ? item.trim() : item } currentMentions = null diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index efebf124..7741dfba 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -194,6 +194,11 @@ +
  • + + {{ $t('settings.show_yous') }} + +
  • +
  • + + {{ $t('settings.mention_link_bolden_you') }} + +
  • diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 6c5730b7..80bc392d 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -3,6 +3,8 @@ .Status { min-width: 0; white-space: normal; + word-wrap: break-word; + word-break: break-word; &:hover { --_still-image-img-visibility: visible; @@ -155,18 +157,24 @@ position: relative; align-content: baseline; font-size: 12px; - line-height: 160%; + margin-top: 0.2em; + line-height: 130%; max-width: 100%; align-items: stretch; } & .reply-to-popover, - & .reply-to-no-popover { + & .reply-to-no-popover, + & .mentions { min-width: 0; margin-right: 0.4em; flex-shrink: 0; } + .reply-glued-label { + margin-right: 0.5em; + } + .reply-to-popover { .reply-to:hover::before { content: ''; @@ -200,7 +208,6 @@ & .reply-to { white-space: nowrap; position: relative; - padding-right: 0.25em; } & .mentions-text, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index d9785028..be7a9af2 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -252,7 +252,7 @@ > /\d$/.test(str) ? str + 'px' : str + return { + height: this.height ? appendPx(this.height) : null, + width: this.width ? appendPx(this.width) : null + } } }, methods: { diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 0623b42e..cca75fcb 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -2,6 +2,7 @@
    { const handleOpen = (tag) => { const curBuf = getCurrentBuffer() - const newLevel = [tag, []] + const newLevel = [unescape(tag), []] levels.push(newLevel) curBuf.push(newLevel) }