From fee4b042cab142d3f531c1a3f6e5d912dfb69968 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Sun, 4 Jun 2023 04:25:14 +0900 Subject: [PATCH] =?UTF-8?q?enhance(client):=20=E7=89=B9=E5=AE=9A=E3=81=AEM?= =?UTF-8?q?FM=E6=A7=8B=E6=96=87=E3=82=92=E5=90=AB=E3=82=80=E3=83=8E?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=82=92=E7=9C=81=E7=95=A5=E5=8C=96=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=8B=E3=81=A9=E3=81=86=E3=81=8B=E3=82=92=E9=81=B8?= =?UTF-8?q?=E6=8A=9E=E3=81=A7=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 ++++++++++-------- .../frontend/src/pages/settings/general.vue | 2 ++ .../src/pages/settings/preferences-backups.vue | 1 + packages/frontend/src/store.ts | 4 ++++ 9 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 2a4991cdae..45a01109d7 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -61,6 +61,7 @@ - 알림 기본 정렬을 수직으로 변경 - 채팅방 목록 페이지 디자인 개선 - 리노트 문구를 노트 최상단으로 배치 +- 특정 MFM 구문이 포함된 노트를 간략화 할지 선택할 수 있음(enhance: [aba0755](https://github.com/kokonect-link/cherrypick/commit/aba0755880d6797f49d34c8b7fe2c602d153e367)) - Fix: (Friendly) 위젯 영역에 safe-area-inset-bottom이 적용되지 않음 - Fix: (Friendly) 플로팅 메뉴를 길게 눌렀을 때 프로필 이미지를 드래그 할 수 있는 문제 - Fix: 위젯 편집 시 헤더 이외의 영역을 눌렀을 때 위젯 설정이 뜨는 문제 diff --git a/locales/en-US.yml b/locales/en-US.yml index 3d4ffdc02f..d57bc684b8 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1009,6 +1009,7 @@ thisPostMayBeAnnoyingHome: "Post to home timeline" thisPostMayBeAnnoyingCancel: "Cancel" thisPostMayBeAnnoyingIgnore: "Post anyway" collapseRenotes: "Collapse renotes you've already seen" +collapseDefault: "Collapse notes using specific MFM syntax" internalServerError: "Internal Server Error" internalServerErrorDescription: "The server has run into an unexpected error." copyErrorInfo: "Copy error details" diff --git a/locales/index.d.ts b/locales/index.d.ts index addb9fc962..91a517905d 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1012,6 +1012,7 @@ export interface Locale { "thisPostMayBeAnnoyingCancel": string; "thisPostMayBeAnnoyingIgnore": string; "collapseRenotes": string; + "collapseDefault": string; "internalServerError": string; "internalServerErrorDescription": string; "copyErrorInfo": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 347c14b486..e681e88368 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1009,6 +1009,7 @@ thisPostMayBeAnnoyingHome: "ホームに投稿" thisPostMayBeAnnoyingCancel: "やめる" thisPostMayBeAnnoyingIgnore: "このまま投稿" collapseRenotes: "見たことのあるRenoteを省略して表示" +collapseDefault: "特定のMFM構文を含むノートを省略して表示" internalServerError: "サーバー内部エラー" internalServerErrorDescription: "サーバー内部で予期しないエラーが発生しました。" copyErrorInfo: "エラー情報をコピー" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 118790b188..343150ed24 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1010,6 +1010,7 @@ thisPostMayBeAnnoyingHome: "홈에 게시" thisPostMayBeAnnoyingCancel: "그만두기" thisPostMayBeAnnoyingIgnore: "이대로 게시" collapseRenotes: "이미 본 리노트를 간략화하기" +collapseDefault: "특정 MFM 구문이 포함된 노트 간략화하기" internalServerError: "내부 서버 오류" internalServerErrorDescription: "내부 서버에서 예기치 않은 오류가 발생했어요." copyErrorInfo: "오류 정보 복사" diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index d75555b8d2..4c5c6bf2ca 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -75,10 +75,10 @@
- - @@ -214,17 +214,19 @@ const isMyRenote = $i && ($i.id === note.userId); const showContent = ref(false); const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)) : null; const isLong = (appearNote.cw == null && appearNote.text != null && ( - (appearNote.text.includes('$[x2')) || - (appearNote.text.includes('$[x3')) || - (appearNote.text.includes('$[x4')) || - (appearNote.text.includes('$[scale')) || - (appearNote.text.includes('$[position')) || (appearNote.text.split('\n').length > 9) || (appearNote.text.length > 500) || (appearNote.files.length >= 5) || (urls && urls.length >= 4) )); -const collapsed = ref(appearNote.cw == null && isLong); +const isMFM = (appearNote.cw == null && appearNote.text != null && ( + (appearNote.text.includes('$[x2')) || + (appearNote.text.includes('$[x3')) || + (appearNote.text.includes('$[x4')) || + (appearNote.text.includes('$[scale')) || + (appearNote.text.includes('$[position')) +)); +const collapsed = ref(appearNote.cw == null && (isLong || isMFM && defaultStore.state.collapseDefault)); const isDeleted = ref(false); const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); const translation = ref(null); diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 1601081db8..894486e854 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -37,6 +37,7 @@ {{ i18n.ts.showClipButtonInNoteFooter }} {{ i18n.ts.largeNoteReactions }} {{ i18n.ts.collapseRenotes }} + {{ i18n.ts.collapseDefault }} {{ i18n.ts.enableAdvancedMfm }} {{ i18n.ts.enableAnimatedMfm }}
@@ -317,6 +318,7 @@ const useEnterToSend = computed(defaultStore.makeGetterSetter('useEnterToSend')) const postFormVisibilityHotkey = computed(defaultStore.makeGetterSetter('postFormVisibilityHotkey')); const newNoteRecivedNotificationBehavior = computed(defaultStore.makeGetterSetter('newNoteRecivedNotificationBehavior')); const fontSize = computed(defaultStore.makeGetterSetter('fontSize')); +const collapseDefault = computed(defaultStore.makeGetterSetter('collapseDefault')); watch(lang, () => { miLocalStorage.setItem('lang', lang.value as string); diff --git a/packages/frontend/src/pages/settings/preferences-backups.vue b/packages/frontend/src/pages/settings/preferences-backups.vue index e08e585b91..6eadf82b63 100644 --- a/packages/frontend/src/pages/settings/preferences-backups.vue +++ b/packages/frontend/src/pages/settings/preferences-backups.vue @@ -90,6 +90,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [ 'useEnterToSend', 'postFormVisibilityHotkey', 'newNoteRecivedNotificationBehavior', + 'collapseDefault', ]; const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [ 'lightTheme', diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 8a212c7133..a62f4ab337 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -363,6 +363,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, + collapseDefault: { + where: 'account', + default: true, + }, })); // TODO: 他のタブと永続化されたstateを同期