From b97c1f0b4d02eb7ad1929265518053c5c9a74eab Mon Sep 17 00:00:00 2001 From: Kayden Tebau Date: Wed, 28 Sep 2022 09:22:03 -0700 Subject: [PATCH 1/4] Seperate renote quote option --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + packages/client/src/components/MkNote.vue | 2 + .../client/src/components/MkNoteDetailed.vue | 2 + .../client/src/components/MkRenoteButton.vue | 47 ++++++++++------- .../client/src/components/quote-button.vue | 50 +++++++++++++++++++ .../client/src/pages/settings/general.vue | 3 ++ packages/client/src/store.ts | 4 ++ 8 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 packages/client/src/components/quote-button.vue diff --git a/locales/en-US.yml b/locales/en-US.yml index cb2bf987eb..e9ab2a7dcc 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -794,6 +794,7 @@ customCssWarn: "This setting should only be used if you know what it does. Enter global: "Global" recommended: "Recommended" squareAvatars: "Display squared avatars" +seperateRenoteQuote: "Seperate renote and quote buttons" sent: "Sent" received: "Received" searchResult: "Search results" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 593b1d9358..609019e7db 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -793,6 +793,7 @@ customCss: "カスタムCSS" customCssWarn: "この設定は必ず知識のある方が行ってください。不適切な設定を行うとクライアントが正常に使用できなくなる恐れがあります。" global: "グローバル" squareAvatars: "アイコンを四角形で表示" +seperateRenoteQuote: "リノートと引用ボタンを分ける" sent: "送信" received: "受信" searchResult: "検索結果" diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 5445085c96..f5315a82ec 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -77,6 +77,7 @@

{{ appearNote.repliesCount }}

+ @@ -113,6 +114,7 @@ import XMediaList from '@/components/MkMediaList.vue'; import XCwButton from '@/components/MkCwButton.vue'; import XPoll from '@/components/MkPoll.vue'; import XRenoteButton from '@/components/MkRenoteButton.vue'; +import XQuoteButton from './quote-button.vue'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; import MkInstanceTicker from '@/components/MkInstanceTicker.vue'; import MkVisibility from '@/components/MkVisibility.vue'; diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index 173ae44445..35d92b379b 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -87,6 +87,7 @@

{{ appearNote.repliesCount }}

