From 29dae3c12e9533f9d9b8ce058686f9a6a47719ad Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:03:29 +0200 Subject: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fbb3575..0abc3929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Added reason field for registration when approval is required +- Added option to mark posts as sensitive by default ## [2.2.3] - 2021-01-18 ### Added -- cgit v1.2.3-70-g09d2 From 34d18ac0c4e1903cb174df8957b855a048ec6b7e Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 25 Feb 2021 17:27:29 +0200 Subject: focus input in emoji picker and react picker --- CHANGELOG.md | 1 + src/components/emoji_input/emoji_input.js | 8 ++++++++ src/components/popover/popover.js | 7 +++++-- src/components/react_button/react_button.js | 6 ++++++ src/components/react_button/react_button.vue | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fbb3575..ae7e0daf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls - Optimized chat to not get horrible performance after keeping the same chat open for a long time +- When opening emoji picker or react picker, it automatically focuses the search field ### Added - Added reason field for registration when approval is required diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index 2068a598..cda2382e 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -194,11 +194,18 @@ const EmojiInput = { } }, methods: { + focusPickerInput () { + const pickerEl = this.$refs.picker.$el + if (!pickerEl) return + const pickerInput = pickerEl.querySelector('input') + if (pickerInput) pickerInput.focus() + }, triggerShowPicker () { this.showPicker = true this.$refs.picker.startEmojiLoad() this.$nextTick(() => { this.scrollIntoView() + this.focusPickerInput() }) // This temporarily disables "click outside" handler // since external trigger also means click originates @@ -214,6 +221,7 @@ const EmojiInput = { if (this.showPicker) { this.scrollIntoView() this.$refs.picker.startEmojiLoad() + this.$nextTick(() => this.focusPickerInput()) } }, replace (replacement) { diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js index 5e417fa0..bfe39212 100644 --- a/src/components/popover/popover.js +++ b/src/components/popover/popover.js @@ -121,9 +121,12 @@ const Popover = { } }, showPopover () { - if (this.hidden) this.$emit('show') + const wasHidden = this.hidden this.hidden = false - this.$nextTick(this.updateStyles) + this.$nextTick(() => { + if (wasHidden) this.$emit('show') + this.updateStyles() + }) }, hidePopover () { if (!this.hidden) this.$emit('close') diff --git a/src/components/react_button/react_button.js b/src/components/react_button/react_button.js index 5e7b7580..ce82c90d 100644 --- a/src/components/react_button/react_button.js +++ b/src/components/react_button/react_button.js @@ -23,6 +23,12 @@ const ReactButton = { this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji }) } close() + }, + focusInput () { + this.$nextTick(() => { + const input = this.$el.querySelector('input') + if (input) input.focus() + }) } }, computed: { diff --git a/src/components/react_button/react_button.vue b/src/components/react_button/react_button.vue index 04734674..4839024c 100644 --- a/src/components/react_button/react_button.vue +++ b/src/components/react_button/react_button.vue @@ -6,6 +6,7 @@ :offset="{ y: 5 }" :bound-to="{ x: 'container' }" remove-padding + @show="focusInput" >
Date: Fri, 26 Feb 2021 11:03:26 +0200 Subject: changelog mention --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fbb3575..dbba715c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed shoutbox not working in mobile layout - Fixed missing highlighted border in expanded conversations again - Fixed some UI jumpiness when opening images particularly in chat view +- Fixed chat unread badge looking weird ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls -- cgit v1.2.3-70-g09d2 From cd2f5ced31a3598eb8a1fcdeef47d70dabf8bb00 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 26 Feb 2021 14:27:25 +0200 Subject: add basic validation for statusless status notifications --- CHANGELOG.md | 1 + src/modules/statuses.js | 29 ++++++++++++++++------ .../notification_utils/notification_utils.js | 7 ++++++ 3 files changed, 30 insertions(+), 7 deletions(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2685fd32..929292f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed missing highlighted border in expanded conversations again - Fixed some UI jumpiness when opening images particularly in chat view - Fixed chat unread badge looking weird +- Fixed notifications crashing on an invalid notificaiton ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 33c68c57..ac5d25c4 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -13,7 +13,11 @@ import { omitBy } from 'lodash' import { set } from 'vue' -import { isStatusNotification, maybeShowNotification } from '../services/notification_utils/notification_utils.js' +import { + isStatusNotification, + isValidNotification, + maybeShowNotification +} from '../services/notification_utils/notification_utils.js' import apiService from '../services/api/api.service.js' const emptyTl = (userId = 0) => ({ @@ -310,8 +314,24 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us } } +const updateNotificationsMinMaxId = (state, notification) => { + state.notifications.maxId = notification.id > state.notifications.maxId + ? notification.id + : state.notifications.maxId + state.notifications.minId = notification.id < state.notifications.minId + ? notification.id + : state.notifications.minId +} + const addNewNotifications = (state, { dispatch, notifications, older, visibleNotificationTypes, rootGetters, newNotificationSideEffects }) => { each(notifications, (notification) => { + // If invalid notification, update ids but don't add it to store + if (!isValidNotification(notification)) { + console.error('Invalid notification:', notification) + updateNotificationsMinMaxId(state, notification) + return + } + if (isStatusNotification(notification.type)) { notification.action = addStatusToGlobalStorage(state, notification.action).item notification.status = notification.status && addStatusToGlobalStorage(state, notification.status).item @@ -323,12 +343,7 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot // Only add a new notification if we don't have one for the same action if (!state.notifications.idStore.hasOwnProperty(notification.id)) { - state.notifications.maxId = notification.id > state.notifications.maxId - ? notification.id - : state.notifications.maxId - state.notifications.minId = notification.id < state.notifications.minId - ? notification.id - : state.notifications.minId + updateNotificationsMinMaxId(state, notification) state.notifications.data.push(notification) state.notifications.idStore[notification.id] = notification diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js index d912d19f..6fef1022 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -22,6 +22,13 @@ const statusNotifications = ['like', 'mention', 'repeat', 'pleroma:emoji_reactio export const isStatusNotification = (type) => includes(statusNotifications, type) +export const isValidNotification = (notification) => { + if (isStatusNotification(notification.type) && !notification.status) { + return false + } + return true +} + const sortById = (a, b) => { const seqA = Number(a.id) const seqB = Number(b.id) -- cgit v1.2.3-70-g09d2 From 7c37f495f649f5ad1fd7c536279fb09f26dd9a98 Mon Sep 17 00:00:00 2001 From: Shpuld Shpludson Date: Fri, 26 Feb 2021 12:36:58 +0000 Subject: Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 929292f5..270e957d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed missing highlighted border in expanded conversations again - Fixed some UI jumpiness when opening images particularly in chat view - Fixed chat unread badge looking weird -- Fixed notifications crashing on an invalid notificaiton +- Fixed notifications crashing on an invalid notification ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls -- cgit v1.2.3-70-g09d2 From 09fe160e8b9fad7a8c70e44ae894d67211b993e1 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 26 Feb 2021 16:23:11 +0200 Subject: separate screen_name and screen_name_ui with decoded punycode --- CHANGELOG.md | 1 + src/components/basic_user_card/basic_user_card.vue | 2 +- src/components/chat/chat.js | 2 +- src/components/chat_title/chat_title.js | 2 +- src/components/emoji_input/suggestor.js | 4 ++-- src/components/notification/notification.vue | 10 +++++----- src/components/status/status.js | 4 ++-- src/components/status/status.vue | 6 +++--- src/components/user_avatar/user_avatar.vue | 4 ++-- src/components/user_card/user_card.vue | 4 ++-- src/components/user_list_popover/user_list_popover.vue | 2 +- src/components/user_reporting_modal/user_reporting_modal.vue | 2 +- src/services/entity_normalizer/entity_normalizer.service.js | 5 +++-- .../specs/services/entity_normalizer/entity_normalizer.spec.js | 2 +- 14 files changed, 26 insertions(+), 24 deletions(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2685fd32..20d96f98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed missing highlighted border in expanded conversations again - Fixed some UI jumpiness when opening images particularly in chat view - Fixed chat unread badge looking weird +- Fixed punycode names not working properly ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue index 9e410610..c53f6a9c 100644 --- a/src/components/basic_user_card/basic_user_card.vue +++ b/src/components/basic_user_card/basic_user_card.vue @@ -42,7 +42,7 @@ class="basic-user-card-screen-name" :to="userProfileLink(user)" > - @{{ user.screen_name }} + @{{ user.screen_name_ui }}
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index 2780be75..b54f5fb2 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -73,7 +73,7 @@ const Chat = { }, formPlaceholder () { if (this.recipient) { - return this.$t('chats.message_user', { nickname: this.recipient.screen_name }) + return this.$t('chats.message_user', { nickname: this.recipient.screen_name_ui }) } else { return '' } diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js index e424bb1f..edfbe7a4 100644 --- a/src/components/chat_title/chat_title.js +++ b/src/components/chat_title/chat_title.js @@ -12,7 +12,7 @@ export default Vue.component('chat-title', { ], computed: { title () { - return this.user ? this.user.screen_name : '' + return this.user ? this.user.screen_name_ui : '' }, htmlTitle () { return this.user ? this.user.name_html : '' diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index 14a2b41e..e8efbd1e 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -116,8 +116,8 @@ export const suggestUsers = ({ dispatch, state }) => { return diff + nameAlphabetically + screenNameAlphabetically /* eslint-disable camelcase */ - }).map(({ screen_name, name, profile_image_url_original }) => ({ - displayText: screen_name, + }).map(({ screen_name, screen_name_ui, name, profile_image_url_original }) => ({ + displayText: screen_name_ui, detailText: name, imageUrl: profile_image_url_original, replacement: '@' + screen_name + ' ' diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index f56aa977..0081dee4 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -11,7 +11,7 @@ > - {{ notification.from_profile.screen_name }} + {{ notification.from_profile.screen_name_ui }}