From d35522e30d52a899a74c9d5f053379c0d87609bd Mon Sep 17 00:00:00 2001 From: pen <121443048+penginn-net@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:37:01 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Fix:=20=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE?= =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E3=81=AB=E7=BF=BB=E8=A8=B3=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B/=E6=9C=AC=E6=96=87=E3=81=8C=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=A6=E6=8A=95=E7=A5=A8=E3=81=A0=E3=81=91=E3=81=82=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E7=BF=BB=E8=A8=B3=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B=20(#579)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: pen --- CHANGELOG_YOJO.md | 19 ++++++++++-- packages/frontend/src/components/MkNote.vue | 30 ++++++++++++++----- .../src/components/MkNoteDetailed.vue | 30 ++++++++++++++----- 3 files changed, 62 insertions(+), 17 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index 33fc009dd8..3d349203a3 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -1,3 +1,16 @@ +## 1.2.1 +Cherrypick 4.13.0 +Misskey 2024.10.1 + +### Release Date + +### General + +### Client +- Fix: すべてのノートに翻訳ボタンが表示される/本文がなくて投票だけあると翻訳が表示されなくなる [#579](https://github.com/yojo-art/cherrypick/pull/579) + +### Server + ## 1.2.0 Cherrypick 4.13.0 Misskey 2024.10.1 @@ -20,7 +33,7 @@ Misskey 2024.10.1 - Enhance: `/users/${id}`に`Accept: application/ld+json`ではないリクエストが来たとき`/@${username}`にリダイレクトするように [#554](https://github.com/yojo-art/cherrypick/pull/554) ## 1.1.0 -Cherrypick 4.11.1 +Cherrypick 4.11.1 Misskey 2024.8.0 ### Release Date @@ -121,7 +134,7 @@ docker環境でノートレコードが多数(数百万件)ある場合**一時 ## 1.0.1 -Cherrypick 4.11.1 +Cherrypick 4.11.1 Misskey 2024.8.0 ### Release Date @@ -138,7 +151,7 @@ Misskey 2024.8.0 ## 1.0.0 -Cherrypick 4.11.1 +Cherrypick 4.11.1 Misskey 2024.8.0 ### Release Date diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index a94bfb1c29..1e8cd6d7d4 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -93,7 +93,7 @@ SPDX-License-Identifier: AGPL-3.0-only :enableEmojiMenuReaction="!!$i" :enableAnimatedMfm="enableAnimatedMfm" /> -
+
@@ -101,7 +101,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.tsx.translatedFrom({ x: translation.sourceLang }) }}:
- { os.popupMenu(await getNoteClipMenu({ note: note.value, isDeleted, currentClip: currentClip?.value }), clipButton.value).then(focus); } -const isForeignLanguage: boolean = appearNote.value.text != null && (() => { +const isForeignLanguage: boolean = (appearNote.value.text != null || appearNote.value.poll != null) && (() => { const targetLang = (miLocalStorage.getItem('lang') ?? navigator.language).slice(0, 2); - const postLang = detectLanguage(appearNote.value.text); - const choicesLang = appearNote.value.poll?.choices.map((choice) => choice.text).join(' ') ?? ''; - const pollLang = detectLanguage(choicesLang); - return postLang !== '' && (postLang !== targetLang || pollLang !== targetLang); + if (appearNote.value.text) { + const postLang = detectLanguage(appearNote.value.text); + if (postLang !== '' && postLang !== targetLang) return true; + } + if (appearNote.value.poll) { + const foreignLang = appearNote.value.poll.choices + .map((choice) => detectLanguage(choice.text)) + .filter((lang) => lang !== targetLang).length; + if (0 < foreignLang) return true; + } + return false; })(); if (defaultStore.state.useAutoTranslate && instance.translatorAvailable && $i.policies.canUseTranslator && $i.policies.canUseAutoTranslate && !isLong && (appearNote.value.cw == null || showContent.value) && appearNote.value.text && isForeignLanguage) translate(); @@ -769,6 +776,15 @@ async function translate(): Promise { collapsed.value = false; translating.value = true; + if (appearNote.value.text == null) { + translating.value = false; + translation.value = { + sourceLang: '', + text: '', + }; + return; + } + vibrate(defaultStore.state.vibrateSystem ? 5 : []); if (props.mock) { diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 3b1cc081ce..1a43490640 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -117,7 +117,7 @@ SPDX-License-Identifier: AGPL-3.0-only :enableAnimatedMfm="enableAnimatedMfm" /> RN: -
+
@@ -125,7 +125,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.tsx.translatedFrom({ x: translation.sourceLang }) }}:
- { +const isForeignLanguage: boolean = (appearNote.value.text != null || appearNote.value.poll != null) && (() => { const targetLang = (miLocalStorage.getItem('lang') ?? navigator.language).slice(0, 2); - const postLang = detectLanguage(appearNote.value.text); - const choicesLang = appearNote.value.poll?.choices.map((choice) => choice.text).join(' ') ?? ''; - const pollLang = detectLanguage(choicesLang); - return postLang !== '' && (postLang !== targetLang || pollLang !== targetLang); + if (appearNote.value.text) { + const postLang = detectLanguage(appearNote.value.text); + if (postLang !== '' && postLang !== targetLang) return true; + } + if (appearNote.value.poll) { + const foreignLang = appearNote.value.poll.choices + .map((choice) => detectLanguage(choice.text)) + .filter((lang) => lang !== targetLang).length; + if (0 < foreignLang) return true; + } + return false; })(); if (defaultStore.state.useAutoTranslate && instance.translatorAvailable && $i.policies.canUseTranslator && $i.policies.canUseAutoTranslate && (appearNote.value.cw == null || showContent.value) && appearNote.value.text && isForeignLanguage) translate(); @@ -699,6 +706,15 @@ async function translate(): Promise { vibrate(defaultStore.state.vibrateSystem ? 5 : []); + if (appearNote.value.text == null) { + translating.value = false; + translation.value = { + sourceLang: '', + text: '', + }; + return; + } + const res = await misskeyApi('notes/translate', { noteId: appearNote.value.id, targetLang: miLocalStorage.getItem('lang') ?? navigator.language, From b87fc15b6643644e1034c056b967d80dfd9c1e00 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Sat, 21 Dec 2024 17:21:05 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BCTL?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E4=BB=98=E3=81=8D=E3=83=8E?= =?UTF-8?q?=E3=83=BC=E3=83=88TL=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#580)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 7 ++ .../pages/user/index.timeline.files.files.vue | 110 ++++++++++++++++-- .../src/pages/user/index.timeline.files.vue | 2 +- 3 files changed, 106 insertions(+), 13 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index 3d349203a3..1cdc17c3ab 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -8,6 +8,13 @@ Misskey 2024.10.1 ### Client - Fix: すべてのノートに翻訳ボタンが表示される/本文がなくて投票だけあると翻訳が表示されなくなる [#579](https://github.com/yojo-art/cherrypick/pull/579) +- Fix: ユーザーTLファイル付きノートTLの修正 [#580](https://github.com/yojo-art/cherrypick/pull/580) + - ユーザー設定アピアランスのセンシティブ画像を常に表示が無視されてたのを修正 + - ユーザー設定アピアランスの画像を常に非表示が無視されてたのを修正 + - ユーザー設定アピアランスの非表示の画像をダブルクリックして開く設定が無視されてたのを修正 + - ユーザー設定全般のデータセーバー、メディアの読み込みを無効化が無視されてたのを修正 + - センシティブ画像を開く時に年齢確認ダイアログを表示する機能が無視されてたのを修正 + - 画像左上にALT/GIF/APNG/センシティブの表示を追加 ### Server diff --git a/packages/frontend/src/pages/user/index.timeline.files.files.vue b/packages/frontend/src/pages/user/index.timeline.files.files.vue index 358a25d8ab..edc5e6c91a 100644 --- a/packages/frontend/src/pages/user/index.timeline.files.files.vue +++ b/packages/frontend/src/pages/user/index.timeline.files.files.vue @@ -4,37 +4,43 @@ SPDX-License-Identifier: AGPL-3.0-only -->