From 1f9f63df7c5fe7b59b204accc05c6888461fa733 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
 <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Thu, 4 May 2023 19:58:17 +0900
Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E3=81=93=E3=81=AE=E3=83=95=E3=82=A1?=
 =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=8B=E3=82=89=E3=83=8E=E3=83=BC=E3=83=88?=
 =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=80=8D=E3=83=9C=E3=82=BF=E3=83=B3?=
 =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#10758)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* (add) note this file button

* Update CHANGELOG.md
---
 CHANGELOG.md                                         | 1 +
 locales/ja-JP.yml                                    | 1 +
 packages/frontend/src/scripts/get-drive-file-menu.ts | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9dc1928dfb..204f7227dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -43,6 +43,7 @@
 - Renoteしたユーザーの一覧を見れるように
 - Fix: AiScript APIのMk:dialogで何も返していなかったのをNULLを返すように修正
 - Fix: リアクションをホバーした時のユーザーリストで猫耳が切れてしまっていた問題を修正
+- ドライブのファイル一覧から直接ノートを作成できるように
 
 ### Server
 - 環境変数MISSKEY_CONFIG_YMLで設定ファイルをdefault.ymlから変更可能に
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 1958b649d4..358d4e8c9f 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1029,6 +1029,7 @@ pleaseAgreeAllToContinue: "続けるには、全ての「同意する」にチ
 continue: "続ける"
 preservedUsernames: "予約ユーザー名"
 preservedUsernamesDescription: "予約するユーザー名を改行で列挙します。ここで指定されたユーザー名はアカウント作成時に使えなくなりますが、管理者によるアカウント作成時はこの制限を受けません。また、既に存在するアカウントも影響を受けません。"
+createNoteFromTheFile: "このファイルからノートを作成"
 
 _serverRules:
   description: "新規登録前に表示する、サーバーの簡潔なルールを設定します。内容は利用規約の要約とすることを推奨します。"
diff --git a/packages/frontend/src/scripts/get-drive-file-menu.ts b/packages/frontend/src/scripts/get-drive-file-menu.ts
index 52e610e437..e4ebdcb15b 100644
--- a/packages/frontend/src/scripts/get-drive-file-menu.ts
+++ b/packages/frontend/src/scripts/get-drive-file-menu.ts
@@ -74,6 +74,12 @@ export function getDriveFileMenu(file: Misskey.entities.DriveFile) {
 		icon: 'ti ti-text-caption',
 		action: () => describe(file),
 	}, null, {
+		text: i18n.ts.createNoteFromTheFile,
+		icon: 'ti ti-pencil',
+		action: () => os.post({
+			initialFiles: [file],
+		}),
+	}, {
 		text: i18n.ts.copyUrl,
 		icon: 'ti ti-link',
 		action: () => copyUrl(file),