From dd897350081bd256c636ec5117a5edd577406ec7 Mon Sep 17 00:00:00 2001 From: Norm Date: Fri, 9 Sep 2022 23:05:10 +0000 Subject: [PATCH 01/19] Delete '.gitlab-ci.yml' This file obviously doesn't serve a purpose since we're not using Gitlab CI. --- .gitlab-ci.yml | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ab601173..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This file is a template, and might need editing before it works on your project. -# Official framework image. Look for the different tagged releases at: -# https://hub.docker.com/r/library/node/tags/ -image: node:12 - -stages: - - lint - - build - - test - - deploy - -lint: - stage: lint - script: - - yarn - - npm run lint - - npm run stylelint - -test: - stage: test - variables: - APT_CACHE_DIR: apt-cache - script: - - mkdir -pv $APT_CACHE_DIR && apt-get -qq update - - apt install firefox-esr -y --no-install-recommends - - firefox --version - - yarn - - yarn unit - -build: - stage: build - script: - - yarn - - npm run build - artifacts: - paths: - - dist/ - -docs-deploy: - stage: deploy - image: alpine:latest - only: - - develop@pleroma/pleroma-fe - before_script: - - apk add curl - script: - - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline From f628483499a2222acef43b5f8f48ef37e951d1ff Mon Sep 17 00:00:00 2001 From: floatingghost Date: Mon, 12 Sep 2022 15:47:53 +0000 Subject: [PATCH 02/19] translation parameterisation (#165) Co-authored-by: FloatingGhost Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/165 --- package.json | 2 +- src/components/status_body/status_body.vue | 4 +- src/i18n/en.json | 68 ++++++++++++++++++++++ src/i18n/ja_pedantic.json | 8 +++ yarn.lock | 67 ++++++++++++--------- 5 files changed, 119 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index dcde025a..1987f1b8 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "qrcode": "1", "ruffle-mirror": "2021.12.31", "vue": "^3.2.31", - "vue-i18n": "^9.2.0-beta.39", + "vue-i18n": "^9.2.2", "vue-router": "4.0.14", "vue-template-compiler": "2.6.11", "vuex": "4.0.2" diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue index ed19261d..509aa856 100644 --- a/src/components/status_body/status_body.vue +++ b/src/components/status_body/status_body.vue @@ -60,7 +60,7 @@ v-if="status.translation" class="translation" > -

{{ $t('status.translated_from', { language: status.translation.detected_language }) }}

+

{{ $t(`languages.translated_from.${status.translation.detected_language.toLowerCase()}`) }}

