From 48cc1c41d01912796f162ec62be35e36c466cb79 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 20 Jul 2023 05:54:37 +0000 Subject: [PATCH] feat: ability to show preview in posting form by default (close #5) --- locales/en-US.yml | 2 ++ locales/ja-JP.yml | 2 ++ packages/client/src/components/MkPostForm.vue | 2 +- packages/client/src/pages/settings/general.vue | 12 +++++++++++- packages/client/src/store.ts | 4 ++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 23ef6d5a..1f0db942 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1125,6 +1125,8 @@ removeQuote: "Remove quote" removeRecipient: "Remove recipient" removeMember: "Remove member" verifiedLink: "Verified link" +showPreviewByDefault: "Show preview in posting form by default" +originalFeature: "original" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 43d8575a..b6c7bbdc 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -985,6 +985,8 @@ showWithSparkles: "タイトルをキラキラさせる" youHaveUnreadAnnouncements: "未読のお知らせがあります" neverShow: "今後表示しない" remindMeLater: "また後で" +showPreviewByDefault: "投稿画面でプレビュー表示をデフォルトでオンにする" +originalFeature: "独自機能" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 059aac06..79c31bcc 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -316,7 +316,7 @@ let poll = $ref<{ expiredAfter: string | null; } | null>(null); let useCw = $ref(false); -let showPreview = $ref(false); +let showPreview = $ref(defaultStore.state.showPreviewByDefault); let cw = $ref(null); let localOnly = $ref( props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 7fefc6d7..fe32809a 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -8,7 +8,8 @@