From 1a2f1a5bfb12c69215ed58cc4f80ad5d49e21753 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 20 Oct 2024 16:26:39 +0900
Subject: [PATCH 1/8] =?UTF-8?q?enhance(frontend):=20=E6=8A=95=E7=A8=BF?=
=?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0=E3=81=AE=E8=A8=AD=E5=AE=9A?=
=?UTF-8?q?=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=82=92=E6=94=B9=E8=89=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
locales/index.d.ts | 8 +
locales/ja-JP.yml | 2 +
.../frontend/src/components/MkPostForm.vue | 49 +--
.../src/components/MkPostFormOtherMenu.vue | 321 ++++++++++++++++++
packages/frontend/src/filters/number.ts | 2 +-
5 files changed, 361 insertions(+), 21 deletions(-)
create mode 100644 packages/frontend/src/components/MkPostFormOtherMenu.vue
diff --git a/locales/index.d.ts b/locales/index.d.ts
index b5af5909a3..5af999b16b 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -5190,6 +5190,14 @@ export interface Locale extends ILocale {
* 名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。
*/
"yourNameContainsProhibitedWordsDescription": string;
+ /**
+ * 文字数
+ */
+ "textCount": string;
+ /**
+ * リセット
+ */
+ "reset": string;
"_abuseUserReport": {
/**
* 転送
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index c448d4d50a..d4b2d8dcc8 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1293,6 +1293,8 @@ prohibitedWordsForNameOfUser: "禁止ワード(ユーザーの名前)"
prohibitedWordsForNameOfUserDescription: "このリストに含まれる文字列がユーザーの名前に含まれる場合、ユーザーの名前の変更を拒否します。モデレーター権限を持つユーザーはこの制限の影響を受けません。"
yourNameContainsProhibitedWords: "変更しようとした名前に禁止された文字列が含まれています"
yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。"
+textCount: "文字数"
+reset: "リセット"
_abuseUserReport:
forward: "転送"
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index 76a6e4212a..29c306ea35 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
+
-
-
-
-
-
+
@@ -174,6 +170,7 @@ const textareaEl = shallowRef
(null);
const cwInputEl = shallowRef(null);
const hashtagsInputEl = shallowRef(null);
const visibilityButton = shallowRef();
+const otherSettingsButton = shallowRef();
const posting = ref(false);
const posted = ref(false);
@@ -527,20 +524,32 @@ async function toggleLocalOnly() {
}
}
-async function toggleReactionAcceptance() {
- const select = await os.select({
- title: i18n.ts.reactionAcceptance,
- items: [
- { value: null, text: i18n.ts.all },
- { value: 'likeOnlyForRemote' as const, text: i18n.ts.likeOnlyForRemote },
- { value: 'nonSensitiveOnly' as const, text: i18n.ts.nonSensitiveOnly },
- { value: 'nonSensitiveOnlyForLocalLikeOnlyForRemote' as const, text: i18n.ts.nonSensitiveOnlyForLocalLikeOnlyForRemote },
- { value: 'likeOnly' as const, text: i18n.ts.likeOnly },
- ],
- default: reactionAcceptance.value,
+function showOtherSettings() {
+ const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkPostFormOtherMenu.vue')), {
+ currentReactionAcceptance: reactionAcceptance.value,
+ textLength: textLength.value,
+ src: otherSettingsButton.value,
+ }, {
+ changeReactionAcceptance: (value: Misskey.entities.Note['reactionAcceptance']) => {
+ reactionAcceptance.value = value;
+ },
+ reset: () => {
+ reset();
+ },
+ closed: () => dispose(),
});
- if (select.canceled) return;
- reactionAcceptance.value = select.result;
+}
+
+function reset() {
+ text.value = '';
+ cw.value = null;
+ useCw.value = false;
+ visibility.value = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
+ localOnly.value = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
+ files.value = [];
+ poll.value = null;
+ quoteId.value = null;
+ reactionAcceptance.value = defaultStore.state.reactionAcceptance;
}
function pushVisibleUser(user: Misskey.entities.UserDetailed) {
diff --git a/packages/frontend/src/components/MkPostFormOtherMenu.vue b/packages/frontend/src/components/MkPostFormOtherMenu.vue
new file mode 100644
index 0000000000..7d0406d562
--- /dev/null
+++ b/packages/frontend/src/components/MkPostFormOtherMenu.vue
@@ -0,0 +1,321 @@
+
+
+
+
+
+
+
{{ i18n.ts.textCount }}
+
+
+
{{ number(textLength) }} / {{ number(maxTextLength) }}
+
+
+
+
+
+
+ {{ i18n.ts.reactionAcceptance }}
+
+
+
+
+
+
+ {{ i18n.ts.reset }}
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/frontend/src/filters/number.ts b/packages/frontend/src/filters/number.ts
index 10fb64deb4..479afd58d4 100644
--- a/packages/frontend/src/filters/number.ts
+++ b/packages/frontend/src/filters/number.ts
@@ -5,4 +5,4 @@
import { numberFormat } from '@@/js/intl-const.js';
-export default n => n == null ? 'N/A' : numberFormat.format(n);
+export default (n?: number) => n == null ? 'N/A' : numberFormat.format(n);
From c43c7fee57eda42e1b25f999b6f1eb05fe2bbd01 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 20 Oct 2024 16:27:48 +0900
Subject: [PATCH 2/8] Update Changelog
---
CHANGELOG.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c3a5e41787..2ed7180003 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,9 @@
### Client
- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
+- Enhance: 投稿フォームの設定メニューを改良
+ - 投稿フォームをリセットできるように
+ - 文字数カウントを復活
### Server
-
From 869777983c9665d4fdd013dc8c208ecadbc19e24 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 20 Oct 2024 16:38:37 +0900
Subject: [PATCH 3/8] indent
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ed7180003..aaf2d2ac03 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
- Enhance: 投稿フォームの設定メニューを改良
- 投稿フォームをリセットできるように
- - 文字数カウントを復活
+ - 文字数カウントを復活
### Server
-
From ce3679798c5b642dd0e47056f70657e46b382b5e Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 20 Oct 2024 17:46:33 +0900
Subject: [PATCH 4/8] =?UTF-8?q?MkMenu=E3=81=AEitem=E3=82=92=E5=88=87?=
=?UTF-8?q?=E3=82=8A=E5=87=BA=E3=81=97=E3=81=A6=E5=85=B1=E9=80=9A=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../frontend/src/components/MkMenu.item.vue | 420 ++++++++++++++++++
packages/frontend/src/components/MkMenu.vue | 394 +---------------
packages/frontend/src/components/MkModal.vue | 3 +-
.../frontend/src/components/MkPostForm.vue | 14 +-
.../src/components/MkPostFormOtherMenu.vue | 191 ++------
packages/frontend/src/style.scss | 4 +
packages/frontend/src/types/menu.ts | 2 +
7 files changed, 483 insertions(+), 545 deletions(-)
create mode 100644 packages/frontend/src/components/MkMenu.item.vue
diff --git a/packages/frontend/src/components/MkMenu.item.vue b/packages/frontend/src/components/MkMenu.item.vue
new file mode 100644
index 0000000000..0d51cbc2f4
--- /dev/null
+++ b/packages/frontend/src/components/MkMenu.item.vue
@@ -0,0 +1,420 @@
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
diff --git a/packages/frontend/src/components/MkMenu.vue b/packages/frontend/src/components/MkMenu.vue
index 13a65e411f..2db3d0b227 100644
--- a/packages/frontend/src/components/MkMenu.vue
+++ b/packages/frontend/src/components/MkMenu.vue
@@ -8,8 +8,6 @@ SPDX-License-Identifier: AGPL-3.0-only
role="menu"
:class="{
[$style.root]: true,
- [$style.center]: align === 'center',
- [$style.big]: big,
[$style.asDrawer]: asDrawer,
}"
@focusin.passive.stop="() => {}"
@@ -27,144 +25,19 @@ SPDX-License-Identifier: AGPL-3.0-only
@keydown.stop="() => {}"
@contextmenu.self.prevent="() => {}"
>
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
+
{{ i18n.ts.none }}
@@ -176,9 +49,8 @@ SPDX-License-Identifier: AGPL-3.0-only
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index 29c306ea35..ccf3700608 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -534,24 +534,12 @@ function showOtherSettings() {
reactionAcceptance.value = value;
},
reset: () => {
- reset();
+ clear();
},
closed: () => dispose(),
});
}
-function reset() {
- text.value = '';
- cw.value = null;
- useCw.value = false;
- visibility.value = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
- localOnly.value = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
- files.value = [];
- poll.value = null;
- quoteId.value = null;
- reactionAcceptance.value = defaultStore.state.reactionAcceptance;
-}
-
function pushVisibleUser(user: Misskey.entities.UserDetailed) {
if (!visibleUsers.value.some(u => u.username === user.username && u.host === user.host)) {
visibleUsers.value.push(user);
diff --git a/packages/frontend/src/components/MkPostFormOtherMenu.vue b/packages/frontend/src/components/MkPostFormOtherMenu.vue
index 7d0406d562..f0389c6a3b 100644
--- a/packages/frontend/src/components/MkPostFormOtherMenu.vue
+++ b/packages/frontend/src/components/MkPostFormOtherMenu.vue
@@ -19,40 +19,12 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
-
- {{ i18n.ts.reactionAcceptance }}
-
-
-
-
-
-
- {{ i18n.ts.reset }}
-
-
+
@@ -61,12 +33,17 @@ SPDX-License-Identifier: AGPL-3.0-only
From f722dddd75f82bbf8bad1d8ddd5c21825c2c18c9 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Mon, 21 Oct 2024 23:23:57 +0900
Subject: [PATCH 6/8] =?UTF-8?q?fix:=20=E3=83=89=E3=83=AD=E3=83=AF=E3=83=BC?=
=?UTF-8?q?=E3=81=AA=E3=81=A9=E3=81=AEOption=E3=81=8C=E5=BD=93=E3=81=9F?=
=?UTF-8?q?=E3=82=89=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../frontend/src/components/MkMenu.item.vue | 282 +++++++++---------
1 file changed, 142 insertions(+), 140 deletions(-)
diff --git a/packages/frontend/src/components/MkMenu.item.vue b/packages/frontend/src/components/MkMenu.item.vue
index 0d51cbc2f4..0b7367d5d2 100644
--- a/packages/frontend/src/components/MkMenu.item.vue
+++ b/packages/frontend/src/components/MkMenu.item.vue
@@ -3,143 +3,145 @@ SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
From cf58b4dc2e0de5d7c7010eb8568a6cb414742fd5 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Fri, 25 Oct 2024 11:33:39 +0900
Subject: [PATCH 8/8] =?UTF-8?q?=E3=83=81=E3=83=A5=E3=83=BC=E3=83=88?=
=?UTF-8?q?=E3=83=AA=E3=82=A2=E3=83=AB=E3=81=A7=E8=A9=B0=E3=82=80=E5=95=8F?=
=?UTF-8?q?=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
---
packages/frontend/src/components/MkPostFormOtherMenu.vue | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/packages/frontend/src/components/MkPostFormOtherMenu.vue b/packages/frontend/src/components/MkPostFormOtherMenu.vue
index cfa356b0a2..0db4d98266 100644
--- a/packages/frontend/src/components/MkPostFormOtherMenu.vue
+++ b/packages/frontend/src/components/MkPostFormOtherMenu.vue
@@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only