From 3d5038d67d1532d454df2791daca75372d2c2915 Mon Sep 17 00:00:00 2001 From: fly_mc Date: Sun, 27 Oct 2024 20:55:26 +0800 Subject: [PATCH] add collapedInReplyTo --- locales/en-US.yml | 1 + locales/zh-CN.yml | 1 + locales/zh-TW.yml | 1 + packages/frontend/src/components/MkNote.vue | 27 ++++++++++++++++--- packages/frontend/src/pages/settings/pari.vue | 2 ++ packages/frontend/src/store.ts | 4 +++ 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index ec31044f2254..4ea13f0486d4 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1052,6 +1052,7 @@ thisPostMayBeAnnoyingCancel: "Cancel" thisPostMayBeAnnoyingIgnore: "Post anyway" collapseRenotes: "Collapse renotes you've already seen" collapseRenotesDescription: "Collapse notes that you've reacted to or renoted before." +collapseNotesRepliedTo: "Collapse notes replied to" internalServerError: "Internal Server Error" internalServerErrorDescription: "The server has run into an unexpected error." copyErrorInfo: "Copy error details" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index eb3c44f92f34..95d2d78b8e76 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1052,6 +1052,7 @@ thisPostMayBeAnnoyingCancel: "取消" thisPostMayBeAnnoyingIgnore: "就这样发布" collapseRenotes: "省略显示已经看过的转发内容" collapseRenotesDescription: "将回应过或转贴过的贴子折叠表示。" +collapseNotesRepliedTo: "折叠被回复的帖子" internalServerError: "内部服务器错误" internalServerErrorDescription: "内部服务器发生了预期外的错误" copyErrorInfo: "复制错误信息" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index ea79778afbdd..11dbe6630fa0 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1052,6 +1052,7 @@ thisPostMayBeAnnoyingCancel: "退出" thisPostMayBeAnnoyingIgnore: "直接發佈貼文" collapseRenotes: "省略顯示已看過的轉發貼文" collapseRenotesDescription: "將已做過反應和轉發的貼文折疊顯示。" +collapseNotesRepliedTo: "省略顯示被回復的貼文" internalServerError: "內部伺服器錯誤" internalServerErrorDescription: "內部伺服器出現意外錯誤。" copyErrorInfo: "複製錯誤資訊" diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index f92990f8129e..dfd7489bbfe7 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -12,7 +12,11 @@ SPDX-License-Identifier: AGPL-3.0-only :class="[$style.root, { [$style.showActionsOnlyHover]: defaultStore.state.showNoteActionsOnlyHover, [$style.skipRender]: defaultStore.state.skipNoteRender }]" :tabindex="isDeleted ? '-1' : '0'" > - +
+ + +
+
{{ i18n.ts.pinnedNote }}
@@ -43,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- +
@@ -301,6 +305,8 @@ const renoteCollapsed = ref( ), ); +const inReplyToCollapsed = ref(defaultStore.state.collapseNotesRepliedTo); + const pleaseLoginContext = computed(() => ({ type: 'lookup', url: `https://${host}/notes/${appearNote.value.id}`, @@ -829,7 +835,7 @@ function emitUpdReaction(emoji: string, delta: number) { margin-right: 4px; } -.collapsedRenoteTarget { +.collapsedRenoteTarget, .collapsedInReplyTo { display: flex; align-items: center; line-height: 28px; @@ -837,7 +843,12 @@ function emitUpdReaction(emoji: string, delta: number) { padding: 0 32px 18px; } -.collapsedRenoteTargetAvatar { +.collapsedInReplyTo { + padding: 28px 32px 0; + opacity: 0.7; +} + +.collapsedRenoteTargetAvatar, .collapsedInReplyToAvatar { flex-shrink: 0; display: inline-block; width: 28px; @@ -846,6 +857,10 @@ function emitUpdReaction(emoji: string, delta: number) { } .collapsedRenoteTargetText { + opacity: 0.7; +} + +.collapsedRenoteTargetText, .collapsedInReplyToText { overflow: hidden; flex-shrink: 1; text-overflow: ellipsis; @@ -1060,6 +1075,10 @@ function emitUpdReaction(emoji: string, delta: number) { margin-top: 4px; } + .collapsedInReplyTo { + padding: 14px 16px 0; + } + .article { padding: 22px 24px; } diff --git a/packages/frontend/src/pages/settings/pari.vue b/packages/frontend/src/pages/settings/pari.vue index 8e689b4212e5..8d1f192f0ff5 100644 --- a/packages/frontend/src/pages/settings/pari.vue +++ b/packages/frontend/src/pages/settings/pari.vue @@ -59,6 +59,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.noteClickToOpen }} {{ i18n.ts.enableFallbackReactButton }} {{ i18n.ts.enableMFMCheatsheet }} + {{ i18n.ts.collapseNotesRepliedTo }} @@ -106,6 +107,7 @@ const noteClickToOpen = computed(defaultStore.makeGetterSetter('noteClickToOpen' const enableFallbackReactButton = computed(defaultStore.makeGetterSetter('enableFallbackReactButton')); const enableMFMCheatsheet = computed(defaultStore.makeGetterSetter('enableMFMCheatsheet')); const autoSpacingBehaviour = computed(defaultStore.makeGetterSetter('autoSpacingBehaviour')); +const collapseNotesRepliedTo = computed(defaultStore.makeGetterSetter('collapseNotesRepliedTo')); definePageMetadata(() => ({ title: 'Pari Plus!', diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 26e0b2334182..b56ee346630a 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -531,6 +531,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: null as 'all' | 'special' | null, }, + collapseNotesRepliedTo: { + where: 'device', + default: false, + }, })); // TODO: 他のタブと永続化されたstateを同期