From 2f8b07e3d072eb2d346a9334e1c2d46e2ace5094 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 27 May 2024 22:33:49 +0900 Subject: [PATCH 1/3] chore: improve withReplies toggle for user following (cherry picked from commit 171a18e761f520f681648f111d47f7ae722a54aa) --- .../frontend/src/scripts/get-user-menu.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index 3e031d232ff9..07bf31d9cde1 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -16,6 +16,7 @@ import { $i, iAmModerator } from '@/account.js'; import { IRouter } from '@/nirax.js'; import { antennasCache, rolesCache, userListsCache } from '@/cache.js'; import { mainRouter } from '@/router/main.js'; +import { MenuItem } from '@/types/menu.js'; export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter = mainRouter) { const meId = $i ? $i.id : null; @@ -81,15 +82,6 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter }); } - async function toggleWithReplies() { - os.apiWithDialog('following/update', { - userId: user.id, - withReplies: !user.withReplies, - }).then(() => { - user.withReplies = !user.withReplies; - }); - } - async function toggleNotify() { os.apiWithDialog('following/update', { userId: user.id, @@ -152,7 +144,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter }); } - let menu = [{ + let menu: MenuItem[] = [{ icon: 'ti ti-at', text: i18n.ts.copyUsername, action: () => { @@ -304,15 +296,25 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter // フォローしたとしても user.isFollowing はリアルタイム更新されないので不便なため //if (user.isFollowing) { + const withRepliesRef = ref(user.withReplies); menu = menu.concat([{ - icon: user.withReplies ? 'ti ti-messages-off' : 'ti ti-messages', - text: user.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline, - action: toggleWithReplies, + type: 'switch', + icon: 'ti ti-messages', + text: i18n.ts.showRepliesToOthersInTimeline, + ref: withRepliesRef, }, { icon: user.notify === 'none' ? 'ti ti-bell' : 'ti ti-bell-off', text: user.notify === 'none' ? i18n.ts.notifyNotes : i18n.ts.unnotifyNotes, action: toggleNotify, }]); + watch(withRepliesRef, (withReplies) => { + misskeyApi('following/update', { + userId: user.id, + withReplies, + }).then(() => { + user.withReplies = withReplies; + }); + }); //} menu = menu.concat([{ type: 'divider' }, { From e0448372bedebc38199a161ec40cda9fd143f70f Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 27 May 2024 22:37:40 +0900 Subject: [PATCH 2/3] chore: improve withReplies toggle for list (cherry picked from commit 401416ea58cd69255f62914c0c1b4554228f3808) --- packages/frontend/src/pages/my-lists/list.vue | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/frontend/src/pages/my-lists/list.vue b/packages/frontend/src/pages/my-lists/list.vue index 7492b099ea60..a2ceb222feea 100644 --- a/packages/frontend/src/pages/my-lists/list.vue +++ b/packages/frontend/src/pages/my-lists/list.vue @@ -133,22 +133,25 @@ async function removeUser(item, ev) { } async function showMembershipMenu(item, ev) { + const withRepliesRef = ref(item.withReplies); os.popupMenu([{ - text: item.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline, - icon: item.withReplies ? 'ti ti-messages-off' : 'ti ti-messages', - action: async () => { - misskeyApi('users/lists/update-membership', { - listId: list.value.id, - userId: item.userId, - withReplies: !item.withReplies, - }).then(() => { - paginationEl.value.updateItem(item.id, (old) => ({ - ...old, - withReplies: !item.withReplies, - })); - }); - }, + type: 'switch', + text: i18n.ts.showRepliesToOthersInTimeline, + icon: 'ti ti-messages', + ref: withRepliesRef, }], ev.currentTarget ?? ev.target); + watch(withRepliesRef, withReplies => { + misskeyApi('users/lists/update-membership', { + listId: list.value!.id, + userId: item.userId, + withReplies, + }).then(() => { + paginationEl.value!.updateItem(item.id, (old) => ({ + ...old, + withReplies, + })); + }); + }); } async function deleteList() { From 4ed33cee13b2a99986df40ce470eaf7ecfd97d51 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 27 May 2024 22:38:48 +0900 Subject: [PATCH 3/3] =?UTF-8?q?docs(changelog):=20=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E4=B8=AD=E3=81=AE=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B"TL=E3=81=AB?= =?UTF-8?q?=E4=BB=96=E3=81=AE=E4=BA=BA=E3=81=B8=E3=81=AE=E8=BF=94=E4=BF=A1?= =?UTF-8?q?=E3=82=92=E5=90=AB=E3=82=81=E3=82=8B"=E3=81=AE=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=8C=E5=88=86=E3=81=8B=E3=82=8A=E3=81=A5=E3=82=89?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit bfca42b528a3bca0db3ae9212e8fbf58b7a2d95e) (cherry picked from commit c6f92c2e88af1fb6791f1b0ac3dc3c0ddb256b2a) --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 559db42d4789..6665a343487d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ### General - Fix: パブリック投稿をホーム投稿に変更するモデレーション操作がリプライに正しく適用されていなかった問題を修正 +### Client +- Fix: フォロー中のユーザーに関する"TLに他の人への返信を含める"の設定が分かりづらい問題を修正 + ## 2024.5.0 (merged to 2024.5.0-kinel.1) ### Note