From d8f3f7e0ff063d9616fd06b6e84e77c435b76fd0 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Sun, 1 Oct 2023 16:29:47 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=A1=E3=83=87=E3=82=A3=E3=82=A2?= =?UTF-8?q?=E3=82=92=E5=90=AB=E3=82=80=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=82=92=E7=9C=81=E7=95=A5=E3=81=97?= =?UTF-8?q?=E3=81=A6=E8=A1=A8=E7=A4=BA=E3=81=93=E3=81=A8=E3=81=8C=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_CHERRYPICK.md | 1 + locales/en-US.yml | 1 + locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + locales/ko-KR.yml | 1 + packages/frontend/src/components/MkNote.vue | 18 ++++++++++++++---- .../src/components/MkSubNoteContent.vue | 18 ++++++++++++++---- .../frontend/src/pages/settings/general.vue | 3 +++ packages/frontend/src/store.ts | 4 ++++ 9 files changed, 40 insertions(+), 8 deletions(-) diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index fd197a7255..49a2958664 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -34,6 +34,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE - Feat: 움직이는 이미지를 표시하는 방법을 세분화 - 마우스를 움직이거나 화면을 터치하고 있으면 이미지를 재생 - 일정 시간이 경과하면 이미지 재생을 중지 +- Feat: 미디어가 포함된 모든 노트를 접을 수 있음 - Fix: 로그인하지 않은 상태에서 노트 상세 페이지의 노트 작성 폼을 조작할 수 있음 ### Server diff --git a/locales/en-US.yml b/locales/en-US.yml index a0523c0486..bce365ffc7 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1,5 +1,6 @@ --- _lang_: "English" +allMediaNoteCollapse: "Collapse all media notes" showingAnimatedImagesDescription: "When set to \"Animate on interaction\", the image will play when you hover over it or touch it." showFixedPostFormInReplies: "Show posting form in replies" showFixedPostFormInRepliesDescription: "Only visible in desktop and tablet environments." diff --git a/locales/index.d.ts b/locales/index.d.ts index 714f7ac789..856ef3b05e 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -3,6 +3,7 @@ // Do not edit this file directly. export interface Locale { "_lang_": string; + "allMediaNoteCollapse": string; "showingAnimatedImagesDescription": string; "showFixedPostFormInReplies": string; "showFixedPostFormInRepliesDescription": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 2f5cd927eb..675c1d79b2 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1,5 +1,6 @@ _lang_: "日本語" +allMediaNoteCollapse: "すべてのメディアノートを省略して表示" showingAnimatedImagesDescription: "「インタラクト時に再生」に設定すると、画像の上にマウスを置いたり、画像をタッチすると再生されます。" showFixedPostFormInReplies: "返信に投稿フォームを表示する" showFixedPostFormInRepliesDescription: "デスクトップとタブレット環境でのみ表示されます。" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 8d07455e77..3bbd202ed9 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1,5 +1,6 @@ --- _lang_: "한국어" +allMediaNoteCollapse: "모든 미디어 노트 간략화하기" showingAnimatedImagesDescription: "'건드리면 움직임'으로 설정하면 이미지 위에 마우스를 올리거나 이미지를 터치하면 움직여요." showFixedPostFormInReplies: "답글에 글 작성란 표시" showFixedPostFormInRepliesDescription: "데스크톱과 태블릿 환경에서만 표시돼요." diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 2eec257dfa..bc1441adf9 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -99,10 +99,13 @@ SPDX-License-Identifier: AGPL-3.0-only - - @@ -212,6 +215,7 @@ import { mainRouter } from '@/router.js'; import { notePage } from '@/filters/note.js'; import { miLocalStorage } from '@/local-storage.js'; import { instance } from '@/instance.js'; +import { concat } from '@/scripts/array.js'; let showEl = $ref(false); @@ -259,7 +263,7 @@ const showContent = ref(false); const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)) : null; const isLong = shouldCollapsed(appearNote); const isMFM = shouldMfmCollapsed(appearNote); -const collapsed = ref(appearNote.cw == null && (isLong || (isMFM && defaultStore.state.collapseDefault))); +const collapsed = ref(appearNote.cw == null && (isLong || (isMFM && defaultStore.state.collapseDefault) || defaultStore.state.allMediaNoteCollapse)); const isDeleted = ref(false); const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); const translation = ref(null); @@ -267,6 +271,12 @@ const translating = ref(false); const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id); let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null))); +const collapseLabel = computed(() => { + return concat([ + appearNote.files && appearNote.files.length !== 0 ? [i18n.t('_cw.files', { count: appearNote.files.length })] : [], + ] as string[][]).join(' / '); +}); + const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index 3cac372d91..4e952364cd 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -37,10 +37,13 @@ SPDX-License-Identifier: AGPL-3.0-only - -
@@ -124,6 +127,7 @@ import { reactionPicker } from '@/scripts/reaction-picker.js'; import { claimAchievement } from '@/scripts/achievements.js'; import { useNoteCapture } from '@/scripts/use-note-capture.js'; import { MenuItem } from '@/types/menu.js'; +import { concat } from '@/scripts/array.js'; const el = shallowRef(); const menuButton = shallowRef(); @@ -139,6 +143,12 @@ const showContent = ref(false); const translation = ref(null); const translating = ref(false); +const collapseLabel = computed(() => { + return concat([ + props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length })] : [], + ] as string[][]).join(' / '); +}); + const props = defineProps<{ note: Misskey.entities.Note; showSubNoteFooterButton: boolean; @@ -149,7 +159,7 @@ let note = $ref(deepClone(props.note)); const isLong = shouldCollapsed(props.note); const isMFM = shouldMfmCollapsed(props.note); -const collapsed = $ref(isLong || (isMFM && defaultStore.state.collapseDefault)); +const collapsed = $ref(isLong || (isMFM && defaultStore.state.collapseDefault) || defaultStore.state.allMediaNoteCollapse); useNoteCapture({ rootEl: el, diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 51cd8882e6..a1088ba32b 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -75,6 +75,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.showReplyInNotification }} CherryPick {{ i18n.ts.renoteQuoteButtonSeparation }} CherryPick {{ i18n.ts.showFixedPostFormInReplies }} CherryPick + {{ i18n.ts.allMediaNoteCollapse }} CherryPick
@@ -366,6 +367,7 @@ const showReplyInNotification = computed(defaultStore.makeGetterSetter('showRepl const renoteQuoteButtonSeparation = computed(defaultStore.makeGetterSetter('renoteQuoteButtonSeparation')); const showFixedPostFormInReplies = computed(defaultStore.makeGetterSetter('showFixedPostFormInReplies')); const showingAnimatedImages = computed(defaultStore.makeGetterSetter('showingAnimatedImages')); +const allMediaNoteCollapse = computed(defaultStore.makeGetterSetter('allMediaNoteCollapse')); watch(lang, () => { miLocalStorage.setItem('lang', lang.value as string); @@ -423,6 +425,7 @@ watch([ renoteQuoteButtonSeparation, showFixedPostFormInReplies, showingAnimatedImages, + allMediaNoteCollapse, ], async () => { await reloadAsk(); }); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index ff1d042077..1ce7f54555 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -445,6 +445,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, + allMediaNoteCollapse: { + where: 'device', + default: false, + }, // - Settings/Timeline enableHomeTimeline: {