+ @@ -123,6 +124,7 @@ import XMediaList from '@/components/MkMediaList.vue'; import XCwButton from '@/components/MkCwButton.vue'; import XPoll from '@/components/MkPoll.vue'; import XRenoteButton from '@/components/MkRenoteButton.vue'; +import XQuoteButton from './quote-button.vue'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; import MkInstanceTicker from '@/components/MkInstanceTicker.vue'; import MkVisibility from '@/components/MkVisibility.vue'; diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 068a9fba6f..9eaada8636 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -22,6 +22,7 @@ import * as os from '@/os'; import { $i } from '@/account'; import { useTooltip } from '@/scripts/use-tooltip'; import { i18n } from '@/i18n'; +import { defaultStore } from "@/store"; const props = defineProps<{ note: misskey.entities.Note; @@ -52,25 +53,33 @@ useTooltip(buttonRef, async (showing) => { const renote = (viaKeyboard = false) => { pleaseLogin(); - os.popupMenu([{ - text: i18n.ts.renote, - icon: 'fas fa-retweet', - action: () => { - os.api('notes/create', { - renoteId: props.note.id, - }); - }, - }, { - text: i18n.ts.quote, - icon: 'fas fa-quote-right', - action: () => { - os.post({ - renote: props.note, - }); - }, - }], buttonRef.value, { - viaKeyboard, - }); + if (defaultStore.state.seperateRenoteQuote) { + os.api('notes/create', { + renoteId: props.note.id, + visibility: props.note.visibility, + }); + } else { + os.popupMenu([{ + text: i18n.ts.renote, + icon: 'fas fa-retweet', + action: () => { + os.api('notes/create', { + renoteId: props.note.id, + visibility: props.note.visibility, + }); + }, + }, { + text: i18n.ts.quote, + icon: 'fas fa-quote-right', + action: () => { + os.post({ + renote: props.note, + }); + }, + }], buttonRef.value, { + viaKeyboard, + }); + } }; diff --git a/packages/client/src/components/quote-button.vue b/packages/client/src/components/quote-button.vue new file mode 100644 index 0000000000..8af3fb322f --- /dev/null +++ b/packages/client/src/components/quote-button.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index ace0f9aa76..9f96d63b2c 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -51,6 +51,7 @@ {{ i18n.ts.loadRawImages }} {{ i18n.ts.disableShowingAnimatedImages }} {{ i18n.ts.squareAvatars }} + {{ i18n.ts.seperateRenoteQuote }} {{ i18n.ts.useSystemFont }} {{ i18n.ts.useOsNativeEmojis }} @@ -144,6 +145,7 @@ const instanceTicker = computed(defaultStore.makeGetterSetter('instanceTicker')) const enableInfiniteScroll = computed(defaultStore.makeGetterSetter('enableInfiniteScroll')); const enterSendsMessage = computed(defaultStore.makeGetterSetter('enterSendsMessage')); const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu')); +const seperateRenoteQuote = computed(defaultStore.makeGetterSetter('seperateRenoteQuote')); const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars')); const showUpdates = computed(defaultStore.makeGetterSetter('showUpdates')); const swipeOnDesktop = computed(defaultStore.makeGetterSetter('swipeOnDesktop')); @@ -181,6 +183,7 @@ watch([ showAds, showUpdates, swipeOnDesktop, + seperateRenoteQuote, ], async () => { await reloadAsk(); }); diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index d66970e4c0..6e044b465f 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -123,6 +123,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: 'quiet' as 'nothing' | 'quiet' | 'reload' | 'dialog', }, + seperateRenoteQuote: { + where: 'device', + default: true, + }, nsfw: { where: 'device', default: 'respect' as 'respect' | 'force' | 'ignore', From 484d78d4b3823cc9817dc1da4c1d4b9f17581471 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 29 Sep 2022 19:00:14 -0700 Subject: [PATCH 2/4] chore: quote-button --> MkQuoteButton --- packages/client/src/components/MkNote.vue | 2 +- packages/client/src/components/MkNoteDetailed.vue | 2 +- .../src/components/{quote-button.vue => MkQuoteButton.vue} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename packages/client/src/components/{quote-button.vue => MkQuoteButton.vue} (100%) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index f5315a82ec..ce00b50e69 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -114,7 +114,7 @@ import XMediaList from '@/components/MkMediaList.vue'; import XCwButton from '@/components/MkCwButton.vue'; import XPoll from '@/components/MkPoll.vue'; import XRenoteButton from '@/components/MkRenoteButton.vue'; -import XQuoteButton from './quote-button.vue'; +import XQuoteButton from '@/components/MkQuoteButton.vue'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; import MkInstanceTicker from '@/components/MkInstanceTicker.vue'; import MkVisibility from '@/components/MkVisibility.vue'; diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index 35d92b379b..0a4c8440dc 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -124,7 +124,7 @@ import XMediaList from '@/components/MkMediaList.vue'; import XCwButton from '@/components/MkCwButton.vue'; import XPoll from '@/components/MkPoll.vue'; import XRenoteButton from '@/components/MkRenoteButton.vue'; -import XQuoteButton from './quote-button.vue'; +import XQuoteButton from '@/components/MkQuoteButton.vue'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; import MkInstanceTicker from '@/components/MkInstanceTicker.vue'; import MkVisibility from '@/components/MkVisibility.vue'; diff --git a/packages/client/src/components/quote-button.vue b/packages/client/src/components/MkQuoteButton.vue similarity index 100% rename from packages/client/src/components/quote-button.vue rename to packages/client/src/components/MkQuoteButton.vue From 0d667a60089c3d9851130b7924c809b610373c97 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 29 Sep 2022 19:00:43 -0700 Subject: [PATCH 3/4] fix --- packages/client/src/components/MkQuoteButton.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/MkQuoteButton.vue b/packages/client/src/components/MkQuoteButton.vue index 8af3fb322f..21657c8c73 100644 --- a/packages/client/src/components/MkQuoteButton.vue +++ b/packages/client/src/components/MkQuoteButton.vue @@ -10,7 +10,7 @@