From c4352a1936b2bcb3ea4bf5534646ce39eec7e3e7 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 13 Aug 2024 22:51:17 +0300 Subject: [PATCH 01/16] cache emoji groups etc --- src/modules/instance.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index 99b8b5d5..2281141f 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -145,6 +145,10 @@ const defaultState = { quotingAvailable: false, groupActorAvailable: false, + // Emoji stuff + standardEmojiList: null, + standardEmojiGroupList: null, + // Html stuff instanceSpecificPanelContent: '', tos: '', @@ -246,15 +250,21 @@ const instance = { }, {}) }, standardEmojiList (state) { - return SORTED_EMOJI_GROUP_IDS - .map(groupId => (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations))) - .reduce((a, b) => a.concat(b), []) + if (!state.standardEmojiList) { + state.standardEmojiList = SORTED_EMOJI_GROUP_IDS + .map(groupId => (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations))) + .reduce((a, b) => a.concat(b), []) + } + return state.standardEmojiList }, standardEmojiGroupList (state) { - return SORTED_EMOJI_GROUP_IDS.map(groupId => ({ - id: groupId, - emojis: (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations)) - })) + if (!state.standardEmojiGroupList) { + state.standardEmojiGroupList = SORTED_EMOJI_GROUP_IDS.map(groupId => ({ + id: groupId, + emojis: (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations)) + })) + } + return state.standardEmojiGroupList }, instanceDomain (state) { return new URL(state.server).hostname From 99490cdb21d577024a718084529c4ecd8079a557 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 13 Aug 2024 23:54:18 +0300 Subject: [PATCH 02/16] speed up emoji picker somewhat --- src/components/emoji_picker/emoji_picker.js | 4 +++- src/components/emoji_picker/emoji_picker.vue | 1 + src/modules/instance.js | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index d71bc1bb..9ea5c877 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -150,7 +150,9 @@ const EmojiPicker = { }, showPicker () { this.$refs.popover.showPopover() - this.onShowing() + this.$nextTick(() => { + this.onShowing() + }) }, hidePicker () { this.$refs.popover.hidePopover() diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index 7c36deaa..a3dc8f9e 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -89,6 +89,7 @@ class="emoji-groups" :class="groupsScrolledClass" :min-item-size="minItemSize" + :buffer="minItemSize" :items="emojiItems" :emit-update="true" @update="onScroll" diff --git a/src/modules/instance.js b/src/modules/instance.js index 2281141f..cc114505 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -374,6 +374,8 @@ const instance = { // should have been "pack" field, that would be more useful }).sort(byPackThenByName) commit('setInstanceOption', { name: 'customEmoji', value: emoji }) + state.standardEmojiGroupList = null + state.standardEmojiList = null } else { throw (res) } From cfba4cc6b3a560d37a063db36dcae507bfd6bf4f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 14 Aug 2024 00:08:56 +0300 Subject: [PATCH 03/16] don't do no-auto for themes2 seems to work better --- src/services/theme_data/theme2_to_theme3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js index 95eb03c1..f654461d 100644 --- a/src/services/theme_data/theme2_to_theme3.js +++ b/src/services/theme_data/theme2_to_theme3.js @@ -351,6 +351,7 @@ export const convertTheme2To3 = (data) => { newRules.push({ ...rule, parent: { component: 'Notification' } }) } if (key === 'buttonPressed') { + console.log(key) newRules.push({ ...rule, state: ['toggled'] }) newRules.push({ ...rule, state: ['toggled', 'focus'] }) newRules.push({ ...rule, state: ['pressed', 'focus'] }) @@ -418,7 +419,6 @@ export const convertTheme2To3 = (data) => { case 'Border': newRule.parent = rule newRule.directives.textColor = data.colors[key] - newRule.directives.textAuto = 'no-auto' variantArray = parts.slice(0, -1) break default: From 1b371afff375adcf05e30ec9fd8ac9c2d20b807a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 14 Aug 2024 00:40:16 +0300 Subject: [PATCH 04/16] fix instance theme not applying --- src/boot/after_store.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index a486bd4c..6cad05f6 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -122,6 +122,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { store.dispatch('setInstanceOption', { name, value: config[name] }) } + copyInstanceOption('theme') copyInstanceOption('nsfwCensorImage') copyInstanceOption('background') copyInstanceOption('hidePostStats') From 1f50fc2a8b3b06aaeae90bdb6e5e3bef621698dc Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 00:06:32 +0300 Subject: [PATCH 05/16] oops --- src/modules/instance.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index cc114505..2281141f 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -374,8 +374,6 @@ const instance = { // should have been "pack" field, that would be more useful }).sort(byPackThenByName) commit('setInstanceOption', { name: 'customEmoji', value: emoji }) - state.standardEmojiGroupList = null - state.standardEmojiList = null } else { throw (res) } From 5ad4d82b6b7f7f82be010f4ecda693625bbc243e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 00:57:23 +0300 Subject: [PATCH 06/16] try to fix gaps --- src/components/timeline/timeline.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/timeline/timeline.scss b/src/components/timeline/timeline.scss index 0fc0d979..61261d32 100644 --- a/src/components/timeline/timeline.scss +++ b/src/components/timeline/timeline.scss @@ -4,6 +4,12 @@ backdrop-filter: none; } + /* This is to fix the occasional gaps/weird lines in timeline */ + .timeline { + display: flex; + flex-direction: column; + } + .alert-badge { font-size: 0.75em; line-height: 1; From 8b87d548acaeb3b55fe9b4227df3e5d4ca672a01 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 01:01:31 +0300 Subject: [PATCH 07/16] didn't work, lol --- src/components/timeline/timeline.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/components/timeline/timeline.scss b/src/components/timeline/timeline.scss index 61261d32..0fc0d979 100644 --- a/src/components/timeline/timeline.scss +++ b/src/components/timeline/timeline.scss @@ -4,12 +4,6 @@ backdrop-filter: none; } - /* This is to fix the occasional gaps/weird lines in timeline */ - .timeline { - display: flex; - flex-direction: column; - } - .alert-badge { font-size: 0.75em; line-height: 1; From 482f353f4d01a4beeced0c7fe9ea915589643dec Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 11:35:33 +0300 Subject: [PATCH 08/16] make posts have highlight on higher level --- src/components/status/status.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 61a58cda..a8cef3c1 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -3,7 +3,8 @@ v-if="!hideStatus" ref="root" class="Status" - :class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }]" + :class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }, userClass, { highlighted: userStyle, '-repeat': retweet && !inConversation }]" + :style="[ userStyle ]" >
From 5384d3b7a2d006d5d760680170b9998bf115862a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 20:43:11 +0300 Subject: [PATCH 09/16] fix solid color highlight --- src/services/user_highlighter/user_highlighter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/user_highlighter/user_highlighter.js b/src/services/user_highlighter/user_highlighter.js index b5f58040..145b3e5e 100644 --- a/src/services/user_highlighter/user_highlighter.js +++ b/src/services/user_highlighter/user_highlighter.js @@ -27,7 +27,11 @@ const highlightStyle = (prefs) => { } } else if (type === 'solid') { return { - backgroundColor: tintColor2, + backgroundImage: [ + 'repeating-linear-gradient(90deg,', + `${tintColor} ,`, + `${tintColor} 20px` + ].join(' '), ...customProps } } else if (type === 'side') { From a9c2d373157708c9d08289edb55069a9a054a7e6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 21:49:45 +0300 Subject: [PATCH 10/16] ok i'm dumb, no manual caching needed tehepero --- src/modules/instance.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index 2281141f..7ec7a5df 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -250,21 +250,15 @@ const instance = { }, {}) }, standardEmojiList (state) { - if (!state.standardEmojiList) { - state.standardEmojiList = SORTED_EMOJI_GROUP_IDS - .map(groupId => (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations))) - .reduce((a, b) => a.concat(b), []) - } - return state.standardEmojiList + return SORTED_EMOJI_GROUP_IDS + .map(groupId => (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations))) + .reduce((a, b) => a.concat(b), []) }, standardEmojiGroupList (state) { - if (!state.standardEmojiGroupList) { - state.standardEmojiGroupList = SORTED_EMOJI_GROUP_IDS.map(groupId => ({ - id: groupId, - emojis: (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations)) - })) - } - return state.standardEmojiGroupList + return SORTED_EMOJI_GROUP_IDS.map(groupId => ({ + id: groupId, + emojis: (state.emoji[groupId] || []).map(k => injectAnnotations(k, state.unicodeEmojiAnnotations)) + })) }, instanceDomain (state) { return new URL(state.server).hostname From ab90dc9fb1785d237be5fa3ff207056d7935ddaf Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 15 Aug 2024 21:53:12 +0300 Subject: [PATCH 11/16] Revert all the user highlight stuff for now --- src/components/status/status.vue | 5 +++-- src/services/user_highlighter/user_highlighter.js | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index a8cef3c1..61a58cda 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -3,8 +3,7 @@ v-if="!hideStatus" ref="root" class="Status" - :class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }, userClass, { highlighted: userStyle, '-repeat': retweet && !inConversation }]" - :style="[ userStyle ]" + :class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }]" >
diff --git a/src/services/user_highlighter/user_highlighter.js b/src/services/user_highlighter/user_highlighter.js index 145b3e5e..b5f58040 100644 --- a/src/services/user_highlighter/user_highlighter.js +++ b/src/services/user_highlighter/user_highlighter.js @@ -27,11 +27,7 @@ const highlightStyle = (prefs) => { } } else if (type === 'solid') { return { - backgroundImage: [ - 'repeating-linear-gradient(90deg,', - `${tintColor} ,`, - `${tintColor} 20px` - ].join(' '), + backgroundColor: tintColor2, ...customProps } } else if (type === 'side') { From f5fbf9af6420c59957530047a62c72dd80b7a462 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 28 Aug 2024 23:54:46 +0300 Subject: [PATCH 12/16] fix nested panel headers --- src/components/timeline/timeline.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/timeline/timeline.scss b/src/components/timeline/timeline.scss index 0fc0d979..2dd66328 100644 --- a/src/components/timeline/timeline.scss +++ b/src/components/timeline/timeline.scss @@ -26,7 +26,7 @@ } .conversation-heading { - top: calc(var(--__panel-heading-height) * var(--currentPanelStack, 2)); + top: calc(var(--__panel-heading-height) * var(--currentPanelStack, 1) + var(--navbar-height)); z-index: 2; } From e7741e619da229726f9a2bde8c3bd6d50c7e5f3b Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Wed, 28 Aug 2024 21:17:37 +0000 Subject: [PATCH 13/16] Apply 1 suggestion(s) to 1 file(s) --- src/services/theme_data/theme2_to_theme3.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js index f654461d..bcc0c961 100644 --- a/src/services/theme_data/theme2_to_theme3.js +++ b/src/services/theme_data/theme2_to_theme3.js @@ -351,7 +351,6 @@ export const convertTheme2To3 = (data) => { newRules.push({ ...rule, parent: { component: 'Notification' } }) } if (key === 'buttonPressed') { - console.log(key) newRules.push({ ...rule, state: ['toggled'] }) newRules.push({ ...rule, state: ['toggled', 'focus'] }) newRules.push({ ...rule, state: ['pressed', 'focus'] }) From 87fe063cb656433efb796c3682e4b211e8ff7ba6 Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Wed, 28 Aug 2024 21:18:35 +0000 Subject: [PATCH 14/16] Apply 1 suggestion(s) to 1 file(s) --- src/modules/instance.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index 7ec7a5df..99b8b5d5 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -145,10 +145,6 @@ const defaultState = { quotingAvailable: false, groupActorAvailable: false, - // Emoji stuff - standardEmojiList: null, - standardEmojiGroupList: null, - // Html stuff instanceSpecificPanelContent: '', tos: '', From 06ebbaf7ba2261d0a1c3c564dcdb5eb5fe32a782 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sun, 4 Aug 2024 15:17:48 -0400 Subject: [PATCH 15/16] Simplify the OAuth client_name Every time PleromaFE is used to login it will need to do the OAuth dance and request an app key. If the client name is not stable it will pollute the server's database with entries. This also happens on every unauthenticated page load at the moment until #1339 is resolved --- changelog.d/oauth-app-name.change | 1 + src/services/new_api/oauth.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog.d/oauth-app-name.change diff --git a/changelog.d/oauth-app-name.change b/changelog.d/oauth-app-name.change new file mode 100644 index 00000000..15d6f87e --- /dev/null +++ b/changelog.d/oauth-app-name.change @@ -0,0 +1 @@ +Simplify the OAuth client_name to 'PleromaFE' diff --git a/src/services/new_api/oauth.js b/src/services/new_api/oauth.js index 3c8e64bd..a4b7cbf0 100644 --- a/src/services/new_api/oauth.js +++ b/src/services/new_api/oauth.js @@ -10,7 +10,8 @@ export const getOrCreateApp = ({ clientId, clientSecret, instance, commit }) => const url = `${instance}/api/v1/apps` const form = new window.FormData() - form.append('client_name', `PleromaFE_${window.___pleromafe_commit_hash}_${(new Date()).toISOString()}`) + form.append('client_name', 'PleromaFE') + form.append('website', 'https://pleroma.social') form.append('redirect_uris', REDIRECT_URI) form.append('scopes', 'read write follow push admin') From 50b2e73efafad830812cb41ee3655fb7dc334232 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 4 Sep 2024 17:02:08 +0300 Subject: [PATCH 16/16] 2.7.1 release --- CHANGELOG.md | 13 +++++++++++++ changelog.d/oauth-app-name.change | 1 - package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) delete mode 100644 changelog.d/oauth-app-name.change diff --git a/CHANGELOG.md b/CHANGELOG.md index 445308d1..9844319e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## 2.7.1 +Bugfix release. Added small optimizations to emoji picker that should make it a bit more responsive, however it needs rather large change to make it more performant which might come in a major release. + +### Fixed +- Instance default theme not respected +- Nested panel header having wrong sticky position if navbar height != panel header height +- Toggled buttons having bad contrast (when using v2 theme) + +### Changed +- Simplify the OAuth client_name to 'PleromaFE' +- Small optimizations to emoji picker + + ## 2.7.0 ### Known issues diff --git a/changelog.d/oauth-app-name.change b/changelog.d/oauth-app-name.change deleted file mode 100644 index 15d6f87e..00000000 --- a/changelog.d/oauth-app-name.change +++ /dev/null @@ -1 +0,0 @@ -Simplify the OAuth client_name to 'PleromaFE' diff --git a/package.json b/package.json index 82255914..45b04660 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pleroma_fe", - "version": "2.7.0", + "version": "2.7.1", "description": "Pleroma frontend, the default frontend of Pleroma social network server", "author": "Pleroma contributors ", "private": false,