From 43c0ffe7f855c5544b6bc9d1b23888e2d0f9f991 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 7 Jun 2024 11:01:49 +0100 Subject: [PATCH 01/19] better block display for `` elements We use MfM in all sorts of places, and only some of them are actual blocks. We can now tell the `Mfm` component to make the top-level `` a block when we need to (mostly note bodies, user descriptions, announcements) and leave it inline in all other places. This should still rendener inline rtl content embedded in ltr text in a sensible way, while providing right-alignment for fully rtl blocks. --- .../frontend/src/components/MkAbuseReport.vue | 2 +- .../src/components/MkAnnouncementDialog.vue | 2 +- packages/frontend/src/components/MkDialog.vue | 2 +- packages/frontend/src/components/MkNote.vue | 9 +++-- .../src/components/MkNoteDetailed.vue | 5 ++- .../frontend/src/components/MkNotePreview.vue | 4 +- .../frontend/src/components/MkNoteSimple.vue | 2 +- .../frontend/src/components/MkNoteSub.vue | 2 +- .../src/components/MkNotification.vue | 16 ++++---- .../src/components/MkSubNoteContent.vue | 4 +- .../frontend/src/components/MkTextarea.vue | 2 +- .../frontend/src/components/MkUserInfo.vue | 2 +- .../frontend/src/components/MkUserPopup.vue | 2 +- .../src/components/MkUserSetupDialog.User.vue | 2 +- packages/frontend/src/components/SkNote.vue | 7 ++-- .../src/components/SkNoteDetailed.vue | 5 ++- .../frontend/src/components/SkNoteSimple.vue | 2 +- .../frontend/src/components/SkNoteSub.vue | 2 +- .../src/components/SkOldNoteWindow.vue | 6 +-- .../global/MkMisskeyFlavoredMarkdown.ts | 37 ++++++++++--------- .../src/components/page/page.text.vue | 2 +- packages/frontend/src/pages/announcements.vue | 2 +- packages/frontend/src/pages/channel.vue | 2 +- packages/frontend/src/pages/clip.vue | 2 +- packages/frontend/src/pages/flash/flash.vue | 2 +- packages/frontend/src/pages/gallery/post.vue | 2 +- packages/frontend/src/pages/user/home.vue | 2 +- .../frontend/src/pages/welcome.timeline.vue | 2 +- packages/frontend/src/style.scss | 4 +- 29 files changed, 72 insertions(+), 63 deletions(-) diff --git a/packages/frontend/src/components/MkAbuseReport.vue b/packages/frontend/src/components/MkAbuseReport.vue index 0493e885b9..7174affabe 100644 --- a/packages/frontend/src/components/MkAbuseReport.vue +++ b/packages/frontend/src/components/MkAbuseReport.vue @@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- +

