diff --git a/README.md b/README.md index ef562022..4775c6af 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ ## 主要な変更点 +- モバイル表示の下部のチャットボタンをアカウント切り替えボタンに変更可能に + - これ無しで PWA で複数アカウントを使おうとすると腱鞘炎になる - ローカルタイムラインの位置をグローバルタイムラインの直前に移動 - ローカルタイムラインよりもソーシャルタイムラインのほうが使いやすいと考えたため - 「Firefish について」のページに Misskey の主要な貢献者を表示 diff --git a/locales/en-US.yml b/locales/en-US.yml index 6ca3a1b0..afc4809e 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1129,6 +1129,8 @@ showPreviewByDefault: "Show preview in posting form by default" originalFeature: "original" preventMisclick: "Accidental click prevention" hideFollowButtons: "Hide follow buttons in notifications and user pages" +forMobile: "Mobile" +replaceChatButtonWithAccountButton: "Replace chat button at the bottom with account switch button" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index aa5e380f..37156d04 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -989,6 +989,8 @@ showPreviewByDefault: "投稿画面でプレビュー表示をデフォルトで originalFeature: "独自機能" preventMisclick: "誤タップ防止" hideFollowButtons: "新規フォロワーの通知とユーザーページの ... の隣にあるフォローボタンを隠す" +forMobile: "モバイル向け" +replaceChatButtonWithAccountButton: "画面下部のチャットのボタンをアカウント切り替えボタンに変更する" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index b2d6df03..9f48eff8 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -154,6 +154,7 @@ export async function openAccountMenu( onChoose?: (account: misskey.entities.UserDetailed) => void; }, ev: MouseEvent, + isMobile?: boolean, ) { function showSigninDialog() { popup( @@ -230,48 +231,70 @@ export async function openAccountMenu( popupMenu( [ ...[ - { - type: "link", - text: i18n.ts.profile, - to: `/@${$i.username}`, - avatar: $i, - }, - null, + ...(isMobile ?? false + ? [ + { + type: "parent", + icon: "ph-plus ph-bold ph-lg", + text: i18n.ts.addAccount, + children: [ + { + text: i18n.ts.existingAccount, + action: () => { + showSigninDialog(); + }, + }, + { + text: i18n.ts.createAccount, + action: () => { + createAccount(); + }, + }, + ], + }, + ] + : [ + { + type: "link", + text: i18n.ts.profile, + to: `/@${$i.username}`, + avatar: $i, + }, + null, + ]), ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, - { - type: "parent", - icon: "ph-plus ph-bold ph-lg", - text: i18n.ts.addAccount, - children: [ - { - text: i18n.ts.existingAccount, - action: () => { - showSigninDialog(); + ...(isMobile ?? false + ? [ + null, + { + type: "link", + text: i18n.ts.profile, + to: `/@${$i.username}`, + avatar: $i, }, - }, - { - text: i18n.ts.createAccount, - action: () => { - createAccount(); + ] + : [ + { + type: "parent", + icon: "ph-plus ph-bold ph-lg", + text: i18n.ts.addAccount, + children: [ + { + text: i18n.ts.existingAccount, + action: () => { + showSigninDialog(); + }, + }, + { + text: i18n.ts.createAccount, + action: () => { + createAccount(); + }, + }, + ], }, - }, - ], - }, - { - type: "link", - icon: "ph-users ph-bold ph-lg", - text: i18n.ts.manageAccounts, - to: "/settings/accounts", - }, - { - type: "button", - icon: "ph-sign-out ph-bold ph-lg", - text: i18n.ts.logout, - action: () => { - signout(); - }, - }, + ]), ], ], ev.currentTarget ?? ev.target, diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 1015fe96..4a6a4ca8 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -238,6 +238,18 @@ > + + + {{ i18n.ts.replaceChatButtonWithAccountButton + }}{{ + i18n.ts.originalFeature + }} + + { defaultStore.set("swipeOnMobile", true); diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 89709e4f..2d19bcad 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -350,6 +350,10 @@ export const defaultStore = markRaw( where: "device", default: true, }, + replaceChatButtonWithAccountButton: { + where: "device", + default: true, + }, }), ); diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 5fca2648..a744082e 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -86,6 +86,20 @@ +