From f81d1b0eea497e392b81f5217d023a66e01ea9b3 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 23 Jun 2017 17:43:34 +0300 Subject: Fix long names overflowing and messing everything (now just overflowing parts not drawn), fix non-square avatars not drawn as squares. --- .../user_card_content/user_card_content.vue | 34 +++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src/components') diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index ff1b108c..37435ec2 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -5,8 +5,10 @@
-
{{user.name}}
-
@{{user.screen_name}}
+
+
{{user.name}}
+
@{{user.screen_name}}
+
@@ -135,33 +137,37 @@ align-content: flex-start; justify-content: center; max-height: 60px; + overflow: hidden; } img { - border: 2px solid; - border-radius: 5px; - flex: 1 0 100%; - max-width: 48px; - max-height: 48px; + border: 2px solid; + border-radius: 5px; + flex: 1 0 100%; + width: 48px; + height: 48px; + object-fit: cover; } text-shadow: 0px 1px 1.5px rgba(0, 0, 0, 1.0); - .user-name{ - margin-top: 0.0em; + .name-and-screen-name { + display: block; + margin-top: 0.0em; margin-left: 0.6em; - flex: 0 0 auto; - align-self: flex-start; + text-align: left; + text-overflow: ellipsis; + white-space: nowrap; + } + + .user-name{ } .user-screen-name { - margin-top: 0.0em; - margin-left: 0.6em; font-weight: lighter; font-size: 15px; padding-right: 0.1em; flex: 0 0 auto; - align-self: flex-start; } .user-interactions { -- cgit v1.2.3-70-g09d2 From da3b604d9dd525c2f0114d2ae3090b137d9bb267 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 27 Jul 2017 15:54:34 +0200 Subject: Fix too long words in profile. --- src/components/user_card_content/user_card_content.vue | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/components') diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index ff1b108c..2d361600 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -121,6 +121,8 @@ .profile-panel-body { top: -0em; padding-top: 4em; + + word-wrap: break-word; } .user-info { -- cgit v1.2.3-70-g09d2 From 86773579ed924e0a8a38eac4812f1bc10e353870 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 28 Jul 2017 11:19:56 +0200 Subject: Throttle getReplies so it isn't called that often. --- src/components/conversation/conversation.js | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/components') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 059028f9..701bfd93 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,4 @@ -import { find, filter, sortBy } from 'lodash' +import { find, filter, sortBy, throttle } from 'lodash' import { statusType } from '../../modules/statuses.js' import Status from '../status/status.vue' @@ -7,6 +7,21 @@ const sortAndFilterConversation = (conversation) => { return sortBy(conversation, 'id') } +const getReplies = function (id) { + let res = [] + id = Number(id) + let i + for (i = 0; i < this.conversation.length; i++) { + if (Number(this.conversation[i].in_reply_to_status_id) === id) { + res.push({ + name: `#${i}`, + id: this.conversation[i].id + }) + } + } + return res +} + const conversation = { data () { return { @@ -58,20 +73,7 @@ const conversation = { .then(() => this.fetchConversation()) } }, - getReplies (id) { - let res = [] - id = Number(id) - let i - for (i = 0; i < this.conversation.length; i++) { - if (Number(this.conversation[i].in_reply_to_status_id) === id) { - res.push({ - name: `#${i}`, - id: this.conversation[i].id - }) - } - } - return res - }, + getReplies: throttle(getReplies, 1000), focused (id) { if (this.statusoid.retweeted_status) { return (id === this.statusoid.retweeted_status.id) -- cgit v1.2.3-70-g09d2 From 9e61ab577b98643e6c0c88785f365c554b3ab8b1 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 28 Jul 2017 15:52:05 +0200 Subject: Revert "Throttle getReplies so it isn't called that often." This reverts commit 86773579ed924e0a8a38eac4812f1bc10e353870. --- src/components/conversation/conversation.js | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'src/components') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 701bfd93..059028f9 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,4 @@ -import { find, filter, sortBy, throttle } from 'lodash' +import { find, filter, sortBy } from 'lodash' import { statusType } from '../../modules/statuses.js' import Status from '../status/status.vue' @@ -7,21 +7,6 @@ const sortAndFilterConversation = (conversation) => { return sortBy(conversation, 'id') } -const getReplies = function (id) { - let res = [] - id = Number(id) - let i - for (i = 0; i < this.conversation.length; i++) { - if (Number(this.conversation[i].in_reply_to_status_id) === id) { - res.push({ - name: `#${i}`, - id: this.conversation[i].id - }) - } - } - return res -} - const conversation = { data () { return { @@ -73,7 +58,20 @@ const conversation = { .then(() => this.fetchConversation()) } }, - getReplies: throttle(getReplies, 1000), + getReplies (id) { + let res = [] + id = Number(id) + let i + for (i = 0; i < this.conversation.length; i++) { + if (Number(this.conversation[i].in_reply_to_status_id) === id) { + res.push({ + name: `#${i}`, + id: this.conversation[i].id + }) + } + } + return res + }, focused (id) { if (this.statusoid.retweeted_status) { return (id === this.statusoid.retweeted_status.id) -- cgit v1.2.3-70-g09d2 From 32e20b2e025e20f38b4acdea55a13a647463a9f1 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 29 Jul 2017 18:53:49 +0200 Subject: Only run through replies once. --- src/components/conversation/conversation.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/components') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 059028f9..4ee6c32e 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,4 @@ -import { find, filter, sortBy } from 'lodash' +import { reduce, find, filter, sortBy } from 'lodash' import { statusType } from '../../modules/statuses.js' import Status from '../status/status.vue' @@ -33,6 +33,19 @@ const conversation = { const statuses = this.$store.state.statuses.allStatuses const conversation = filter(statuses, { statusnet_conversation_id: conversationId }) return sortAndFilterConversation(conversation) + }, + replies () { + return reduce(this.conversation, (result, {id, in_reply_to_status_id}) => { + const irid = Number(in_reply_to_status_id) + if (irid) { + result[irid] = result[irid] || [] + result[irid].push({ + name: `#${id}`, + id: id + }) + } + return result + }, {}) } }, components: { @@ -59,18 +72,8 @@ const conversation = { } }, getReplies (id) { - let res = [] id = Number(id) - let i - for (i = 0; i < this.conversation.length; i++) { - if (Number(this.conversation[i].in_reply_to_status_id) === id) { - res.push({ - name: `#${i}`, - id: this.conversation[i].id - }) - } - } - return res + return this.replies[id] || [] }, focused (id) { if (this.statusoid.retweeted_status) { -- cgit v1.2.3-70-g09d2 From 9c5f001fd2bfd8a2d06e36f6dd1b7ac0c41e5cd2 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 29 Jul 2017 19:10:09 +0200 Subject: Add back relative numbering. --- src/components/conversation/conversation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 4ee6c32e..89fcfddb 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -35,15 +35,17 @@ const conversation = { return sortAndFilterConversation(conversation) }, replies () { + let i = 1 return reduce(this.conversation, (result, {id, in_reply_to_status_id}) => { const irid = Number(in_reply_to_status_id) if (irid) { result[irid] = result[irid] || [] result[irid].push({ - name: `#${id}`, + name: `#${i}`, id: id }) } + i++ return result }, {}) } -- cgit v1.2.3-70-g09d2 From 701112f043720c294241852f9aa0a0f1956cd71c Mon Sep 17 00:00:00 2001 From: eal Date: Thu, 10 Aug 2017 19:17:40 +0300 Subject: Add follow notifications. --- src/components/notifications/notifications.scss | 4 ++++ src/components/notifications/notifications.vue | 9 +++++++++ src/modules/statuses.js | 7 +++++++ 3 files changed, 20 insertions(+) (limited to 'src/components') diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index f02ced8d..84dd36fa 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -49,6 +49,10 @@ color: $green; } + .icon-user-plus.lit { + color: $blue; + } + .icon-reply.lit { color: $blue; } diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 6c0419a5..c9113bc4 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -36,6 +36,15 @@
+
+

+ {{ notification.action.user.name }} + +

+
+ @{{ notification.action.user.screen_name }} followed you +
+
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 084800fa..de5d7d23 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -105,6 +105,10 @@ export const statusType = (status) => { return 'deletion' } + if (status.text.match(/started following/)) { + return 'follow' + } + return 'unknown' } @@ -253,6 +257,9 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us favoriteStatus(favorite) } }, + 'follow': (status) => { + addNotification({ type: 'follow', status: status, action: status }) + }, 'deletion': (deletion) => { const uri = deletion.uri updateMaxId(deletion) -- cgit v1.2.3-70-g09d2