From 33f566c94a956c623e58748308370f9485d0dcb6 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 23 Jun 2024 18:57:04 +0900 Subject: [PATCH 1/8] =?UTF-8?q?enhance(frontend):=20=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=82=A6=E3=82=B6=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86=E3=82=AD?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E3=81=A7=E3=81=8D=E3=82=8B=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 | 26 ++++++++++++++++--- locales/ja-JP.yml | 6 +++++ packages/frontend/src/os.ts | 8 ++++++ .../frontend/src/pages/settings/general.vue | 8 ++++++ packages/frontend/src/store.ts | 4 +++ 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index acdc1fc421c3..d1d4ee1445e0 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -9761,7 +9761,7 @@ export interface Locale extends ILocale { "_dataSaver": { "_media": { /** - * メディアの読み込み + * メディアの読み込みを無効化 */ "title": string; /** @@ -9771,7 +9771,7 @@ export interface Locale extends ILocale { }; "_avatar": { /** - * アイコン画像 + * アイコン画像のアニメーションを無効化 */ "title": string; /** @@ -9781,7 +9781,7 @@ export interface Locale extends ILocale { }; "_urlPreview": { /** - * URLプレビューのサムネイル + * URLプレビューのサムネイルを非表示 */ "title": string; /** @@ -9791,7 +9791,7 @@ export interface Locale extends ILocale { }; "_code": { /** - * コードハイライト + * コードハイライトを非表示 */ "title": string; /** @@ -10066,6 +10066,24 @@ export interface Locale extends ILocale { */ "loop": string; }; + "_contextMenu": { + /** + * Misskey独自のコンテキストメニュー + */ + "title": string; + /** + * 常に表示する + */ + "always": string; + /** + * Altキー(Optionキー)を押しながらで表示 + */ + "withAlt": string; + /** + * 無効(常にブラウザのUIを使用) + */ + "never": string; + }; } declare const locales: { [lang: string]: Locale; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0d89d33abeec..fef4b6987d93 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2684,3 +2684,9 @@ _mediaControls: pip: "ピクチャインピクチャ" playbackRate: "再生速度" loop: "ループ再生" + +_contextMenu: + title: "Misskey独自のコンテキストメニュー" + always: "常に表示する" + withAlt: "Altキー(Optionキー)を押しながらで表示" + never: "無効(常にブラウザのUIを使用)" diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index f656a5237165..3201d3651fa4 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -11,6 +11,7 @@ import * as Misskey from 'misskey-js'; import type { ComponentProps as CP } from 'vue-component-type-helpers'; import type { Form, GetFormResultType } from '@/scripts/form.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; +import { defaultStore } from '@/store.js'; import { i18n } from '@/i18n.js'; import MkPostFormDialog from '@/components/MkPostFormDialog.vue'; import MkWaitingDialog from '@/components/MkWaitingDialog.vue'; @@ -630,6 +631,13 @@ export function popupMenu(items: MenuItem[], src?: HTMLElement | EventTarget | n } export function contextMenu(items: MenuItem[], ev: MouseEvent): Promise { + if ( + defaultStore.state.contextMenu === 'never' || + (defaultStore.state.contextMenu === 'withAlt' && !ev.altKey) + ) { + return Promise.resolve(); + } + ev.preventDefault(); return new Promise(resolve => { let dispose; diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index cfc63f2a08d9..fe072b3ee273 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -176,6 +176,12 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + @@ -315,6 +321,7 @@ const enableSeasonalScreenEffect = computed(defaultStore.makeGetterSetter('enabl const enableHorizontalSwipe = computed(defaultStore.makeGetterSetter('enableHorizontalSwipe')); const useNativeUIForVideoAudioPlayer = computed(defaultStore.makeGetterSetter('useNativeUIForVideoAudioPlayer')); const alwaysConfirmFollow = computed(defaultStore.makeGetterSetter('alwaysConfirmFollow')); +const contextMenu = computed(defaultStore.makeGetterSetter('contextMenu')); watch(lang, () => { miLocalStorage.setItem('lang', lang.value as string); @@ -357,6 +364,7 @@ watch([ disableStreamingTimeline, enableSeasonalScreenEffect, alwaysConfirmFollow, + contextMenu, ], async () => { await reloadAsk(); }); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index e8eb5a1ed7db..05a8ae955c03 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -454,6 +454,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, + contextMenu: { + where: 'device', + default: 'always' as 'always' | 'withAlt' | 'never', + }, sound_masterVolume: { where: 'device', From 28a5b07a653d3f5454ad94d9df2f9a0885ea1138 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 23 Jun 2024 18:58:44 +0900 Subject: [PATCH 2/8] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 354bbd20fd67..25cb2be761c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fix: Dockerコンテナの立ち上げ時に`pnpm`のインストールで固まることがある問題 ### Client +- Enhance: ブラウザのコンテキストメニューを使用できるように - Fix: `/about#federation` ページなどで各インスタンスのチャートが表示されなくなっていた問題を修正 - Fix: ユーザーページの追加情報のラベルを投稿者のサーバーの絵文字で表示する (#13968) - Fix: リバーシの対局を正しく共有できないことがある問題を修正 From 70a0418a0f4ceb44b049ce6d26ae7b04cc438eb9 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 23 Jun 2024 19:09:01 +0900 Subject: [PATCH 3/8] =?UTF-8?q?shift=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 ++-- locales/ja-JP.yml | 2 +- packages/frontend/src/os.ts | 2 +- packages/frontend/src/pages/settings/general.vue | 2 +- packages/frontend/src/store.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index d1d4ee1445e0..3770eaed9166 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10076,9 +10076,9 @@ export interface Locale extends ILocale { */ "always": string; /** - * Altキー(Optionキー)を押しながらで表示 + * Shiftキーを押しながらで表示 */ - "withAlt": string; + "withShift": string; /** * 無効(常にブラウザのUIを使用) */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index fef4b6987d93..f4d6ead46920 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2688,5 +2688,5 @@ _mediaControls: _contextMenu: title: "Misskey独自のコンテキストメニュー" always: "常に表示する" - withAlt: "Altキー(Optionキー)を押しながらで表示" + withShift: "Shiftキーを押しながらで表示" never: "無効(常にブラウザのUIを使用)" diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 3201d3651fa4..5ee1588935ea 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -633,7 +633,7 @@ export function popupMenu(items: MenuItem[], src?: HTMLElement | EventTarget | n export function contextMenu(items: MenuItem[], ev: MouseEvent): Promise { if ( defaultStore.state.contextMenu === 'never' || - (defaultStore.state.contextMenu === 'withAlt' && !ev.altKey) + (defaultStore.state.contextMenu === 'withShift' && !ev.shiftKey) ) { return Promise.resolve(); } diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index fe072b3ee273..b4e10298b266 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -179,7 +179,7 @@ SPDX-License-Identifier: AGPL-3.0-only - + diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 05a8ae955c03..bb95d81f4ada 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -456,7 +456,7 @@ export const defaultStore = markRaw(new Storage('base', { }, contextMenu: { where: 'device', - default: 'always' as 'always' | 'withAlt' | 'never', + default: 'always' as 'always' | 'withShift' | 'never', }, sound_masterVolume: { From 1fc124b939a44008bf5f07b04bca22f65a51b348 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:00:47 +0900 Subject: [PATCH 4/8] change keys --- locales/index.d.ts | 14 +++++++------- locales/ja-JP.yml | 8 ++++---- packages/frontend/src/os.ts | 4 ++-- packages/frontend/src/pages/settings/general.vue | 6 +++--- packages/frontend/src/store.ts | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 0d1d1c4457c1..384045c25d77 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10088,21 +10088,21 @@ export interface Locale extends ILocale { }; "_contextMenu": { /** - * Misskey独自のコンテキストメニュー + * コンテキストメニュー */ "title": string; /** - * 常に表示する + * Misskey */ - "always": string; + "app": string; /** - * Shiftキーを押しながらで表示 + * Shiftキーを押しながらでMisskey */ - "withShift": string; + "appWithShift": string; /** - * 無効(常にブラウザのUIを使用) + * ネイティブ */ - "never": string; + "native": string; }; } declare const locales: { diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 56236fca0260..c98eb6f65507 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2691,7 +2691,7 @@ _mediaControls: loop: "ループ再生" _contextMenu: - title: "Misskey独自のコンテキストメニュー" - always: "常に表示する" - withShift: "Shiftキーを押しながらで表示" - never: "無効(常にブラウザのUIを使用)" + title: "コンテキストメニュー" + app: "Misskey" + appWithShift: "Shiftキーを押しながらでMisskey" + native: "ネイティブ" diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 34e2e409a9d4..7821cf2d7920 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -651,8 +651,8 @@ export function popupMenu(items: MenuItem[], src?: HTMLElement | EventTarget | n export function contextMenu(items: MenuItem[], ev: MouseEvent): Promise { if ( - defaultStore.state.contextMenu === 'never' || - (defaultStore.state.contextMenu === 'withShift' && !ev.shiftKey) + defaultStore.state.contextMenu === 'native' || + (defaultStore.state.contextMenu === 'appWithShift' && !ev.shiftKey) ) { return Promise.resolve(); } diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index b4e10298b266..7217c03a8d9f 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -178,9 +178,9 @@ SPDX-License-Identifier: AGPL-3.0-only - - - + + + diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index f19d1e77418e..cb6821dfc58c 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -456,7 +456,7 @@ export const defaultStore = markRaw(new Storage('base', { }, contextMenu: { where: 'device', - default: 'always' as 'always' | 'withShift' | 'never', + default: 'app' as 'app' | 'appWithShift' | 'native', }, sound_masterVolume: { From 7a8d40e125cb3320df8f81d2d70ecf2c4159d09e Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:01:41 +0900 Subject: [PATCH 5/8] fix --- locales/index.d.ts | 2 +- locales/ja-JP.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 384045c25d77..ee66ad61e611 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10100,7 +10100,7 @@ export interface Locale extends ILocale { */ "appWithShift": string; /** - * ネイティブ + * ブラウザのUI */ "native": string; }; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index c98eb6f65507..1a8df02c6e53 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2694,4 +2694,4 @@ _contextMenu: title: "コンテキストメニュー" app: "Misskey" appWithShift: "Shiftキーを押しながらでMisskey" - native: "ネイティブ" + native: "ブラウザのUI" From acf0cc36847bbe248ef129e43a4d18f9f6ee4bc7 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:02:36 +0900 Subject: [PATCH 6/8] fix --- locales/ja-JP.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1a8df02c6e53..9085e6b656d8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2693,5 +2693,5 @@ _mediaControls: _contextMenu: title: "コンテキストメニュー" app: "Misskey" - appWithShift: "Shiftキーを押しながらでMisskey" + appWithShift: "ShiftキーでMisskey" native: "ブラウザのUI" From 662ad825173c523a2e94c280dd699c0b347ffeda Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:02:45 +0900 Subject: [PATCH 7/8] fix --- locales/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index ee66ad61e611..72d23ff8ad8d 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10096,7 +10096,7 @@ export interface Locale extends ILocale { */ "app": string; /** - * Shiftキーを押しながらでMisskey + * ShiftキーでMisskey */ "appWithShift": string; /** From 2fa9b91588e3f480cdb3c3b6ed10e04689466e3b Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:16:09 +0900 Subject: [PATCH 8/8] update translation keys --- locales/index.d.ts | 4 ++-- locales/ja-JP.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 72d23ff8ad8d..be37e409c51e 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10092,11 +10092,11 @@ export interface Locale extends ILocale { */ "title": string; /** - * Misskey + * アプリケーション */ "app": string; /** - * ShiftキーでMisskey + * Shiftキーでアプリケーション */ "appWithShift": string; /** diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 9085e6b656d8..63a5c39a4a68 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2692,6 +2692,6 @@ _mediaControls: _contextMenu: title: "コンテキストメニュー" - app: "Misskey" - appWithShift: "ShiftキーでMisskey" + app: "アプリケーション" + appWithShift: "Shiftキーでアプリケーション" native: "ブラウザのUI"