diff --git a/locales/en-US.yml b/locales/en-US.yml index 6a8227511eed9967d5c609ada4dc3b747cd8cd8b..b9017317ed1925b86c989e501a327c726322afae 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -944,6 +944,8 @@ approvalStatus: "Approval Status" document: "Documentation" numberOfPageCache: "Number of cached pages" numberOfPageCacheDescription: "Increasing this number will improve convenience for but cause more load as more memory usage on the user's device." +numberOfReplies: "Number of replies in a thread" +numberOfRepliesDescription: "Increasing this number will display more replies. Setting this too high can cause replies to be cramped and unreadable." logoutConfirm: "Really log out?" lastActiveDate: "Last used at" statusbar: "Status bar" diff --git a/locales/index.d.ts b/locales/index.d.ts index 98ab44dd414b0b4a5492ec24722604f93c2df017..6181e08b5615bbf1c9f354a1f1bcd59aa0783643 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -947,6 +947,8 @@ export interface Locale { "document": string; "numberOfPageCache": string; "numberOfPageCacheDescription": string; + "numberOfReplies": string; + "numberOfRepliesDescription": string; "logoutConfirm": string; "lastActiveDate": string; "statusbar": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0af37e041fedbaacd1e18ffa25ea5cc6081d0eeb..6006487a9c0541174a51d2d49ac8ccd575521b65 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -944,6 +944,8 @@ approvalStatus: "承èªçŠ¶æ³" document: "ドã‚ュメント" numberOfPageCache: "ページã‚ャッシュ数" numberOfPageCacheDescription: "多ãã™ã‚‹ã¨åˆ©ä¾¿æ€§ãŒå‘上ã—ã¾ã™ãŒã€è² è·ã¨ãƒ¡ãƒ¢ãƒªä½¿ç”¨é‡ãŒå¢—ãˆã¾ã™ã€‚" +numberOfReplies: "スレッド内ã®è¿”ä¿¡æ•°" +numberOfRepliesDescription: "ã“ã®æ•°å€¤ã‚’大ããã™ã‚‹ã¨ã€ã‚ˆã‚Šå¤šãã®è¿”ä¿¡ãŒè¡¨ç¤ºã•ã‚Œã¾ã™ã€‚ã“ã®å€¤ã‚’大ããã—ã™ãŽã‚‹ã¨ã€è¿”ä¿¡ãŒçª®å±ˆã«ãªã‚Šã€èªã‚ãªããªã‚‹ã“ã¨ãŒã‚ã‚Šã¾ã™ã€‚" logoutConfirm: "ãƒã‚°ã‚¢ã‚¦ãƒˆã—ã¾ã™ã‹ï¼Ÿ" lastActiveDate: "最終利用日時" statusbar: "ステータスãƒãƒ¼" diff --git a/packages/frontend/src/components/MkNoteSub.vue b/packages/frontend/src/components/MkNoteSub.vue index 384a85e546805c5229183f56a817f0658583ef6c..5b1e1af3088ee9c6ce6a0013bcf75058522a22d5 100644 --- a/packages/frontend/src/components/MkNoteSub.vue +++ b/packages/frontend/src/components/MkNoteSub.vue @@ -64,7 +64,7 @@ SPDX-License-Identifier: AGPL-3.0-only </footer> </div> </div> - <template v-if="depth < 5"> + <template v-if="depth < numberOfReplies"> <MkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="$style.reply" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws"/> </template> <div v-else :class="$style.more"> @@ -124,6 +124,7 @@ const translation = ref<any>(null); const translating = ref(false); const isDeleted = ref(false); const renoted = ref(false); +const numberOfReplies = ref(defaultStore.state.numberOfReplies); const reactButton = shallowRef<HTMLElement>(); const renoteButton = shallowRef<HTMLElement>(); const quoteButton = shallowRef<HTMLElement>(); @@ -390,7 +391,7 @@ function menu(viaKeyboard = false): void { if (props.detail) { os.api('notes/children', { noteId: props.note.id, - limit: 5, + limit: numberOfReplies.value, showQuotes: false, }).then(res => { replies = res; diff --git a/packages/frontend/src/components/SkNoteSub.vue b/packages/frontend/src/components/SkNoteSub.vue index 64c71efd4ea964ecbc536d91185c0311d6869b5c..dd4abe8f58fc1d69f74180d0bd3325a0c14a8b00 100644 --- a/packages/frontend/src/components/SkNoteSub.vue +++ b/packages/frontend/src/components/SkNoteSub.vue @@ -72,7 +72,7 @@ SPDX-License-Identifier: AGPL-3.0-only </footer> </div> </div> - <template v-if="depth < 5"> + <template v-if="depth < numberOfReplies"> <SkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="[$style.reply, { [$style.single]: replies.length === 1 }]" :detail="true" :depth="depth + 1" :expandAllCws="props.expandAllCws"/> </template> <div v-else :class="$style.more"> @@ -133,6 +133,7 @@ const translation = ref<any>(null); const translating = ref(false); const isDeleted = ref(false); const renoted = ref(false); +const numberOfReplies = ref(defaultStore.state.numberOfReplies); const reactButton = shallowRef<HTMLElement>(); const renoteButton = shallowRef<HTMLElement>(); const quoteButton = shallowRef<HTMLElement>(); @@ -399,7 +400,7 @@ function menu(viaKeyboard = false): void { if (props.detail) { os.api('notes/children', { noteId: props.note.id, - limit: 5, + limit: numberOfReplies.value, showQuotes: false, }).then(res => { replies = res; diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 38a1b5c2a77181f254c57dceb064abb2b9bd9fe1..419ea1371334d2ce55a7bdabfe5b91dbad1a31c4 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -89,6 +89,11 @@ SPDX-License-Identifier: AGPL-3.0-only <option value="1_1">{{ i18n.t('limitTo', { x: '1:1' }) }}</option> <option value="2_3">{{ i18n.t('limitTo', { x: '2:3' }) }}</option> </MkRadios> + + <MkRange v-model="numberOfReplies" :min="2" :max="20" :step="1" easing> + <template #label>{{ i18n.ts.numberOfReplies }}</template> + <template #caption>{{ i18n.ts.numberOfRepliesDescription }}</template> + </MkRange> </div> </FormSection> @@ -268,6 +273,7 @@ const nsfw = computed(defaultStore.makeGetterSetter('nsfw')); const showFixedPostForm = computed(defaultStore.makeGetterSetter('showFixedPostForm')); const showFixedPostFormInChannel = computed(defaultStore.makeGetterSetter('showFixedPostFormInChannel')); const numberOfPageCache = computed(defaultStore.makeGetterSetter('numberOfPageCache')); +const numberOfReplies = computed(defaultStore.makeGetterSetter('numberOfReplies')); const instanceTicker = computed(defaultStore.makeGetterSetter('instanceTicker')); const enableInfiniteScroll = computed(defaultStore.makeGetterSetter('enableInfiniteScroll')); const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu')); diff --git a/packages/frontend/src/pages/settings/preferences-backups.vue b/packages/frontend/src/pages/settings/preferences-backups.vue index 3f038f8293a73746f93488e1e26f9c24d44516c8..f7768ebe5c6660bd1550bca69133834b5c916847 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'])[] = [ 'reportError', 'squareAvatars', 'numberOfPageCache', + 'numberOfReplies', 'aiChanMode', 'mediaListWithOneImageAppearance', ]; diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index eb16222968bf18fd4eafaf1ae93db65dd737f758..a53336b5f7c9ff3dad3dff1c4bb56185d625f997 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -346,6 +346,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: 3, }, + numberOfReplies: { + where: 'device', + default: 5, + }, showNoteActionsOnlyHover: { where: 'device', default: false,