From e0d76ef8efb4dfd577c8a7f564ab8f07ba701289 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 20 Apr 2023 07:57:36 +0000 Subject: [PATCH] feat: make it toggleable whether to disable emojis in notifications (#9880) I talked about feature #9865 on my fedi account and received a comment like, "I don't care about emoji reactions in my timelines, but I do care what reactions I get!" Adding too many options is bad, but I agreed that making it toggleable whether to disable emojis in notifications is helpful, so I added this feature. This allows you to check emoji reactions to your posts in notifications while using the simple UI. I'd say this provides an experience that neither Mastodon nor Misskey has. The new setting item shows up only when you disable emoji reactions. Co-authored-by: naskya Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9880 Co-authored-by: naskya Co-committed-by: naskya --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + locales/zh-CN.yml | 1 + locales/zh-TW.yml | 1 + packages/client/src/components/MkNotification.vue | 9 +++++---- .../client/src/pages/settings/preferences-backups.vue | 1 + packages/client/src/pages/settings/reaction.vue | 11 +++++++++++ packages/client/src/store.ts | 4 ++++ 8 files changed, 25 insertions(+), 4 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 60e7c77408..e71368ed29 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -115,6 +115,7 @@ sensitive: "NSFW" add: "Add" reaction: "Reactions" enableEmojiReactions: "Enable emoji reactions" +showEmojisInReactionNotifications: "Show emojis in reaction notifications" reactionSetting: "Reactions to show in the reaction picker" reactionSettingDescription2: "Drag to reorder, click to delete, press \"+\" to add." rememberNoteVisibility: "Remember post visibility settings" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 9fbf712885..d998097af8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -110,6 +110,7 @@ sensitive: "閲覧注意" add: "追加" reaction: "リアクション" enableEmojiReactions: "絵文字リアクションを有効にする" +showEmojisInReactionNotifications: "自分の投稿に対するリアクションの通知で絵文字を表示する" reactionSetting: "ピッカーに表示するリアクション" reactionSettingDescription2: "ドラッグして並び替え、クリックして削除、+を押して追加します。" rememberNoteVisibility: "公開範囲を記憶する" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index fc507b8e06..c652b52b7d 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -108,6 +108,7 @@ sensitive: "敏感内容" add: "添加" reaction: "回应" enableEmojiReaction: "启用表情符号回应" +showEmojisInReactionNotifications: "在回应通知中显示表情符号" reactionSetting: "在选择器中显示的回应" reactionSettingDescription2: "拖动重新排序,单击删除,点击 + 添加。" rememberNoteVisibility: "保存上次设置的可见性" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index c46452e88a..d940838dc9 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -108,6 +108,7 @@ sensitive: "敏感內容" add: "新增" reaction: "情感" enableEmojiReaction: "啟用表情符號反應" +showEmojisInReactionNotifications: "在反應通知中顯示表情符號" reactionSetting: "在選擇器中顯示反應" reactionSettingDescription2: "拖動以重新列序,點擊以刪除,按下 + 添加。" rememberNoteVisibility: "記住貼文可見性" diff --git a/packages/client/src/components/MkNotification.vue b/packages/client/src/components/MkNotification.vue index 841a0fc999..c909873a55 100644 --- a/packages/client/src/components/MkNotification.vue +++ b/packages/client/src/components/MkNotification.vue @@ -66,8 +66,7 @@ (null); const reactionRef = ref(null); +const showEmojiReactions = + defaultStore.state.enableEmojiReactions || + defaultStore.state.showEmojisInReactionNotifications; const defaultReaction = ["⭐", "👍", "❤️"].includes(instance.defaultReaction) ? instance.defaultReaction : "⭐"; diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue index 3b45fa7965..81f68fad1b 100644 --- a/packages/client/src/pages/settings/preferences-backups.vue +++ b/packages/client/src/pages/settings/preferences-backups.vue @@ -115,6 +115,7 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [ "showAdminUpdates", "enableCustomKaTeXMacro", "enableEmojiReactions", + "showEmojisInReactionNotifications", ]; const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [ "lightTheme", diff --git a/packages/client/src/pages/settings/reaction.vue b/packages/client/src/pages/settings/reaction.vue index e32f6516ea..d8578a6f7f 100644 --- a/packages/client/src/pages/settings/reaction.vue +++ b/packages/client/src/pages/settings/reaction.vue @@ -86,6 +86,14 @@ +
+ + {{ i18n.ts.showEmojisInReactionNotifications }} + +
@@ -132,6 +140,9 @@ const reactionPickerUseDrawerForMobile = $computed( const enableEmojiReactions = $computed( defaultStore.makeGetterSetter("enableEmojiReactions") ); +const showEmojisInReactionNotifications = $computed( + defaultStore.makeGetterSetter("showEmojisInReactionNotifications") +); function save() { defaultStore.set("reactions", reactions); diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 4cb28b0004..b4e10d2750 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -298,6 +298,10 @@ export const defaultStore = markRaw( where: "account", default: true, }, + showEmojisInReactionNotifications: { + where: "account", + default: true, + }, }), );