From f4d1fcaf67716aa710d271e7f56c4f78cd202f29 Mon Sep 17 00:00:00 2001 From: yupix Date: Mon, 10 Jul 2023 15:55:10 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=82=92contextmenu=E3=81=8B=E3=82=89=E3=82=A2=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=E3=81=AB=E8=BF=BD=E5=8A=A0=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A9=20(#1120?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: ユーザーをcontextmenuからアンテナに追加できるように close #11115 * MkAvatars.vue変更 * nanka iroiro * fix MkAvatars * ix * fix --------- Co-authored-by: tamaina --- CHANGELOG.md | 1 + locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + packages/frontend/src/cache.ts | 1 + .../frontend/src/components/MkAvatars.vue | 15 ++-- .../frontend/src/pages/my-antennas/create.vue | 6 +- .../frontend/src/pages/my-antennas/edit.vue | 6 +- .../frontend/src/pages/my-antennas/index.vue | 89 +++++++++++-------- .../frontend/src/pages/my-lists/index.vue | 53 +++++++---- packages/frontend/src/scripts/cache.ts | 12 +-- .../frontend/src/scripts/get-user-menu.ts | 36 +++++++- 11 files changed, 144 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 959954b661..a03ca4ab86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - フォルダーやファイルに対しても開発者モード使用時、IDをコピーできるように - 引用対象を「もっと見る」で展開した場合、「閉じる」で畳めるように - プロフィールURLをコピーできるボタンを追加 #11190 +- ユーザーのContextMenuに「アンテナに追加」ボタンを追加 - フォローやお気に入り登録をしていないチャンネルを開く時は概要ページを開くように - 画面ビューワをタップした場合、マウスクリックと同様に画像ビューワを閉じるように - Fix: サーバーメトリクスが90度傾いている diff --git a/locales/index.d.ts b/locales/index.d.ts index 42dddebbff..8697b22e21 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -52,6 +52,7 @@ export interface Locale { "deleteAndEdit": string; "deleteAndEditConfirm": string; "addToList": string; + "addToAntenna": string; "sendMessage": string; "copyRSS": string; "copyUsername": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 16014da511..82efc8a469 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -49,6 +49,7 @@ delete: "削除" deleteAndEdit: "削除して編集" deleteAndEditConfirm: "このノートを削除してもう一度編集しますか?このノートへのリアクション、Renote、返信も全て削除されます。" addToList: "リストに追加" +addToAntenna: "アンテナに追加" sendMessage: "メッセージを送信" copyRSS: "RSSをコピー" copyUsername: "ユーザー名をコピー" diff --git a/packages/frontend/src/cache.ts b/packages/frontend/src/cache.ts index c95da64bba..cb315c8ff7 100644 --- a/packages/frontend/src/cache.ts +++ b/packages/frontend/src/cache.ts @@ -4,3 +4,4 @@ import { Cache } from '@/scripts/cache'; export const clipsCache = new Cache(Infinity); export const rolesCache = new Cache(Infinity); export const userListsCache = new Cache(Infinity); +export const antennasCache = new Cache(Infinity); diff --git a/packages/frontend/src/components/MkAvatars.vue b/packages/frontend/src/components/MkAvatars.vue index 630620fc08..437dce0a14 100644 --- a/packages/frontend/src/components/MkAvatars.vue +++ b/packages/frontend/src/components/MkAvatars.vue @@ -1,24 +1,29 @@ diff --git a/packages/frontend/src/pages/my-antennas/create.vue b/packages/frontend/src/pages/my-antennas/create.vue index 355d18fdb5..632c36bbf8 100644 --- a/packages/frontend/src/pages/my-antennas/create.vue +++ b/packages/frontend/src/pages/my-antennas/create.vue @@ -9,6 +9,7 @@ import XAntenna from './editor.vue'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; import { useRouter } from '@/router'; +import { antennasCache } from '@/cache'; const router = useRouter(); @@ -26,13 +27,10 @@ let draft = $ref({ }); function onAntennaCreated() { + antennasCache.delete(); router.push('/my/antennas'); } -const headerActions = $computed(() => []); - -const headerTabs = $computed(() => []); - definePageMetadata({ title: i18n.ts.manageAntennas, icon: 'ti ti-antenna', diff --git a/packages/frontend/src/pages/my-antennas/edit.vue b/packages/frontend/src/pages/my-antennas/edit.vue index da9b2de48f..3fb9690ac1 100644 --- a/packages/frontend/src/pages/my-antennas/edit.vue +++ b/packages/frontend/src/pages/my-antennas/edit.vue @@ -10,6 +10,7 @@ import * as os from '@/os'; import { i18n } from '@/i18n'; import { useRouter } from '@/router'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { antennasCache } from '@/cache'; const router = useRouter(); @@ -20,6 +21,7 @@ const props = defineProps<{ }>(); function onAntennaUpdated() { + antennasCache.delete(); router.push('/my/antennas'); } @@ -27,10 +29,6 @@ os.api('antennas/show', { antennaId: props.antennaId }).then((antennaResponse) = antenna = antennaResponse; }); -const headerActions = $computed(() => []); - -const headerTabs = $computed(() => []); - definePageMetadata({ title: i18n.ts.manageAntennas, icon: 'ti ti-antenna', diff --git a/packages/frontend/src/pages/my-antennas/index.vue b/packages/frontend/src/pages/my-antennas/index.vue index 2ca026b9a1..1e9136f1fa 100644 --- a/packages/frontend/src/pages/my-antennas/index.vue +++ b/packages/frontend/src/pages/my-antennas/index.vue @@ -2,15 +2,20 @@ -
- {{ i18n.ts.add }} +
+
+
+ +
{{ i18n.ts.nothing }}
+
+
-
- - -
{{ antenna.name }}
-
-
+ {{ i18n.ts.add }} + +
+ +
{{ antenna.name }}
+
@@ -18,19 +23,31 @@ - diff --git a/packages/frontend/src/pages/my-lists/index.vue b/packages/frontend/src/pages/my-lists/index.vue index cee241c489..0f59ca0b36 100644 --- a/packages/frontend/src/pages/my-lists/index.vue +++ b/packages/frontend/src/pages/my-lists/index.vue @@ -3,38 +3,43 @@
+
+
+ +
{{ i18n.ts.nothing }}
+
+
+ {{ i18n.ts.createList }} - -
- -
{{ list.name }}
- -
-
-
+
+ +
{{ list.name }}
+ +
+