From e366b589d3d86c5867cbee370de9045f8a1a9373 Mon Sep 17 00:00:00 2001
From: nakkaa <10798675+nakkaa@users.noreply.github.com>
Date: Thu, 2 May 2024 21:53:26 +0900
Subject: [PATCH] =?UTF-8?q?=E7=84=A1=E5=8D=B0=E3=81=A7=E3=82=82=E4=B8=8B?=
=?UTF-8?q?=E6=9B=B8=E3=81=8D=E3=81=8C=E5=8B=95=E3=81=8F=E3=82=88=E3=81=86?=
=?UTF-8?q?=E3=81=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
locales/index.d.ts | 14 --
locales/ja-JP.yml | 12 --
.../frontend/src/components/MkPostForm.vue | 75 ++-------
.../frontend/src/pages/settings/post-form.vue | 154 ------------------
packages/frontend/src/scripts/note-drafts.ts | 2 -
packages/frontend/src/scripts/post-form.ts | 48 ------
packages/frontend/src/store.ts | 4 -
7 files changed, 11 insertions(+), 298 deletions(-)
delete mode 100644 packages/frontend/src/pages/settings/post-form.vue
delete mode 100644 packages/frontend/src/scripts/post-form.ts
diff --git a/locales/index.d.ts b/locales/index.d.ts
index a52f1c81a59c..1ff65b6b4513 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -4960,10 +4960,6 @@ export interface Locale extends ILocale {
* 下書き
*/
"drafts": string;
- /**
- * 下書きの保存に関する動作
- */
- "draftSavingBehavior": string;
/**
* 下書きとして保存
*/
@@ -9920,16 +9916,6 @@ export interface Locale extends ILocale {
*/
"loop": string;
};
- "_draftSavingBehavior": {
- /**
- * 自動的に保存する
- */
- "auto": string;
- /**
- * 都度確認する
- */
- "manual": string;
- };
}
declare const locales: {
[lang: string]: Locale;
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index c44e3938b13e..795d801e4b32 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1236,7 +1236,6 @@ noDescription: "説明文はありません"
alwaysConfirmFollow: "フォローの際常に確認する"
inquiry: "お問い合わせ"
drafts: "下書き"
-draftSavingBehavior: "下書きの保存に関する動作"
saveAsDraft: "下書きとして保存"
draftOverwriteConfirm: "下書きを適用すると現在入力されている内容はリセットされます。よろしいですか?"
@@ -2623,7 +2622,6 @@ _offlineScreen:
title: "オフライン - サーバーに接続できません"
header: "サーバーに接続できません"
-<<<<<<< HEAD
_urlPreviewSetting:
title: "URLプレビューの設定"
enable: "URLプレビューを有効にする"
@@ -2643,14 +2641,4 @@ _mediaControls:
pip: "ピクチャインピクチャ"
playbackRate: "再生速度"
loop: "ループ再生"
-=======
-_hideReactionCount:
- none: "非表示にしない"
- self: "自分のノートのみ"
- others: "自分以外のノートのみ"
- all: "全てのノート"
-_draftSavingBehavior:
- auto: "自動的に保存する"
- manual: "都度確認する"
->>>>>>> 03d1c493a2 (feat: 下書き機能 (#144))
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index ba282184d16a..5f3fc32cfbe5 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -87,6 +87,7 @@ SPDX-License-Identifier: AGPL-3.0-only
+
@@ -260,7 +261,6 @@ const canPost = computed((): boolean => {
props.renote != null ||
(props.reply != null && quoteId.value != null)
) &&
- (scheduledNoteDelete.value ? scheduledNoteDelete.value.isValid : true) &&
(1 <= textLength.value || 1 <= files.value.length || !!poll.value || !!renote.value) &&
(textLength.value <= maxTextLength.value) &&
(!poll.value || poll.value.choices.length >= 2);
@@ -269,53 +269,6 @@ const canPost = computed((): boolean => {
const withHashtags = computed(defaultStore.makeGetterSetter('postFormWithHashtags'));
const hashtags = computed(defaultStore.makeGetterSetter('postFormHashtags'));
-const bottomItemActionDef: Record
= reactive({
- attachFile: {
- action: chooseFileFrom,
- },
- poll: {
- active: poll,
- action: togglePoll,
- },
- scheduledNoteDelete: {
- active: scheduledNoteDelete,
- action: toggleScheduledNoteDelete,
- },
- useCw: {
- active: useCw,
- action: () => useCw.value = !useCw.value,
- },
- mention: {
- action: insertMention,
- },
- hashtags: {
- active: withHashtags,
- action: () => withHashtags.value = !withHashtags.value,
- },
- plugins: {
- hide: postFormActions.length === 0,
- action: showActions,
- },
- emoji: {
- action: insertEmoji,
- },
- addMfmFunction: {
- hide: computed(() => !showAddMfmFunction.value),
- action: insertMfmFunction,
- },
- clearPost: {
- action: clear,
- },
- saveAsDraft: {
- action: () => saveDraft(false),
- },
-});
-
->>>>>>> 03d1c493a2 (feat: 下書き機能 (#144))
watch(text, () => {
checkMissingMention();
}, { immediate: true });
@@ -723,8 +676,6 @@ function onDrop(ev: DragEvent): void {
async function saveDraft(auto = true) {
if (props.instant || props.mock) return;
- if (auto && defaultStore.state.draftSavingBehavior !== 'auto') return;
-
if (!auto) {
// 手動での保存の場合は自動保存したものを削除した上で保存
await noteDrafts.remove(draftType.value, $i.id, 'default', draftAuxId.value as string);
@@ -738,7 +689,6 @@ async function saveDraft(auto = true) {
localOnly: localOnly.value,
files: files.value,
poll: poll.value,
- scheduledNoteDelete: scheduledNoteDelete.value,
}, draftAuxId.value as string);
if (!auto) {
@@ -801,9 +751,6 @@ async function applyDraft(draft: noteDrafts.NoteDraft, native = false) {
if (draft.data.poll) {
poll.value = draft.data.poll;
}
- if (draft.data.scheduledNoteDelete) {
- scheduledNoteDelete.value = draft.data.scheduledNoteDelete;
- }
}
async function post(ev?: MouseEvent) {
@@ -980,15 +927,15 @@ function cancel() {
}
async function closed() {
- if (defaultStore.state.draftSavingBehavior === 'manual' && (text.value !== '' || files.value.length > 0)) {
- os.confirm({
- type: 'question',
- text: i18n.ts.saveConfirm,
- }).then(({ canceled }) => {
- if (canceled) return;
- saveDraft(false);
- });
- }
+// if (text.value !== '' || files.value.length > 0) {
+// os.confirm({
+// type: 'question',
+// text: i18n.ts.saveConfirm,
+// }).then(({ canceled }) => {
+// if (canceled) return;
+// saveDraft(false);
+// });
+ // }
}
function insertMention() {
@@ -1075,7 +1022,7 @@ onMounted(() => {
await noteDrafts.migrate($i.id);
// 書きかけの投稿を復元
- if (!props.instant && !props.mention && !props.specified && !props.mock && !defaultStore.state.disableNoteDrafting) {
+ if (!props.instant && !props.mention && !props.specified && !props.mock) {
const draft = await noteDrafts.get(draftType.value, $i.id, 'default', draftAuxId.value as string);
if (draft) applyDraft(draft, true);
}
diff --git a/packages/frontend/src/pages/settings/post-form.vue b/packages/frontend/src/pages/settings/post-form.vue
deleted file mode 100644
index 4a04583b626b..000000000000
--- a/packages/frontend/src/pages/settings/post-form.vue
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
- {{ i18n.ts.postForm }}{{ i18n.ts.originalFeature }}
-
-
-
-
-
-
-
-
-
- {{ i18n.ts.addItem }}
- {{ i18n.ts.default }}
- {{ i18n.ts.save }}
-
-
{{ i18n.ts.postFormBottomSettingsDescription }}
-
- {{ i18n.ts.draftSavingBehavior }}{{ i18n.ts.originalFeature }}
-
-
-
-
- {{ i18n.ts.disableNoteDraftingDescription }}
- {{ i18n.ts.disableNoteDrafting }}
- {{ i18n.ts.originalFeature }}
-
-
-
-
-
-
-
diff --git a/packages/frontend/src/scripts/note-drafts.ts b/packages/frontend/src/scripts/note-drafts.ts
index 67abc004a3ca..b8e15c7a4db8 100644
--- a/packages/frontend/src/scripts/note-drafts.ts
+++ b/packages/frontend/src/scripts/note-drafts.ts
@@ -1,6 +1,5 @@
import * as Misskey from 'misskey-js';
import type { PollEditorModelValue } from '@/components/MkPollEditor.vue';
-import type { DeleteScheduleEditorModelValue } from '@/components/MkDeleteScheduleEditor.vue';
import { miLocalStorage } from '@/local-storage.js';
import { get as idbGet, set as idbSet } from '@/scripts/idb-proxy.js';
@@ -17,7 +16,6 @@ export type NoteDraft = {
localOnly: boolean;
files: Misskey.entities.DriveFile[];
poll: PollEditorModelValue | null;
- scheduledNoteDelete: DeleteScheduleEditorModelValue | null;
};
};
diff --git a/packages/frontend/src/scripts/post-form.ts b/packages/frontend/src/scripts/post-form.ts
deleted file mode 100644
index 40c63acb393d..000000000000
--- a/packages/frontend/src/scripts/post-form.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { i18n } from '@/i18n.js';
-
-export const bottomItemDef = {
- attachFile: {
- title: i18n.ts.attachFile,
- icon: 'ti-photo-plus',
- },
- poll: {
- title: i18n.ts.poll,
- icon: 'ti-chart-arrows',
- },
- scheduledNoteDelete: {
- title: i18n.ts.scheduledNoteDelete,
- icon: 'ti-bomb',
- },
- useCw: {
- title: i18n.ts.useCw,
- icon: 'ti-eye-off',
- },
- mention: {
- title: i18n.ts.mention,
- icon: 'ti-at',
- },
- hashtags: {
- title: i18n.ts.hashtags,
- icon: 'ti-hash',
- },
- plugins: {
- title: i18n.ts.plugins,
- icon: 'ti-plug',
- },
- emoji: {
- title: i18n.ts.emoji,
- icon: 'ti-mood-happy',
- },
- addMfmFunction: {
- title: i18n.ts.addMfmFunction,
- icon: 'ti-palette',
- },
- clearPost: {
- title: i18n.ts.clearPost,
- icon: 'ti-trash',
- },
- saveAsDraft: {
- title: i18n.ts.saveAsDraft,
- icon: 'ti-note',
- },
-};
diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts
index 440110f928a0..e8eb5a1ed7db 100644
--- a/packages/frontend/src/store.ts
+++ b/packages/frontend/src/store.ts
@@ -88,10 +88,6 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: true,
},
- draftSavingBehavior: {
- where: 'account',
- default: 'auto' as 'auto' | 'manual',
- },
rememberNoteVisibility: {
where: 'account',
default: false,