From 23e0ce59e610a1f3f49f3f53e0a1015530110120 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sat, 22 Feb 2020 09:42:22 -0600 Subject: [PATCH 1/9] Fix captcha input and disable ALL the helpers --- src/components/registration/registration.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index fdbda0077..a83ca1e52 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -187,6 +187,9 @@ class="form-control" type="text" autocomplete="off" + autocorrect="off" + autocapitalize="off" + spellcheck="false" > From ab4005add57f36cc78b774971f9942c5894362dc Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 2 Mar 2020 08:35:57 +0200 Subject: [PATCH 2/9] add status unavailable message when status can't be loaded in status preview --- src/components/status_popover/status_popover.js | 7 +++++++ src/components/status_popover/status_popover.vue | 10 ++++++++-- src/i18n/en.json | 3 ++- src/i18n/fi.json | 3 ++- src/modules/statuses.js | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js index cb55f67e9..159132a9e 100644 --- a/src/components/status_popover/status_popover.js +++ b/src/components/status_popover/status_popover.js @@ -5,6 +5,11 @@ const StatusPopover = { props: [ 'statusId' ], + data () { + return { + error: false + } + }, computed: { status () { return find(this.$store.state.statuses.allStatuses, { id: this.statusId }) @@ -18,6 +23,8 @@ const StatusPopover = { enter () { if (!this.status) { this.$store.dispatch('fetchStatus', this.statusId) + .then(data => (this.error = false)) + .catch(e => (this.error = true)) } } } diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue index 11f6cb5a0..f5948207f 100644 --- a/src/components/status_popover/status_popover.vue +++ b/src/components/status_popover/status_popover.vue @@ -17,9 +17,15 @@ :statusoid="status" :compact="true" /> +
+ {{ $t('status.status_unavailable') }} +
@@ -50,7 +56,7 @@ border: none; } - .status-preview-loading { + .status-preview-no-content { padding: 1em; text-align: center; diff --git a/src/i18n/en.json b/src/i18n/en.json index 82acc1ab5..54d0608ee 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -615,7 +615,8 @@ "reply_to": "Reply to", "replies_list": "Replies:", "mute_conversation": "Mute conversation", - "unmute_conversation": "Unmute conversation" + "unmute_conversation": "Unmute conversation", + "status_unavailable": "Status unavailable" }, "user_card": { "approve": "Approve", diff --git a/src/i18n/fi.json b/src/i18n/fi.json index ac8b2ac96..926e6087e 100644 --- a/src/i18n/fi.json +++ b/src/i18n/fi.json @@ -289,7 +289,8 @@ "reply_to": "Vastaus", "replies_list": "Vastaukset:", "mute_conversation": "Hiljennä keskustelu", - "unmute_conversation": "Poista hiljennys" + "unmute_conversation": "Poista hiljennys", + "status_unavailable": "Viesti ei saatavissa" }, "user_card": { "approve": "Hyväksy", diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 25b62ac7f..f1b7dcbda 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -616,7 +616,7 @@ const statuses = { commit('setNotificationsSilence', { value }) }, fetchStatus ({ rootState, dispatch }, id) { - rootState.api.backendInteractor.fetchStatus({ id }) + return rootState.api.backendInteractor.fetchStatus({ id }) .then((status) => dispatch('addNewStatuses', { statuses: [status] })) }, deleteStatus ({ rootState, commit }, status) { From 0702934f4f05595194c73cc463b2e72a27e3b1e2 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 4 Mar 2020 00:23:14 +0200 Subject: [PATCH 3/9] fix trasparency problems in some cases (purple headers) --- src/modules/config.js | 1 + src/services/theme_data/theme_data.service.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/config.js b/src/modules/config.js index e6b373b44..7997521da 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -102,6 +102,7 @@ const config = { setPreset(value) break case 'customTheme': + case 'customThemeSource': applyTheme(value) } } diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index e6ff82e61..de6561cd7 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -352,7 +352,8 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ } const opacitySlot = getOpacitySlot(key) const ownOpacitySlot = value.opacity - if (opacitySlot && (outputColor.a === undefined || ownOpacitySlot)) { + const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined + if (opacitySlot && (outputColor.a === undefined || opacityOverriden)) { const dependencySlot = deps[0] if (dependencySlot && colors[dependencySlot] === 'transparent') { outputColor.a = 0 From 147364b80cae7a0fac1ccf00b5669a20de1b7e67 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 4 Mar 2020 17:30:59 +0200 Subject: [PATCH 4/9] mention status preview fix in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1677a5ba6..24c193b98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Notifications column now cleans itself up to optimize performance when tab is left open for a long time - 403 messaging ### Fixed +- Fixed loader-spinner not disappearing when a status preview fails to load - anon viewers won't get theme data saved to local storage, so admin changing default theme will have an effect for users coming back to instance. - Single notifications left unread when hitting read on another device/tab - Registration fixed From 9f2c1b4008ef7bb77c98e80f75b41eaa9e92b90a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:17:24 +0200 Subject: [PATCH 5/9] fix several issues related to opacity --- src/services/theme_data/theme_data.service.js | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index de6561cd7..c3fdbd877 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -350,17 +350,43 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ if (!outputColor) { throw new Error('Couldn\'t generate color for ' + key) } - const opacitySlot = getOpacitySlot(key) + + const opacitySlot = value.opacity || getOpacitySlot(key) const ownOpacitySlot = value.opacity - const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined - if (opacitySlot && (outputColor.a === undefined || opacityOverriden)) { + + if (sourceColor === 'transparent') { + outputColor.a = 0 + } else if (ownOpacitySlot === null) { + outputColor.a = 1 + } else { + const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined + const dependencySlot = deps[0] - if (dependencySlot && colors[dependencySlot] === 'transparent') { - outputColor.a = 0 + const dependencyColor = dependencySlot && colors[dependencySlot] + + if (!ownOpacitySlot && dependencyColor && !value.textColor && ownOpacitySlot !== null) { + // Inheriting color from dependency (weird, i know) + // except if it's a text color or opacity slot is set to 'null' + outputColor.a = dependencyColor.a + } else if (!dependencyColor && !opacitySlot) { + // Remove any alpha channel if no dependency and no opacitySlot found + delete outputColor.a } else { - outputColor.a = Number(sourceOpacity[opacitySlot]) || OPACITIES[opacitySlot].defaultValue || 1 + // Otherwise try to assign opacity + if (dependencyColor && dependencyColor.a === 0) { + // transparent dependency shall make dependents transparent too + outputColor.a = 0 + } else { + // Otherwise check if opacity is overriden and use that or default value instead + outputColor.a = Number( + opacityOverriden + ? sourceOpacity[opacitySlot] + : (OPACITIES[opacitySlot] || {}).defaultValue + ) + } } } + if (opacitySlot) { return { colors: { ...colors, [key]: outputColor }, From 7aa5bf0896c045d5d4a4e19fe7eff2c61fd2acf9 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:20:42 +0200 Subject: [PATCH 6/9] prioritize disabled opacity over transparent keyword --- src/services/theme_data/theme_data.service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index c3fdbd877..44fb575ca 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -354,10 +354,10 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ const opacitySlot = value.opacity || getOpacitySlot(key) const ownOpacitySlot = value.opacity - if (sourceColor === 'transparent') { - outputColor.a = 0 - } else if (ownOpacitySlot === null) { + if (ownOpacitySlot === null) { outputColor.a = 1 + } else if (sourceColor === 'transparent') { + outputColor.a = 0 } else { const opacityOverriden = ownOpacitySlot && sourceOpacity[opacitySlot] !== undefined From 550080bd82bf39e35b2b481d8643bf1ac7461d7c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:39:17 +0200 Subject: [PATCH 7/9] fix last issue --- src/services/theme_data/theme_data.service.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index 44fb575ca..4d7e4f67c 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -384,6 +384,9 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ : (OPACITIES[opacitySlot] || {}).defaultValue ) } + if (Number.isNaN(outputColor.a)) { + outputColor.a = 1 + } } } From a485386a3b07f831859fcefa9cd429fc801fd8eb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2020 21:48:40 +0200 Subject: [PATCH 8/9] fix tests --- src/services/theme_data/theme_data.service.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index 4d7e4f67c..dd87e3cff 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -384,12 +384,13 @@ export const getColors = (sourceColors, sourceOpacity) => SLOT_ORDERED.reduce(({ : (OPACITIES[opacitySlot] || {}).defaultValue ) } - if (Number.isNaN(outputColor.a)) { - outputColor.a = 1 - } } } + if (Number.isNaN(outputColor.a) || outputColor.a === undefined) { + outputColor.a = 1 + } + if (opacitySlot) { return { colors: { ...colors, [key]: outputColor }, From b9820b84a14119f3a7a4e1f663927b1ad455a5c2 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 14 Mar 2020 19:41:38 +0000 Subject: [PATCH 9/9] Prevent overflow for long usernames/domains --- src/components/notifications/notifications.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index f5b133227..a8f4430f2 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -81,6 +81,7 @@ .follow-text, .move-text { padding: 0.5em 0; + overflow-wrap: break-word; } .status-el {