{{ i18n.ts.reporter }}: @{{ report.reporter.username }}
diff --git a/packages/frontend/src/components/MkAnnouncementDialog.vue b/packages/frontend/src/components/MkAnnouncementDialog.vue index 74d0e7214f..032a815ee6 100644 --- a/packages/frontend/src/components/MkAnnouncementDialog.vue +++ b/packages/frontend/src/components/MkAnnouncementDialog.vue @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ announcement.title }}
-
+
{{ i18n.ts.ok }} diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue index b81ebbbb11..f51758ada7 100644 --- a/packages/frontend/src/components/MkDialog.vue +++ b/packages/frontend/src/components/MkDialog.vue @@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
diff --git a/packages/frontend/src/scripts/search-engine-map.ts b/packages/frontend/src/scripts/search-engine-map.ts index 925d16aafe..3e0594f0c5 100644 --- a/packages/frontend/src/scripts/search-engine-map.ts +++ b/packages/frontend/src/scripts/search-engine-map.ts @@ -1,12 +1,12 @@ //store the URL and if its none of these its a custom one export const searchEngineMap = { //The first one is the default search engine - 'https://www.google.com/search?q={query}': 'Google', - 'https://duckduckgo.com?q={query}': 'Duckduckgo', - 'https://www.bing.com/search?q={query}': 'Bing', - 'https://search.yahoo.com/search?p={query}': 'Yahoo', - 'https://www.ecosia.org/search?q={query}': 'Ecosia', - 'https://www.qwant.com?q={query}': 'Qwant', - 'https://search.aol.com/aol/search?q={query}': 'AOL', + 'https://www.google.com/search/?q={query}': 'Google', + 'https://duckduckgo.com/?q={query}': 'Duckduckgo', + 'https://www.bing.com/search/?q={query}': 'Bing', + 'https://search.yahoo.com/search/?p={query}': 'Yahoo', + 'https://www.ecosia.org/search/?q={query}': 'Ecosia', + 'https://www.qwant.com/?q={query}': 'Qwant', + 'https://search.aol.com/aol/search/?q={query}': 'AOL', 'https://yandex.com/search/?text={query}': 'Yandex', }; diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index ffd63f71fc..f753b2c3e8 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -306,7 +306,7 @@ export const defaultStore = markRaw(new Storage('base', { default: false, }, searchEngine: { - where: 'device', + where: 'account', default: Object.keys(searchEngineMap)[0], }, noteDesign: { From d53df1c5d292f44cfe4d90830f12998ab726a582 Mon Sep 17 00:00:00 2001 From: KevinWh0 <45321184+ChaoticLeah@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:00:12 +0200 Subject: [PATCH 13/19] undid weird / in search engine map --- packages/frontend/src/scripts/search-engine-map.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/scripts/search-engine-map.ts b/packages/frontend/src/scripts/search-engine-map.ts index 3e0594f0c5..3fb06d135d 100644 --- a/packages/frontend/src/scripts/search-engine-map.ts +++ b/packages/frontend/src/scripts/search-engine-map.ts @@ -1,12 +1,12 @@ //store the URL and if its none of these its a custom one export const searchEngineMap = { //The first one is the default search engine - 'https://www.google.com/search/?q={query}': 'Google', + 'https://www.google.com/search?q={query}': 'Google', 'https://duckduckgo.com/?q={query}': 'Duckduckgo', - 'https://www.bing.com/search/?q={query}': 'Bing', - 'https://search.yahoo.com/search/?p={query}': 'Yahoo', - 'https://www.ecosia.org/search/?q={query}': 'Ecosia', + 'https://www.bing.com/search?q={query}': 'Bing', + 'https://search.yahoo.com/search?p={query}': 'Yahoo', + 'https://www.ecosia.org/search?q={query}': 'Ecosia', 'https://www.qwant.com/?q={query}': 'Qwant', - 'https://search.aol.com/aol/search/?q={query}': 'AOL', - 'https://yandex.com/search/?text={query}': 'Yandex', + 'https://search.aol.com/aol/search?q={query}': 'AOL', + 'https://yandex.com/search?text={query}': 'Yandex', }; From f7898fa89daa0eed601dd1acac7569ca5ba93fb1 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 12 Jun 2024 15:06:01 +0100 Subject: [PATCH 14/19] teach the locale system that sometimes braces are just braces --- locales/en-US.yml | 2 +- locales/generateDTS.js | 5 ++++- locales/index.d.ts | 4 ++-- locales/index.js | 6 +++++- locales/ja-JP.yml | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 23884aa043..b469b312a5 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -754,7 +754,7 @@ alwaysMarkSensitive: "Mark as sensitive by default" loadRawImages: "Load original images instead of showing thumbnails" searchEngine: "Search Engine For Search MFM" searchEngineOther: "Other" -searchEngineCustomURIDescription: "The custom URI must be input in the format like \"https://www.google.com/search?q={query}\" or \"https://www.google.com/search?q=%s\"." +searchEngineCustomURIDescription: "The custom URI must be input in the format like \"https://www.google.com/search?q=\\{query}\" or \"https://www.google.com/search?q=%s\"." searchEngineCusomURI: "Custom URI" disableShowingAnimatedImages: "Don't play animated images" highlightSensitiveMedia: "Highlight sensitive media" diff --git a/locales/generateDTS.js b/locales/generateDTS.js index 49807144ec..a175247445 100644 --- a/locales/generateDTS.js +++ b/locales/generateDTS.js @@ -6,7 +6,10 @@ import ts from 'typescript'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -const parameterRegExp = /\{(\w+)\}/g; +// braces preceded by backslashes are literal, they don't represent +// parameters; they get cleaned up by `locales/index.js` before +// getting shipped to the browser +const parameterRegExp = /(?; + "searchEngineCustomURIDescription": string; /** * カスタム URI */ diff --git a/locales/index.js b/locales/index.js index 650e552337..c7a693fb77 100644 --- a/locales/index.js +++ b/locales/index.js @@ -49,7 +49,11 @@ const primaries = { }; // 何故か文字列にバックスペース文字が混入することがあり、YAMLが壊れるので取り除く -const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), ''); +// +// also, we remove the backslashes in front of open braces (the +// backslashes are only needed to tell `generateDTS.js` that the +// braces do not represent parameters) +const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), '').replaceAll(new RegExp(/\\+\{/,'g'), '{'); export function build() { const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(new URL(`${c}.yml`, import.meta.url), 'utf-8'))) || {}, a), {}); diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 293f8ec380..8c0ef3d55f 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -753,7 +753,7 @@ alwaysMarkSensitive: "デフォルトでメディアをセンシティブ設定 loadRawImages: "添付画像のサムネイルをオリジナル画質にする" searchEngine: "検索MFMの検索エンジン" searchEngineOther: "他" -searchEngineCustomURIDescription: "カスタム URI は、\"https://www.google.com/search?q={query}\" や \"https://www.google.com/search?q=%s\" のような形式で入力する必要があります。" +searchEngineCustomURIDescription: "カスタム URI は、\"https://www.google.com/search?q=\\{query}\" や \"https://www.google.com/search?q=%s\" のような形式で入力する必要があります。" searchEngineCusomURI: "カスタム URI" disableShowingAnimatedImages: "アニメーション画像を再生しない" highlightSensitiveMedia: "メディアがセンシティブであることを分かりやすく表示" From 5c311e8a287a10da8cfa94ee74647fdfe07b1fa1 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 12 Jun 2024 17:06:33 +0100 Subject: [PATCH 15/19] tweak the rate limit for `notes/create` while fixing #467 #468, we changed the rate limit from 300/hour to 5/minute some people felt it was too low: they often boost notes in quick succession so here's a different approach: back to 300/hour, but not more than 1/second; this is the same settings that `notes/delete` has, BTW --- packages/backend/src/server/api/endpoints/notes/create.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index cc44721133..fe2dafa98e 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -30,8 +30,9 @@ export const meta = { prohibitMoved: true, limit: { - duration: ms('1minute'), - max: 5, + duration: ms('1hour'), + max: 300, + minInterval: ms('1sec'), }, kind: 'write:notes', From 58c77c4d5cc33d9909087ff3cead1e86e59e438f Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 8 Jun 2024 17:30:56 +0100 Subject: [PATCH 16/19] fix accesses to `canRenote` --- packages/frontend/src/components/MkNote.vue | 2 +- packages/frontend/src/components/MkNoteDetailed.vue | 2 +- packages/frontend/src/components/SkNote.vue | 2 +- packages/frontend/src/components/SkNoteDetailed.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index a14854fba6..4c18428a76 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -336,7 +336,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 55a3ff8a16..683f8f9927 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -342,7 +342,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue index 3c5a1baffc..867e9106de 100644 --- a/packages/frontend/src/components/SkNote.vue +++ b/packages/frontend/src/components/SkNote.vue @@ -335,7 +335,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue index c1ecc7eb1e..b5b8782d0e 100644 --- a/packages/frontend/src/components/SkNoteDetailed.vue +++ b/packages/frontend/src/components/SkNoteDetailed.vue @@ -351,7 +351,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, From f98229d3e042a3d894462bd03d33dfb97c2adccf Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 8 Jun 2024 17:31:56 +0100 Subject: [PATCH 17/19] semicolons --- packages/frontend/src/components/MkNote.vue | 6 +++--- packages/frontend/src/components/MkNoteDetailed.vue | 6 +++--- packages/frontend/src/components/SkNote.vue | 6 +++--- packages/frontend/src/components/SkNoteDetailed.vue | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 4c18428a76..ddd693dc79 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -336,7 +336,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, @@ -441,7 +441,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } } else if (!appearNote.value.channel || appearNote.value.channel.allowRenoteToExternal) { const el = renoteButton.value as HTMLElement | null | undefined; @@ -460,7 +460,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => renoting = false); + }).finally(() => { renoting = false; }); } } } diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 683f8f9927..788d036678 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -342,7 +342,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, @@ -460,7 +460,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } else if (!appearNote.value.channel || appearNote.value.channel.allowRenoteToExternal) { const el = renoteButton.value as HTMLElement | null | undefined; if (el) { @@ -477,7 +477,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } } diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue index 867e9106de..f8d41df081 100644 --- a/packages/frontend/src/components/SkNote.vue +++ b/packages/frontend/src/components/SkNote.vue @@ -335,7 +335,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, @@ -440,7 +440,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } } else if (!appearNote.value.channel || appearNote.value.channel.allowRenoteToExternal) { const el = renoteButton.value as HTMLElement | null | undefined; @@ -459,7 +459,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } } } diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue index b5b8782d0e..8749967bdc 100644 --- a/packages/frontend/src/components/SkNoteDetailed.vue +++ b/packages/frontend/src/components/SkNoteDetailed.vue @@ -351,7 +351,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility) } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, @@ -469,7 +469,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } else if (!appearNote.value.channel || appearNote.value.channel.allowRenoteToExternal) { const el = renoteButton.value as HTMLElement | null | undefined; if (el) { @@ -486,7 +486,7 @@ function renote(visibility: Visibility, localOnly: boolean = false) { }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; - }).finally(() => { renoting = false }); + }).finally(() => { renoting = false; }); } } From 935cb73c0b3df02a75cf65359c169ce7e05722e4 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 12 Jun 2024 17:28:14 +0100 Subject: [PATCH 18/19] more robust "only one renote at a time" logic this blocks the button as well, not just the hotkey --- packages/frontend/src/components/MkNote.vue | 6 +++++- packages/frontend/src/components/MkNoteDetailed.vue | 6 +++++- packages/frontend/src/components/SkNote.vue | 6 +++++- packages/frontend/src/components/SkNoteDetailed.vue | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index ddd693dc79..60e6100a8f 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -336,7 +336,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, @@ -414,6 +414,8 @@ if (!props.mock) { } function boostVisibility() { + if (renoting) return; + if (!defaultStore.state.showVisibilitySelectorOnBoost) { renote(defaultStore.state.visibilityOnBoost); } else { @@ -425,6 +427,8 @@ function renote(visibility: Visibility, localOnly: boolean = false) { pleaseLogin(); showMovedDialog(); + renoting = true; + if (appearNote.value.channel) { const el = renoteButton.value as HTMLElement | null | undefined; if (el) { diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 788d036678..ac48b7e6c3 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -342,7 +342,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, @@ -434,6 +434,8 @@ useTooltip(quoteButton, async (showing) => { }); function boostVisibility() { + if (renoting) return; + if (!defaultStore.state.showVisibilitySelectorOnBoost) { renote(defaultStore.state.visibilityOnBoost); } else { @@ -445,6 +447,8 @@ function renote(visibility: Visibility, localOnly: boolean = false) { pleaseLogin(); showMovedDialog(); + renoting = true; + if (appearNote.value.channel) { const el = renoteButton.value as HTMLElement | null | undefined; if (el) { diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue index f8d41df081..638a38cd1f 100644 --- a/packages/frontend/src/components/SkNote.vue +++ b/packages/frontend/src/components/SkNote.vue @@ -335,7 +335,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, @@ -413,6 +413,8 @@ if (!props.mock) { } function boostVisibility() { + if (renoting) return; + if (!defaultStore.state.showVisibilitySelectorOnBoost) { renote(defaultStore.state.visibilityOnBoost); } else { @@ -424,6 +426,8 @@ function renote(visibility: Visibility, localOnly: boolean = false) { pleaseLogin(); showMovedDialog(); + renoting = true; + if (appearNote.value.channel) { const el = renoteButton.value as HTMLElement | null | undefined; if (el) { diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue index 8749967bdc..abd1650fd5 100644 --- a/packages/frontend/src/components/SkNoteDetailed.vue +++ b/packages/frontend/src/components/SkNoteDetailed.vue @@ -351,7 +351,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) { renoting = true; renote(appearNote.value.visibility); } }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, @@ -443,6 +443,8 @@ useTooltip(quoteButton, async (showing) => { }); function boostVisibility() { + if (renoting) return; + if (!defaultStore.state.showVisibilitySelectorOnBoost) { renote(defaultStore.state.visibilityOnBoost); } else { @@ -454,6 +456,8 @@ function renote(visibility: Visibility, localOnly: boolean = false) { pleaseLogin(); showMovedDialog(); + renoting = true; + if (appearNote.value.channel) { const el = renoteButton.value as HTMLElement | null | undefined; if (el) { From 73323a70a331980489b866e9ac88e2070fe6d92e Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 12 Jun 2024 17:30:20 +0100 Subject: [PATCH 19/19] use configured boost visibility, instead of note's --- packages/frontend/src/components/MkNote.vue | 2 +- packages/frontend/src/components/MkNoteDetailed.vue | 2 +- packages/frontend/src/components/SkNote.vue | 2 +- packages/frontend/src/components/SkNoteDetailed.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 60e6100a8f..4d27770138 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -336,7 +336,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(defaultStore.state.visibilityOnBoost); }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index ac48b7e6c3..f9fb6066c8 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -342,7 +342,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(defaultStore.state.visibilityOnBoost); }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value, diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue index 638a38cd1f..cbdaa757e2 100644 --- a/packages/frontend/src/components/SkNote.vue +++ b/packages/frontend/src/components/SkNote.vue @@ -335,7 +335,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(defaultStore.state.visibilityOnBoost); }, 'up|k|shift+tab': focusBefore, 'down|j|tab': focusAfter, 'esc': blur, diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue index abd1650fd5..2274793666 100644 --- a/packages/frontend/src/components/SkNoteDetailed.vue +++ b/packages/frontend/src/components/SkNoteDetailed.vue @@ -351,7 +351,7 @@ let renoting = false; const keymap = { 'r': () => reply(true), 'e|a|plus': () => react(true), - '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(appearNote.value.visibility); }, + '(q)': () => { if (canRenote.value && !renoted.value && !renoting) renote(defaultStore.state.visibilityOnBoost); }, 'esc': blur, 'm|o': () => showMenu(true), 's': () => showContent.value !== showContent.value,