From 5faafdb428410800b7db9127adf7342894851407 Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 1 Jul 2019 13:46:09 -0400 Subject: [PATCH 01/25] use popper for status preview --- src/components/status/status.js | 7 +- src/components/status/status.vue | 169 +++++++++++++++---------------- 2 files changed, 85 insertions(+), 91 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index d17ba318..ae3aacbd 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -1,3 +1,4 @@ +import Popper from 'vue-popperjs/src/component/popper.js.vue' import Attachment from '../attachment/attachment.vue' import FavoriteButton from '../favorite_button/favorite_button.vue' import RetweetButton from '../retweet_button/retweet_button.vue' @@ -38,7 +39,6 @@ const Status = { unmuted: false, userExpanded: false, preview: null, - showPreview: false, showingTall: this.inConversation && this.focused, showingLongSubject: false, error: null, @@ -290,6 +290,7 @@ const Status = { } }, components: { + Popper, Attachment, FavoriteButton, RetweetButton, @@ -377,7 +378,6 @@ const Status = { } }, replyEnter (id, event) { - this.showPreview = true const targetId = id const statuses = this.$store.state.statuses.allStatuses @@ -394,9 +394,6 @@ const Status = { this.preview = find(statuses, { 'id': targetId }) } }, - replyLeave () { - this.showPreview = false - }, generateUserProfileLink (id, name) { return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames) }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 912f77d2..d03fe143 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -170,24 +170,30 @@
-
- - - {{ $t('status.reply_to') }} - +
+ +
+ +
+ +
+
+ + + + {{$t('status.reply_to')}} + +
{{ replyToName }} @@ -224,25 +230,6 @@
-
- -
- -
-
-
.status-el.status-el { + border: none; + } + + > .status-preview-loading { + padding: 1em; + text-align: center; + + i { + font-size: 2em; + } + } + + &[x-placement^="bottom"] .popper__arrow { + &:before { + position: absolute; + content: ''; + top: -2px; + left: -7px; + border-width: 0 7px 7px 7px; + border-color: transparent transparent $fallback--border transparent; + border-color: transparent transparent var(--border, $fallback--border) transparent; + border-style: solid; + z-index: -1; + } + } + + &[x-placement^="top"] .popper__arrow { + &:before { + position: absolute; + content: ''; + bottom: -2px; + left: -7px; + border-width: 7px 7px 0 7px; + border-color: $fallback--border transparent transparent transparent; + border-color: var(--border, $fallback--border) transparent transparent transparent; + border-style: solid; + z-index: -1; + } + } +} + .favs-repeated-users { margin-top: $status-margin; From 565d53812b394ed829bcd2e70e48efcc612e5d59 Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 1 Jul 2019 13:47:55 -0400 Subject: [PATCH 02/25] reposition popper after fetching status --- src/components/status/status.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/status/status.js b/src/components/status/status.js index ae3aacbd..641702be 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -388,6 +388,7 @@ const Status = { if (!this.preview) { this.$store.state.api.backendInteractor.fetchStatus({ id }).then((status) => { this.preview = status + this.$nextTick(this.$refs.foo.updatePopper) }) } } else if (this.preview.id !== targetId) { From a26ec64b3bcc4e4a50dd984b39ab1d8ddde05b30 Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 1 Jul 2019 14:00:02 -0400 Subject: [PATCH 03/25] fix minor css issues in status preview --- src/components/status/status.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index d03fe143..cb4abb9a 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -491,11 +491,6 @@ $status-margin: 0.75em; flex-basis: 100%; margin-bottom: 0.5em; - a { - display: inline-block; - word-break: break-all; - } - small { font-weight: lighter; } @@ -506,6 +501,11 @@ $status-margin: 0.75em; justify-content: space-between; line-height: 18px; + a { + display: inline-block; + word-break: break-all; + } + .name-and-account-name { display: flex; min-width: 0; @@ -547,11 +547,13 @@ $status-margin: 0.75em; flex-wrap: wrap; align-items: stretch; - a { + > .reply-to-and-accountname > a { max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; + display: inline-block; + word-break: break-all; } } From 5d6fcb3bb3b901f678c26732037c142bf0145c51 Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 1 Jul 2019 14:00:19 -0400 Subject: [PATCH 04/25] css cleanup --- src/components/status/status.vue | 42 ++++++++++++++------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index cb4abb9a..e0515b33 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -868,32 +868,26 @@ a.unmute { } } - &[x-placement^="bottom"] .popper__arrow { - &:before { - position: absolute; - content: ''; - top: -2px; - left: -7px; - border-width: 0 7px 7px 7px; - border-color: transparent transparent $fallback--border transparent; - border-color: transparent transparent var(--border, $fallback--border) transparent; - border-style: solid; - z-index: -1; - } + .popper__arrow::before { + position: absolute; + content: ''; + left: -7px; + border: solid 7px transparent; + z-index: -1; } - &[x-placement^="top"] .popper__arrow { - &:before { - position: absolute; - content: ''; - bottom: -2px; - left: -7px; - border-width: 7px 7px 0 7px; - border-color: $fallback--border transparent transparent transparent; - border-color: var(--border, $fallback--border) transparent transparent transparent; - border-style: solid; - z-index: -1; - } + &[x-placement^="bottom"] .popper__arrow::before { + top: -2px; + border-top-width: 0; + border-bottom-color: $fallback--border; + border-bottom-color: var(--border, $fallback--border); + } + + &[x-placement^="top"] .popper__arrow::before { + bottom: -2px; + border-bottom-width: 0; + border-top-color: $fallback--border; + border-top-color: var(--border, $fallback--border); } } From 498d7bcb5e029650c964ea241ffa3dc44ff6a79e Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 1 Jul 2019 14:03:07 -0400 Subject: [PATCH 05/25] use better name --- src/components/status/status.js | 2 +- src/components/status/status.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 641702be..d24feccf 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -388,7 +388,7 @@ const Status = { if (!this.preview) { this.$store.state.api.backendInteractor.fetchStatus({ id }).then((status) => { this.preview = status - this.$nextTick(this.$refs.foo.updatePopper) + this.$nextTick(this.$refs.statusPreviewPopper.updatePopper) }) } } else if (this.preview.id !== targetId) { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index e0515b33..d59e661c 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -171,7 +171,7 @@
- +
Date: Mon, 1 Jul 2019 14:38:43 -0400 Subject: [PATCH 06/25] hide status preview popper when hover popper content --- src/components/status/status.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index d59e661c..66082aa4 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -173,14 +173,16 @@
- -
- +
+ +
+ +
@@ -855,11 +857,11 @@ a.unmute { max-width: 95%; margin-left: 0.5em; - > .status-el.status-el { + .status-el.status-el { border: none; } - > .status-preview-loading { + .status-preview-loading { padding: 1em; text-align: center; From 0f65280e203a5f41dba650760e0294e7215fc500 Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 5 Jul 2019 11:38:48 -0400 Subject: [PATCH 07/25] use top placement by default --- src/components/status/status.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 66082aa4..79b359b7 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -171,7 +171,7 @@
- +
Date: Fri, 5 Jul 2019 12:08:16 -0400 Subject: [PATCH 08/25] reset font-size to normal text size using rem --- src/App.scss | 5 ++++- src/components/status/status.vue | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App.scss b/src/App.scss index f20eb44c..2d10f1e7 100644 --- a/src/App.scss +++ b/src/App.scss @@ -39,10 +39,13 @@ h4 { text-align: center; } +html { + font-size: 14px; +} + body { font-family: sans-serif; font-family: var(--interfaceFont, sans-serif); - font-size: 14px; margin: 0; color: $fallback--text; color: var(--text, $fallback--text); diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 79b359b7..cdafcfda 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -842,7 +842,7 @@ a.unmute { } .popper-wrapper.status-preview { - font-size: 14px; + font-size: 1rem; background-color: $fallback--bg; background-color: var(--bg, $fallback--bg); border-color: $fallback--border; From e834b9d88b8373d6647b6f9bab61a52885f9eb7a Mon Sep 17 00:00:00 2001 From: taehoon Date: Sun, 7 Jul 2019 22:42:08 -0400 Subject: [PATCH 09/25] fix eslint warnings --- src/components/status/status.vue | 37 +++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index cdafcfda..daba7efc 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -170,18 +170,32 @@
-
- +
+
-
+
-
- +
+
@@ -189,11 +203,15 @@ - - {{$t('status.reply_to')}} + + {{ $t('status.reply_to') }} @@ -435,7 +453,6 @@ $status-margin: 0.75em; justify-content: flex-end; } - .media-left { margin-right: $status-margin; } From 2f7f6967fdb5e11cd866cb0d15a0d50bf4e00ed7 Mon Sep 17 00:00:00 2001 From: taehoon Date: Sun, 7 Jul 2019 22:47:32 -0400 Subject: [PATCH 10/25] fix popper go behind the top bar --- src/components/status/status.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index daba7efc..79fbe47d 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -176,7 +176,12 @@ >
From 85c897403a0460c4932c70f783c1725d32cff6ac Mon Sep 17 00:00:00 2001 From: taehoon Date: Wed, 17 Jul 2019 12:50:49 -0400 Subject: [PATCH 11/25] migrate Popper to v-popover --- src/components/popper/popper.scss | 9 +-- src/components/status/status.js | 2 - src/components/status/status.vue | 130 +++++++++++++++--------------- 3 files changed, 68 insertions(+), 73 deletions(-) diff --git a/src/components/popper/popper.scss b/src/components/popper/popper.scss index 279b01be..06daa871 100644 --- a/src/components/popper/popper.scss +++ b/src/components/popper/popper.scss @@ -20,7 +20,6 @@ margin: 5px; border-color: $fallback--bg; border-color: var(--bg, $fallback--bg); - z-index: 1; } &[x-placement^="top"] { @@ -31,7 +30,7 @@ border-left-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; - bottom: -5px; + bottom: -4px; left: calc(50% - 5px); margin-top: 0; margin-bottom: 0; @@ -46,7 +45,7 @@ border-left-color: transparent !important; border-right-color: transparent !important; border-top-color: transparent !important; - top: -5px; + top: -4px; left: calc(50% - 5px); margin-top: 0; margin-bottom: 0; @@ -61,7 +60,7 @@ border-left-color: transparent !important; border-top-color: transparent !important; border-bottom-color: transparent !important; - left: -5px; + left: -4px; top: calc(50% - 5px); margin-left: 0; margin-right: 0; @@ -76,7 +75,7 @@ border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; - right: -5px; + right: -4px; top: calc(50% - 5px); margin-left: 0; margin-right: 0; diff --git a/src/components/status/status.js b/src/components/status/status.js index d24feccf..36455f2a 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -1,4 +1,3 @@ -import Popper from 'vue-popperjs/src/component/popper.js.vue' import Attachment from '../attachment/attachment.vue' import FavoriteButton from '../favorite_button/favorite_button.vue' import RetweetButton from '../retweet_button/retweet_button.vue' @@ -290,7 +289,6 @@ const Status = { } }, components: { - Popper, Attachment, FavoriteButton, RetweetButton, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 79fbe47d..fd1705a0 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -174,51 +174,47 @@ v-if="isReply" class="reply-to-and-accountname" > - -
+
+
- -
- -
+
- + {{ $t('status.reply_to') }} - + + + {{ $t('status.reply_to') }} + {{ replyToName }} @@ -604,6 +600,8 @@ $status-margin: 0.75em; overflow: hidden; text-overflow: ellipsis; margin: 0 0.4em 0 0.2em; + color: $fallback--faint; + color: var(--faint, $fallback--faint); } .replies-separator { @@ -863,21 +861,43 @@ a.unmute { } } -.popper-wrapper.status-preview { - font-size: 1rem; - background-color: $fallback--bg; - background-color: var(--bg, $fallback--bg); - border-color: $fallback--border; - border-color: var(--border, $fallback--border); - border-style: solid; - border-width: 1px; - border-radius: $fallback--tooltipRadius; - border-radius: var(--tooltipRadius, $fallback--tooltipRadius); - box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5); - box-shadow: var(--popupShadow); - min-width: 15em; - max-width: 95%; - margin-left: 0.5em; +.tooltip.popover.status-popover { + .popover-inner { + font-size: 1rem; + border-color: $fallback--border; + border-color: var(--border, $fallback--border); + border-style: solid; + border-width: 1px; + border-radius: $fallback--tooltipRadius; + border-radius: var(--tooltipRadius, $fallback--tooltipRadius); + box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5); + box-shadow: var(--popupShadow); + min-width: 15em; + max-width: 95%; + margin-left: 0.5em; + } + + .popover-arrow::before { + position: absolute; + content: ''; + left: -7px; + border: solid 7px transparent; + z-index: -1; + } + + &[x-placement^="bottom-start"] .popover-arrow::before { + top: -2px; + border-top-width: 0; + border-bottom-color: $fallback--border; + border-bottom-color: var(--border, $fallback--border); + } + + &[x-placement^="top-start"] .popover-arrow::before { + bottom: -2px; + border-bottom-width: 0; + border-top-color: $fallback--border; + border-top-color: var(--border, $fallback--border); + } .status-el.status-el { border: none; @@ -891,28 +911,6 @@ a.unmute { font-size: 2em; } } - - .popper__arrow::before { - position: absolute; - content: ''; - left: -7px; - border: solid 7px transparent; - z-index: -1; - } - - &[x-placement^="bottom"] .popper__arrow::before { - top: -2px; - border-top-width: 0; - border-bottom-color: $fallback--border; - border-bottom-color: var(--border, $fallback--border); - } - - &[x-placement^="top"] .popper__arrow::before { - bottom: -2px; - border-bottom-width: 0; - border-top-color: $fallback--border; - border-top-color: var(--border, $fallback--border); - } } .favs-repeated-users { From 39e92e76b9f1c4d7de844a23f88e21b502e30f6b Mon Sep 17 00:00:00 2001 From: taehoon Date: Wed, 17 Jul 2019 13:00:44 -0400 Subject: [PATCH 12/25] fix popper go behind the top bar --- src/components/status/status.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index fd1705a0..1187c182 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -182,6 +182,11 @@ trigger="hover" :offset="5" :container="false" + :popperOptions="{ + modifiers: { + preventOverflow: { padding: 50, boundariesElement: 'viewport' }, + } + }" @show="replyEnter(status.in_reply_to_status_id)" >
From c9ba37ba2cb5871fbf31881842308f503b9852bb Mon Sep 17 00:00:00 2001 From: taehoon Date: Wed, 17 Jul 2019 13:01:42 -0400 Subject: [PATCH 13/25] fix eslint warnings --- src/components/status/status.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 1187c182..7053e2cb 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -177,12 +177,12 @@ Date: Wed, 17 Jul 2019 13:56:27 -0400 Subject: [PATCH 14/25] set different trigger event in desktop and mobile by default --- package.json | 1 + src/components/extra_buttons/extra_buttons.vue | 2 -- src/components/moderation_tools/moderation_tools.vue | 2 -- src/components/status/status.vue | 3 --- src/main.js | 9 ++++++++- yarn.lock | 5 +++++ 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f039d412..dabc4d11 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "diff": "^3.0.1", "karma-mocha-reporter": "^2.2.1", "localforage": "^1.5.0", + "mobile-detect": "^1.4.3", "object-path": "^0.11.3", "phoenix": "^1.3.0", "portal-vue": "^2.1.4", diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index 6781a4f8..746f1c91 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -4,8 +4,6 @@ trigger="click" placement="top" class="extra-button-popover" - :offset="5" - :container="false" >
From 237d95b0f73d9d20df0b8c4668110ce09a5527de Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 24 Oct 2019 23:50:50 -0400 Subject: [PATCH 25/25] remove needless ref --- src/components/status_popover/status_popover.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue index f570ea7a..eacf4c06 100644 --- a/src/components/status_popover/status_popover.vue +++ b/src/components/status_popover/status_popover.vue @@ -1,6 +1,5 @@