From e2f34e3db684b2258db3e7370675afe894f5e301 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=9C=E7=89=A9=E3=83=AA=E3=83=B3?= <nassii74@gmail.com>
Date: Tue, 31 Oct 2023 17:26:59 +0900
Subject: [PATCH 1/3] =?UTF-8?q?fix:=20headerAction=E3=81=ABPC=E4=BB=A5?=
 =?UTF-8?q?=E5=A4=96=E3=81=A7=E7=A9=BA=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3?=
 =?UTF-8?q?=E3=81=8C=E5=87=BA=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=83=90?=
 =?UTF-8?q?=E3=82=B0=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#12202)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* headerActionにPC以外で空のボタンが出てしまうバグの修正

* fix eslint
---
 packages/frontend/src/pages/timeline.vue | 62 +++++++++++++-----------
 1 file changed, 34 insertions(+), 28 deletions(-)

diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue
index f601bc8a85..5b97385ead 100644
--- a/packages/frontend/src/pages/timeline.vue
+++ b/packages/frontend/src/pages/timeline.vue
@@ -140,36 +140,42 @@ function focus(): void {
 	tlComponent.focus();
 }
 
-const headerActions = $computed(() => [
-	...[deviceKind === 'desktop' ? {
-		icon: 'ti ti-refresh',
-		text: i18n.ts.reload,
-		handler: (ev) => {
-			console.log('called');
-			tlComponent.reloadTimeline();
-		},
-	} : {}], {
-		icon: 'ti ti-dots',
-		text: i18n.ts.options,
-		handler: (ev) => {
-			os.popupMenu([{
-				type: 'switch',
-				text: i18n.ts.showRenotes,
-				icon: 'ti ti-repeat',
-				ref: $$(withRenotes),
-			}, src === 'local' || src === 'social' ? {
-				type: 'switch',
-				text: i18n.ts.showRepliesToOthersInTimeline,
-				ref: $$(withReplies),
-			} : undefined, {
-				type: 'switch',
-				text: i18n.ts.fileAttachedOnly,
-				icon: 'ti ti-photo',
-				ref: $$(onlyFiles),
-			}], ev.currentTarget ?? ev.target);
+const headerActions = $computed(() => {
+	const tmp = [
+		{
+			icon: 'ti ti-dots',
+			text: i18n.ts.options,
+			handler: (ev) => {
+				os.popupMenu([{
+					type: 'switch',
+					text: i18n.ts.showRenotes,
+					icon: 'ti ti-repeat',
+					ref: $$(withRenotes),
+				}, src === 'local' || src === 'social' ? {
+					type: 'switch',
+					text: i18n.ts.showRepliesToOthersInTimeline,
+					ref: $$(withReplies),
+				} : undefined, {
+					type: 'switch',
+					text: i18n.ts.fileAttachedOnly,
+					icon: 'ti ti-photo',
+					ref: $$(onlyFiles),
+				}], ev.currentTarget ?? ev.target);
+			},
 		},
+	];
+	if (deviceKind === 'desktop') {
+		tmp.unshift({
+			icon: 'ti ti-refresh',
+			text: i18n.ts.reload,
+			handler: (ev: Event) => {
+				console.log('called');
+				tlComponent.reloadTimeline();
+			},
+		});
 	}
-]);
+	return tmp;
+});
 
 const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({
 	key: 'list:' + l.id,

From cf026e4c72eda0708aef0109901098a7bf10ffa4 Mon Sep 17 00:00:00 2001
From: anatawa12 <anatawa12@icloud.com>
Date: Tue, 31 Oct 2023 17:28:13 +0900
Subject: [PATCH 2/3] feat: add tools to navbar (#12204)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* feat: add tools to navbar

* docs(changelog): ナビゲーションバーにツールを追加しました
---
 CHANGELOG.md                                |  1 +
 packages/frontend/src/navbar.ts             |  9 ++-
 packages/frontend/src/ui/_common_/common.ts | 63 ++++++++++++---------
 3 files changed, 46 insertions(+), 27 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 51b96831fc..999f2e43db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@
 - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました
 	- 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください
 	  https://misskey-hub.net/docs/advanced/publish-on-your-website.html
+- Feat: ナビゲーションバーにツールを追加しました
 - Enhance: スワイプしてタイムラインを再読込できるように
 	- PCの場合は右上のボタンからでも再読込できます
 - Enhance: タイムラインの自動更新を無効にできるように
diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts
index 7f182a98f7..e72a4dc316 100644
--- a/packages/frontend/src/navbar.ts
+++ b/packages/frontend/src/navbar.ts
@@ -6,7 +6,7 @@
 import { computed, reactive } from 'vue';
 import { $i } from '@/account.js';
 import { miLocalStorage } from '@/local-storage.js';
-import { openInstanceMenu } from '@/ui/_common_/common.js';
+import { openInstanceMenu, openToolsMenu } from '@/ui/_common_/common.js';
 import { lookup } from '@/scripts/lookup.js';
 import * as os from '@/os.js';
 import { i18n } from '@/i18n.js';
@@ -142,6 +142,13 @@ export const navbarItemDef = reactive({
 			openInstanceMenu(ev);
 		},
 	},
+	tools: {
+		title: i18n.ts.tools,
+		icon: 'ti ti-tool',
+		action: (ev) => {
+			openToolsMenu(ev);
+		},
+	},
 	reload: {
 		title: i18n.ts.reload,
 		icon: 'ti ti-refresh',
diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts
index 125d340fe7..ff6157f5f8 100644
--- a/packages/frontend/src/ui/_common_/common.ts
+++ b/packages/frontend/src/ui/_common_/common.ts
@@ -3,12 +3,42 @@
  * SPDX-License-Identifier: AGPL-3.0-only
  */
 
+import type { MenuItem } from '@/types/menu.js';
 import * as os from '@/os.js';
 import { instance } from '@/instance.js';
 import { host } from '@/config.js';
 import { i18n } from '@/i18n.js';
 import { $i } from '@/account.js';
 
+function toolsMenuItems(): MenuItem[] {
+	return [{
+		type: 'link',
+		to: '/scratchpad',
+		text: i18n.ts.scratchpad,
+		icon: 'ti ti-terminal-2',
+	}, {
+		type: 'link',
+		to: '/api-console',
+		text: 'API Console',
+		icon: 'ti ti-terminal-2',
+	}, {
+		type: 'link',
+		to: '/clicker',
+		text: '🍪👈',
+		icon: 'ti ti-cookie',
+	}, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
+		type: 'link',
+		to: '/custom-emojis-manager',
+		text: i18n.ts.manageCustomEmojis,
+		icon: 'ti ti-icons',
+	} : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? {
+		type: 'link',
+		to: '/avatar-decorations',
+		text: i18n.ts.manageAvatarDecorations,
+		icon: 'ti ti-sparkles',
+	} : undefined];
+}
+
 export function openInstanceMenu(ev: MouseEvent) {
 	os.popupMenu([{
 		text: instance.name ?? host,
@@ -47,32 +77,7 @@ export function openInstanceMenu(ev: MouseEvent) {
 		type: 'parent',
 		text: i18n.ts.tools,
 		icon: 'ti ti-tool',
-		children: [{
-			type: 'link',
-			to: '/scratchpad',
-			text: i18n.ts.scratchpad,
-			icon: 'ti ti-terminal-2',
-		}, {
-			type: 'link',
-			to: '/api-console',
-			text: 'API Console',
-			icon: 'ti ti-terminal-2',
-		}, {
-			type: 'link',
-			to: '/clicker',
-			text: '🍪👈',
-			icon: 'ti ti-cookie',
-		}, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
-			type: 'link',
-			to: '/custom-emojis-manager',
-			text: i18n.ts.manageCustomEmojis,
-			icon: 'ti ti-icons',
-		} : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? {
-			type: 'link',
-			to: '/avatar-decorations',
-			text: i18n.ts.manageAvatarDecorations,
-			icon: 'ti ti-sparkles',
-		} : undefined],
+		children: toolsMenuItems(),
 	}, null, (instance.impressumUrl) ? {
 		text: i18n.ts.impressum,
 		icon: 'ti ti-file-invoice',
@@ -105,3 +110,9 @@ export function openInstanceMenu(ev: MouseEvent) {
 		align: 'left',
 	});
 }
+
+export function openToolsMenu(ev: MouseEvent) {
+	os.popupMenu(toolsMenuItems(), ev.currentTarget ?? ev.target, {
+		align: 'left',
+	});
+}

From 735f22c1c5a7a1904ce1c0b197f3fc61c9de1bbc Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Tue, 31 Oct 2023 17:29:21 +0900
Subject: [PATCH 3/3] Update CHANGELOG.md

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 999f2e43db..feabb8e0f9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,6 @@
 - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました
 	- 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください
 	  https://misskey-hub.net/docs/advanced/publish-on-your-website.html
-- Feat: ナビゲーションバーにツールを追加しました
 - Enhance: スワイプしてタイムラインを再読込できるように
 	- PCの場合は右上のボタンからでも再読込できます
 - Enhance: タイムラインの自動更新を無効にできるように
@@ -39,6 +38,7 @@
 - Enhance: プラグインを削除した際には、使用されていたアクセストークンも同時に削除されるようになりました
 - Enhance: プラグインで`Plugin:register_note_view_interruptor`を用いてnoteの代わりにnullを返却することでノートを非表示にできるようになりました
 - Enhance: AiScript関数`Mk:nyaize()`が追加されました
+- Enhance: 情報→ツール はナビゲーションバーにツールとして独立した項目になりました
 - Enhance: その他細かなブラッシュアップ
 - Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正
 - Fix: ユーザーページの ノート > ファイル付き タブにリプライが表示されてしまう