- {{ language.label }} + {{ $t(`languages.${language.value.toLowerCase()}`) }} {{ ' ' }} diff --git a/src/i18n/en.json b/src/i18n/en.json index afcb640d..e168994b 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -164,6 +164,74 @@ "load_older": "Load older interactions", "moves": "User migrates" }, + "languages": { + "bg": "Bulgarian", + "en": "English", + "ar": "Arabic", + "az": "Azerbaijani", + "zh": "Chinese", + "cs": "Czech", + "da": "Danish", + "nl": "Dutch", + "eo": "Esperanto", + "fi": "Finnish", + "fr": "French", + "de": "German", + "el": "Greek", + "he": "Hebrew", + "hi": "Hindi", + "hu": "Hungarian", + "id": "Indonesian", + "ga": "Irish", + "it": "Italian", + "ja": "Japanese", + "ko": "Korean", + "fa": "Persian", + "pl": "Polish", + "pt": "Portuguese", + "ru": "Russian", + "sk": "Slovak", + "es": "Spanish", + "sv": "Swedish", + "tr": "Turkish", + "uk": "Ukrainian", + "lt": "Lithuanian", + "lv": "Latvian", + "translated_from": { + "bg": "Translated from @:languages.bg", + "en": "Translated from @:languages.en", + "ar": "Translated from @:languages.ar", + "az": "Translated from @:languages.az", + "zh": "Translated from @:languages.zh", + "cs": "Translated from @:languages.cs", + "da": "Translated from @:languages.da", + "nl": "Translated from @:languages.nl", + "eo": "Translated from @:languages.eo", + "fi": "Translated from @:languages.fi", + "fr": "Translated from @:languages.fr", + "de": "Translated from @:languages.de", + "el": "Translated from @:languages.el", + "he": "Translated from @:languages.he", + "hi": "Translated from @:languages.hi", + "hu": "Translated from @:languages.hu", + "id": "Translated from @:languages.id", + "ga": "Translated from @:languages.ga", + "it": "Translated from @:languages.it", + "ja": "Translated from @:languages.ja", + "ko": "Translated from @:languages.ko", + "fa": "Translated from @:languages.fa", + "pl": "Translated from @:languages.pl", + "pt": "Translated from @:languages.pt", + "ru": "Translated from @:languages.ru", + "sk": "Translated from @:languages.sk", + "es": "Translated from @:languages.es", + "sv": "Translated from @:languages.sv", + "tr": "Translated from @:languages.tr", + "uk": "Translated from @:languages.uk", + "lt": "Translated from @:languages.lt", + "lv": "Translated from @:languages.lv" + } + }, "lists": { "create": "Create", "delete": "Delete list", diff --git a/src/i18n/ja_pedantic.json b/src/i18n/ja_pedantic.json index 65c7e282..6b475eea 100644 --- a/src/i18n/ja_pedantic.json +++ b/src/i18n/ja_pedantic.json @@ -164,6 +164,14 @@ "load_older": "古いインタラクションを見る", "moves": "ユーザーの引っ越し" }, + "languages": { + "en": "英語", + "ja": "日本語", + "zh": "中国語", + "translated_from": { + "en": "英語から翻訳しました" + } + }, "lists": { "create": "作成", "delete": "削除", diff --git a/yarn.lock b/yarn.lock index 5961b770..facfb5f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1156,24 +1156,32 @@ source-map "0.6.1" yaml-eslint-parser "^0.3.2" -"@intlify/core-base@9.2.0-beta.40": - version "9.2.0-beta.40" - resolved "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-9.2.0-beta.40.tgz#85df2e183b2102716c5d40795848fc2359354580" - integrity sha512-vOR0lHgtJ3IkzvXLeMQeNeYreFSKG9v3SU8QOD//WKHdBy4QPISs9CZJkYzBeBVCJVZ/eM6OTSbXF8M2k53iCw== +"@intlify/core-base@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-9.2.2.tgz#5353369b05cc9fe35cab95fe20afeb8a4481f939" + integrity sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA== dependencies: - "@intlify/devtools-if" "9.2.0-beta.40" - "@intlify/message-compiler" "9.2.0-beta.40" - "@intlify/shared" "9.2.0-beta.40" - "@intlify/vue-devtools" "9.2.0-beta.40" + "@intlify/devtools-if" "9.2.2" + "@intlify/message-compiler" "9.2.2" + "@intlify/shared" "9.2.2" + "@intlify/vue-devtools" "9.2.2" -"@intlify/devtools-if@9.2.0-beta.40": - version "9.2.0-beta.40" - resolved "https://registry.yarnpkg.com/@intlify/devtools-if/-/devtools-if-9.2.0-beta.40.tgz#bee42fefaaaa590aa5ac7fe2a98777fb84bfaf5e" - integrity sha512-EUiuLxlgortD1dhT0btm3YYIs2vk9kMdcGXiYYbHWRTylc8Iv7Yz47y5Y+IlbZzk51h/nYvuqXE1h9diZZWAvQ== +"@intlify/devtools-if@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@intlify/devtools-if/-/devtools-if-9.2.2.tgz#b13d9ac4b4e2fe6d2e7daa556517a8061fe8bd39" + integrity sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg== dependencies: - "@intlify/shared" "9.2.0-beta.40" + "@intlify/shared" "9.2.2" -"@intlify/message-compiler@9.2.0-beta.40", "@intlify/message-compiler@next": +"@intlify/message-compiler@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-9.2.2.tgz#e42ab6939b8ae5b3d21faf6a44045667a18bba1c" + integrity sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA== + dependencies: + "@intlify/shared" "9.2.2" + source-map "0.6.1" + +"@intlify/message-compiler@next": version "9.2.0-beta.40" resolved "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-9.2.0-beta.40.tgz#d5d0c5652b9e74e0b4da07a2b8731e1f0e729029" integrity sha512-6QWTSYewmkew4nsRqgkwTVuGFKzxVCOK8EXsPt15N+tN1g+OYjC3PfGA2dPB6cVkNxqA9mV/hNK02uHPWU9t0A== @@ -1186,13 +1194,18 @@ resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.2.0-beta.40.tgz#a850936008e6e865310b2a49136d494dd326faab" integrity sha512-xWz+SFjgt/LfaSbbHVn+V7gmvX4ZNP3cIFta790GWZ/tEgwJeC3tkV7i45iUbZ4ZimOerFgKH05b7qvJlKb6RQ== -"@intlify/vue-devtools@9.2.0-beta.40": - version "9.2.0-beta.40" - resolved "https://registry.yarnpkg.com/@intlify/vue-devtools/-/vue-devtools-9.2.0-beta.40.tgz#37457fd719b0b6afb0679c33ceb47b0ac77f457c" - integrity sha512-3A0D/E9quf+KWonzXUDk3xNP0+d1DMdtAwyXNTjzFcQPvjugC2Xn6fmsd0kNn7nHjgpB+vwIuamGiuE+S+OULw== +"@intlify/shared@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.2.2.tgz#5011be9ca2b4ab86f8660739286e2707f9abb4a5" + integrity sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q== + +"@intlify/vue-devtools@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@intlify/vue-devtools/-/vue-devtools-9.2.2.tgz#b95701556daf7ebb3a2d45aa3ae9e6415aed8317" + integrity sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg== dependencies: - "@intlify/core-base" "9.2.0-beta.40" - "@intlify/shared" "9.2.0-beta.40" + "@intlify/core-base" "9.2.2" + "@intlify/shared" "9.2.2" "@intlify/vue-i18n-loader@^5.0.0": version "5.0.0" @@ -11415,14 +11428,14 @@ vue-eslint-parser@^5.0.0: esquery "^1.0.1" lodash "^4.17.11" -vue-i18n@^9.2.0-beta.39: - version "9.2.0-beta.40" - resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-9.2.0-beta.40.tgz#8088b19d619f47bf0e0f529f9bd1413460f2ff56" - integrity sha512-UwcGsbTTaDJry6BbFFzt115EVHN/bXi07DyUIZ4zrYeGMBPp2QAptMwVaGUQid1gaMmUreAKarGIqw46oCQEvg== +vue-i18n@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-9.2.2.tgz#aeb49d9424923c77e0d6441e3f21dafcecd0e666" + integrity sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ== dependencies: - "@intlify/core-base" "9.2.0-beta.40" - "@intlify/shared" "9.2.0-beta.40" - "@intlify/vue-devtools" "9.2.0-beta.40" + "@intlify/core-base" "9.2.2" + "@intlify/shared" "9.2.2" + "@intlify/vue-devtools" "9.2.2" "@vue/devtools-api" "^6.2.1" vue-loader@^16.0.0: From b936506f4774a08a44e5ba23ccff965d7a566c24 Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Wed, 14 Sep 2022 21:44:29 +0300 Subject: [PATCH 03/19] Hide mentions of bubble timeline if empty --- src/components/about/about.js | 3 +++ src/components/about/about.vue | 2 +- src/components/timeline_menu/timeline_menu.vue | 1 - src/components/timeline_menu/timeline_menu_content.js | 3 ++- src/components/timeline_menu/timeline_menu_content.vue | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/about/about.js b/src/components/about/about.js index e69bf8f9..7998c2d3 100644 --- a/src/components/about/about.js +++ b/src/components/about/about.js @@ -20,6 +20,9 @@ const About = { return this.$store.state.instance.showInstanceSpecificPanel && !this.$store.getters.mergedConfig.hideISP && this.$store.state.instance.instanceSpecificPanelContent + }, + showLocalBubblePanel () { + return this.$store.state.instance.localBubbleInstances.length > 0 } } } diff --git a/src/components/about/about.vue b/src/components/about/about.vue index 221fc381..df9bb196 100644 --- a/src/components/about/about.vue +++ b/src/components/about/about.vue @@ -3,7 +3,7 @@ - + diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue index 5efe7db6..61119482 100644 --- a/src/components/timeline_menu/timeline_menu.vue +++ b/src/components/timeline_menu/timeline_menu.vue @@ -135,7 +135,6 @@ a { display: block; padding: 0.6em 0.65em; - padding-bottom: 0; &:hover { background-color: $fallback--lightBg; diff --git a/src/components/timeline_menu/timeline_menu_content.js b/src/components/timeline_menu/timeline_menu_content.js index 9121a983..df15030b 100644 --- a/src/components/timeline_menu/timeline_menu_content.js +++ b/src/components/timeline_menu/timeline_menu_content.js @@ -23,7 +23,8 @@ const TimelineMenuContent = { ...mapState({ currentUser: state => state.users.currentUser, privateMode: state => state.instance.private, - federating: state => state.instance.federating + federating: state => state.instance.federating, + showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0) }) } } diff --git a/src/components/timeline_menu/timeline_menu_content.vue b/src/components/timeline_menu/timeline_menu_content.vue index 2e5d3ce9..27aece22 100644 --- a/src/components/timeline_menu/timeline_menu_content.vue +++ b/src/components/timeline_menu/timeline_menu_content.vue @@ -16,7 +16,7 @@ >{{ $t("nav.home_timeline") }} -
  • +
  • Date: Sun, 18 Sep 2022 04:29:04 +0000 Subject: [PATCH 04/19] Update 'package.json' The version and description in package.json was really out of date for some reason. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1987f1b8..336cabce 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pleroma_fe", - "version": "1.0.0", - "description": "A Qvitter-style frontend for certain GS servers.", + "version": "3.2.0", + "description": "A frontend for Akkoma instances", "author": "Roger Braun ", "private": true, "scripts": { From 7328795331995217f0247e09e4a2459b8c59b535 Mon Sep 17 00:00:00 2001 From: Norm Date: Mon, 19 Sep 2022 17:32:45 +0000 Subject: [PATCH 05/19] Update 'CHANGELOG.md' (#169) Added in all of the major changes that were mentioned in the various release notes that weren't added to the changelog file. Fixes #91 Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/169 Co-authored-by: Norm Co-committed-by: Norm --- CHANGELOG.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac68ac0..74bad07b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,29 @@ 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/). -## Unreleased +## 2022.09 - 2022-09-10 +### Added +- Automatic post translations. Must be configured on the backend in order to work. +- Post editing, including a log of previous edits. + +### Changed +- Top bar now has navigation shortcuts. Can be enabled or disabled by admins or users. +- Optional replacement of timeline drop-down with navigation buttons. Also configurable. +- Posts and posts with replies are now separated on user profiles. +- Custom emoji from remote instances on a post can now also be used. + +## 2022.08 - 2022-08-12 +### Added +- Ability to quote public and unlisted posts +- Bubble timeline + +### Changed +- Emoji in emoji picker is separated by packs + +### Removed +- Chats, they were half-baked. Just use PMs. + +## 2022.07 - 2022-07-16 ### Fixed - AdminFE button no longer scrolls page to top when clicked - Pinned statuses no longer appear at bottom of user timeline (still appear as part of the timeline when fetched deep enough) @@ -16,6 +38,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Attachments are ALWAYS in same order as user uploaded, no more "videos first" - Attachment description is prefilled with backend-provided default when uploading - Proper visual feedback that next image is loading when browsing +- Misskey-Flavoured Markdown support +- Custom emoji reactions ### Changed - (You)s are optional (opt-in) now, bolding your nickname is also optional (opt-out) From aedd0794a403fd1afd46e72c8cf8feef5daaeb31 Mon Sep 17 00:00:00 2001 From: Norm Date: Mon, 19 Sep 2022 17:39:21 +0000 Subject: [PATCH 06/19] Remote interaction with posts (#168) From: https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1419 This is the frontend side of https://akkoma.dev/AkkomaGang/akkoma/pulls/198 (merged in https://akkoma.dev/AkkomaGang/akkoma/commit/a6d85003fe0cedab924a14f1065c181a2d468a1b). Co-authored-by: Tusooa Zhu Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/168 Co-authored-by: Norm Co-committed-by: Norm --- CHANGELOG.md | 1 + src/components/favorite_button/favorite_button.js | 5 ++++- src/components/favorite_button/favorite_button.vue | 10 ++++++++-- src/components/reply_button/reply_button.js | 3 +++ src/components/reply_button/reply_button.vue | 10 ++++++++-- src/components/retweet_button/retweet_button.js | 3 +++ src/components/retweet_button/retweet_button.vue | 10 ++++++++-- src/modules/instance.js | 14 ++++++++++++++ 8 files changed, 49 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74bad07b..4b18ac9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Ability to rearrange order of attachments when uploading - Enabled users to zoom and pan images in media viewer with mouse and touch - Added frontend ui for account migration +- Implemented remote interaction with statuses ## [2.4.2] - 2022-01-09 diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index 5cd05f73..d15699f7 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -31,7 +31,10 @@ const FavoriteButton = { } }, computed: { - ...mapGetters(['mergedConfig']) + ...mapGetters(['mergedConfig']), + remoteInteractionLink () { + return this.$store.getters.remoteInteractionLink({ statusId: this.status.id }) + } } } diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index dce25e24..7d23572e 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -13,13 +13,19 @@ :spin="animated" /> - + - + - + - + - + - + { + if (statusId) { + return `${link}?status_id=${statusId}` + } else { + return `${link}?nickname=${nickname}` + } + } } }, actions: { From bf1debdeb621d96a900e270a35f89f6f8a91ed27 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Mon, 19 Sep 2022 18:39:36 -0400 Subject: [PATCH 07/19] Move remote interaction chnagelog entry to "Unreleased" --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b18ac9b..483a0ff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ 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/). +## Unreleased +### Added +- Implemented remote interaction with statuses + + ## 2022.09 - 2022-09-10 ### Added - Automatic post translations. Must be configured on the backend in order to work. @@ -62,7 +67,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Ability to rearrange order of attachments when uploading - Enabled users to zoom and pan images in media viewer with mouse and touch - Added frontend ui for account migration -- Implemented remote interaction with statuses ## [2.4.2] - 2022-01-09 From 42e48348ae72c0d138333762d46d1a395748b0b8 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Tue, 20 Sep 2022 15:17:51 +0100 Subject: [PATCH 08/19] add note about bubble timeline in docs --- docs/docs/user_guide/timelines.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/user_guide/timelines.md b/docs/docs/user_guide/timelines.md index d0ad95a1..d27395fd 100644 --- a/docs/docs/user_guide/timelines.md +++ b/docs/docs/user_guide/timelines.md @@ -6,6 +6,7 @@ You have several timelines to browse trough - **Bookmarks** all the posts you've bookmarked. You can bookmark a post by clicking the three dots on the bottom right of the post and choose Bookmark. - **Direct Messages** all posts with `direct` scope addressed to you or mentioning you. - **Public Timelines** all public posts made by users on the instance you're on +- **Bubble Timeline** all public posts from instances recommended by your admin(s) in the instance settings. This won't appear if they haven't set anything up for it. - **The Whole Known Network** also known as **TWKN** or **Federated Timeline** - all public posts known by your instance. Due to nature of the network your instance may not know *all* the posts on the network, so only posts known by your instance are shown there. Note that by default you will see all posts made by other users on your Home Timeline, this contrast behavior of Twitter and Mastodon, which shows you only non-reply posts and replies to people you follow. You can change said behavior in the [settings](settings.md#filtering). From 87683052e8e3af60a1ab004644ecfbb95bf1e3eb Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Tue, 20 Sep 2022 16:27:17 +0100 Subject: [PATCH 09/19] add hacky reply filtering, turn off streaming by default --- src/modules/api.js | 15 +++++++++++++-- src/modules/config.js | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/modules/api.js b/src/modules/api.js index 6c896c79..1003a3f5 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -3,6 +3,16 @@ import { WSConnectionStatus } from '../services/api/api.service.js' const retryTimeout = (multiplier) => 1000 * multiplier +const isVisible = (store, message, visibility) => { + if (visibility === 'all') { + return true + } else if (visibility === 'following') { + return store.getters.relationship(message.in_reply_to_user_id).following + } else if (visibility === 'self') { + return message.in_reply_to_user_id === store.rootState.users.currentUser.id + } + return false +} const api = { state: { retryMultiplier: 1, @@ -85,20 +95,21 @@ const api = { state.mastoUserSocket.addEventListener( 'message', ({ detail: message }) => { + const replyVisibility = rootState.config.replyVisibility if (!message) return // pings if (message.event === 'notification') { dispatch('addNewNotifications', { notifications: [message.notification], older: false }) - } else if (message.event === 'update') { + } else if (message.event === 'update' && isVisible(store, message.status, replyVisibility)) { dispatch('addNewStatuses', { statuses: [message.status], userId: false, showImmediately: timelineData.visibleStatuses.length === 0, timeline: 'friends' }) - } else if (message.event === 'status.update') { + } else if (message.event === 'status.update' && isVisible(store, message.status, replyVisibility)) { dispatch('addNewStatuses', { statuses: [message.status], userId: false, diff --git a/src/modules/config.js b/src/modules/config.js index e0530101..2934f2c5 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -72,7 +72,7 @@ export const defaultState = { highlight: {}, interfaceLanguage: browserLocale, hideScopeNotice: false, - useStreamingApi: true, + useStreamingApi: false, sidebarRight: undefined, // instance default scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default From 468eb12573325111fe8405cfbc43407ac9fe2686 Mon Sep 17 00:00:00 2001 From: Mergan Date: Fri, 23 Sep 2022 10:27:14 +0000 Subject: [PATCH 10/19] Detect whether an WEBP or APNG is animated (#161) Co-authored-by: David Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/161 Co-authored-by: Mergan Co-committed-by: Mergan --- src/components/still-image/still-image.js | 85 +++++++++++++++++++++-- 1 file changed, 79 insertions(+), 6 deletions(-) diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index d7abbcb5..480de9fa 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -11,12 +11,13 @@ const StillImage = { ], data () { return { - stopGifs: this.$store.getters.mergedConfig.stopGifs + stopGifs: this.$store.getters.mergedConfig.stopGifs, + isAnimated: false } }, computed: { animated () { - return this.stopGifs && (this.mimetype === 'image/gif' || this.src.endsWith('.gif')) + return this.stopGifs && this.isAnimated }, style () { const appendPx = (str) => /\d$/.test(str) ? str + 'px' : str @@ -31,17 +32,89 @@ const StillImage = { const image = this.$refs.src if (!image) return this.imageLoadHandler && this.imageLoadHandler(image) + this.detectAnimation(image) + this.drawThumbnail() + }, + onError () { + this.imageLoadError && this.imageLoadError() + }, + detectAnimation (image) { + if (this.mimetype === 'image/gif' || this.src.endsWith('.gif')) { + this.isAnimated = true + return + } + // harmless CORS errors without-- clean console with + if (!this.$store.state.instance.mediaProxyAvailable) return + // Animated JPEGs? + if (!(this.src.endsWith('.webp') || this.src.endsWith('.png'))) return + // Browser Cache should ensure image doesn't get loaded twice if cache exists + fetch(image.src, { + referrerPolicy: 'same-origin' + }) + .then(data => { + // We don't need to read the whole file so only call it once + data.body.getReader().read() + .then(reader => { + if (this.src.endsWith('.webp') && this.isAnimatedWEBP(reader.value)) { + this.isAnimated = true + return + } + if (this.src.endsWith('.png') && this.isAnimatedPNG(reader.value)) { + this.isAnimated = true + } + }) + }) + .catch(() => { + // this.imageLoadError && this.imageLoadError() + }) + }, + isAnimatedWEBP (data) { + /** + * WEBP HEADER CHUNK + * === START HEADER === + * 82 73 70 70 ("RIFF") + * xx xx xx xx (SIZE) + * 87 69 66 80 ("WEBP") + * === END OF HEADER === + * 86 80 56 88 ("VP8X") ← Extended VP8X + * xx xx xx xx (VP8X) + * [++] ← RSVILEX(A)R (1 byte) + * A → Animated bit + */ + // Relevant bytes + const segment = data.slice(4 * 3, (4 * 5) + 1) + // Check for VP8X string + if (segment.join('').includes(['86805688'])) { + // Check for Animation bit + return !!((segment[8] >> 1) & 1) + } + // No VP8X = Not Animated (X is for Extended) + return false + }, + isAnimatedPNG (data) { + // Find acTL before IDAT in PNG; if found it is animated + const segment = [] + for (let i = 0; i < data.length; i++) { + segment.push(String.fromCharCode(data[i])) + } + const str = segment.join('') + const idatPos = str.indexOf('IDAT') + return (str.substring(0, idatPos > 0 ? idatPos : 0).indexOf('acTL') > 0) + }, + drawThumbnail () { const canvas = this.$refs.canvas - if (!canvas) return + if (!this.$refs.canvas) return + const image = this.$refs.src const width = image.naturalWidth const height = image.naturalHeight canvas.width = width canvas.height = height canvas.getContext('2d').drawImage(image, 0, 0, width, height) - }, - onError () { - this.imageLoadError && this.imageLoadError() } + }, + updated () { + // On computed animated change + this.drawThumbnail() } } From ca646822f62ff136d34e62944d15deaf841938ad Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Sun, 25 Sep 2022 20:50:03 +0300 Subject: [PATCH 11/19] Add delete & redraft button to posts --- package.json | 2 +- src/components/extra_buttons/extra_buttons.js | 37 +- .../extra_buttons/extra_buttons.vue | 21 + .../post_status_form/post_status_form.js | 7 +- .../post_status_modal/post_status_modal.js | 3 +- src/i18n/en.json | 5 + yarn.lock | 17828 ++++++++-------- 7 files changed, 9196 insertions(+), 8707 deletions(-) diff --git a/package.json b/package.json index 336cabce..6712bf76 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@chenfengyuan/vue-qrcode": "2.0.0", "@fortawesome/fontawesome-svg-core": "1.3.0", "@fortawesome/free-regular-svg-icons": "^6.1.2", - "@fortawesome/free-solid-svg-icons": "5.15.4", + "@fortawesome/free-solid-svg-icons": "^6.2.0", "@fortawesome/vue-fontawesome": "3.0.1", "@kazvmoe-infra/pinch-zoom-element": "1.2.0", "@vuelidate/core": "2.0.0-alpha.42", diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index f24e261b..4bc6144c 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -8,7 +8,8 @@ import { faThumbtack, faShareAlt, faExternalLinkAlt, - faHistory + faHistory, + faFilePen } from '@fortawesome/free-solid-svg-icons' import { faBookmark as faBookmarkReg, @@ -24,7 +25,8 @@ library.add( faShareAlt, faExternalLinkAlt, faFlag, - faHistory + faHistory, + faFilePen ) const ExtraButtons = { @@ -36,7 +38,8 @@ const ExtraButtons = { data () { return { expanded: false, - showingDeleteDialog: false + showingDeleteDialog: false, + showingRedraftDialog: false } }, methods: { @@ -122,6 +125,34 @@ const ExtraButtons = { const stripFieldsList = ['attachments', 'created_at', 'emojis', 'text', 'raw_html', 'nsfw', 'poll', 'summary', 'summary_raw_html'] stripFieldsList.forEach(p => delete originalStatus[p]) this.$store.dispatch('openStatusHistoryModal', originalStatus) + }, + redraftStatus () { + if (this.shouldConfirmDelete) { + this.showRedraftStatusConfirmDialog() + } else { + this.doRedraftStatus() + } + }, + doRedraftStatus () { + this.$store.dispatch('fetchStatusSource', { id: this.status.id }) + .then(data => this.$store.dispatch('openPostStatusModal', { + isRedraft: true, + statusId: this.status.id, + subject: data.spoiler_text, + statusText: data.text, + statusIsSensitive: this.status.nsfw, + statusPoll: this.status.poll, + statusFiles: [...this.status.attachments], + statusScope: this.status.visibility, + statusContentType: data.content_type + })) + this.doDeleteStatus() + }, + showRedraftStatusConfirmDialog () { + this.showingRedraftDialog = true + }, + hideRedraftStatusConfirmDialog () { + this.showingRedraftDialog = false } }, computed: { diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index a15f0bf2..9da2ad8c 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -95,6 +95,17 @@ icon="history" />{{ $t("status.edit_history") }} +