Skip to content

Commit 27f823e

Browse files
enhance(frontend): リアクションの総数を表示するか設定で選べるように (#13539)
* enhance(frontend): リプライ・リノート・リアクションの総数を表示するか設定で選べるように (MisskeyIO#512) (cherry picked from commit 3c8475e) * fix: いいねのみの場合は強制的にカウント表示 * make `showReactionsCount` default false * リアクションだけ * けしわすれ * けしわすれ2 --------- Co-authored-by: まっちゃとーにゅ <[email protected]>
1 parent f4a5740 commit 27f823e

File tree

7 files changed

+16
-4
lines changed

7 files changed

+16
-4
lines changed

locales/index.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,10 @@ export interface Locale extends ILocale {
19921992
* ノートのアクションをホバー時のみ表示する
19931993
*/
19941994
"showNoteActionsOnlyHover": string;
1995+
/**
1996+
* ノートのリアクション数を表示する
1997+
*/
1998+
"showReactionsCount": string;
19951999
/**
19962000
* 履歴はありません
19972001
*/

locales/ja-JP.yml

+1
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ emojiStyle: "絵文字のスタイル"
494494
native: "ネイティブ"
495495
disableDrawer: "メニューをドロワーで表示しない"
496496
showNoteActionsOnlyHover: "ノートのアクションをホバー時のみ表示する"
497+
showReactionsCount: "ノートのリアクション数を表示する"
497498
noHistory: "履歴はありません"
498499
signinHistory: "ログイン履歴"
499500
enableAdvancedMfm: "高度なMFMを有効にする"

packages/frontend/src/components/MkNote.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ SPDX-License-Identifier: AGPL-3.0-only
121121
<i v-else-if="appearNote.myReaction != null" class="ti ti-minus" style="color: var(--accent);"></i>
122122
<i v-else-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart"></i>
123123
<i v-else class="ti ti-plus"></i>
124-
<p v-if="appearNote.reactionCount > 0" :class="$style.footerButtonCount">{{ number(appearNote.reactionCount) }}</p>
124+
<p v-if="(appearNote.reactionAcceptance === 'likeOnly' || defaultStore.state.showReactionsCount) && appearNote.reactionCount > 0" :class="$style.footerButtonCount">{{ number(appearNote.reactionCount) }}</p>
125125
</button>
126126
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" :class="$style.footerButton" class="_button" @mousedown="clip()">
127127
<i class="ti ti-paperclip"></i>

packages/frontend/src/components/MkNoteDetailed.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ SPDX-License-Identifier: AGPL-3.0-only
129129
<i v-else-if="appearNote.myReaction != null" class="ti ti-minus" style="color: var(--accent);"></i>
130130
<i v-else-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart"></i>
131131
<i v-else class="ti ti-plus"></i>
132-
<p v-if="appearNote.reactionCount > 0" :class="$style.noteFooterButtonCount">{{ number(appearNote.reactionCount) }}</p>
132+
<p v-if="(appearNote.reactionAcceptance === 'likeOnly' || defaultStore.state.showReactionsCount) && appearNote.reactionCount > 0" :class="$style.noteFooterButtonCount">{{ number(appearNote.reactionCount) }}</p>
133133
</button>
134134
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" class="_button" :class="$style.noteFooterButton" @mousedown="clip()">
135135
<i class="ti ti-paperclip"></i>

packages/frontend/src/pages/settings/general.vue

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ SPDX-License-Identifier: AGPL-3.0-only
5656
<MkSwitch v-model="advancedMfm">{{ i18n.ts.enableAdvancedMfm }}</MkSwitch>
5757
<MkSwitch v-if="advancedMfm" v-model="animatedMfm">{{ i18n.ts.enableAnimatedMfm }}</MkSwitch>
5858
<MkSwitch v-if="advancedMfm" v-model="enableQuickAddMfmFunction">{{ i18n.ts.enableQuickAddMfmFunction }}</MkSwitch>
59+
<MkSwitch v-model="showReactionsCount">{{ i18n.ts.showReactionsCount }}</MkSwitch>
5960
<MkSwitch v-model="showGapBetweenNotesInTimeline">{{ i18n.ts.showGapBetweenNotesInTimeline }}</MkSwitch>
6061
<MkSwitch v-model="loadRawImages">{{ i18n.ts.loadRawImages }}</MkSwitch>
6162
<MkRadios v-model="reactionsDisplaySize">
@@ -281,6 +282,7 @@ const useBlurEffect = computed(defaultStore.makeGetterSetter('useBlurEffect'));
281282
const showGapBetweenNotesInTimeline = computed(defaultStore.makeGetterSetter('showGapBetweenNotesInTimeline'));
282283
const animatedMfm = computed(defaultStore.makeGetterSetter('animatedMfm'));
283284
const advancedMfm = computed(defaultStore.makeGetterSetter('advancedMfm'));
285+
const showReactionsCount = computed(defaultStore.makeGetterSetter('showReactionsCount'));
284286
const enableQuickAddMfmFunction = computed(defaultStore.makeGetterSetter('enableQuickAddMfmFunction'));
285287
const emojiStyle = computed(defaultStore.makeGetterSetter('emojiStyle'));
286288
const disableDrawer = computed(defaultStore.makeGetterSetter('disableDrawer'));

packages/frontend/src/pages/settings/preferences-backups.vue

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
7070
'animation',
7171
'animatedMfm',
7272
'advancedMfm',
73+
'showReactionsCount',
7374
'loadRawImages',
7475
'imageNewTab',
7576
'dataSaver',

packages/frontend/src/store.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ export const defaultStore = markRaw(new Storage('base', {
227227
where: 'device',
228228
default: true,
229229
},
230+
showReactionsCount: {
231+
where: 'device',
232+
default: false,
233+
},
230234
enableQuickAddMfmFunction: {
231235
where: 'device',
232236
default: false,
@@ -431,10 +435,10 @@ export const defaultStore = markRaw(new Storage('base', {
431435
sfxVolume: 1,
432436
},
433437
},
434-
hemisphere: {
438+
hemisphere: {
435439
where: 'device',
436440
default: hemisphere as 'N' | 'S',
437-
},
441+
},
438442
enableHorizontalSwipe: {
439443
where: 'device',
440444
default: true,

0 commit comments

Comments
 (0)