From 018aa6381da73ceaef756c6dab65743f629526c6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 29 Jun 2022 11:13:32 +0900 Subject: [PATCH 1/8] =?UTF-8?q?enhance(client):=20=E3=83=A1=E3=83=8B?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve #6389 Fix #8035 --- locales/ja-JP.yml | 1 + packages/client/src/components/launch-pad.vue | 29 ++++- packages/client/src/menu.ts | 29 ----- .../{emojis.category.vue => about.emojis.vue} | 0 .../client/src/pages/about.federation.vue | 106 +++++++++++++++ packages/client/src/pages/about.vue | 14 +- packages/client/src/pages/admin/index.vue | 2 +- packages/client/src/pages/emojis.vue | 58 --------- packages/client/src/pages/federation.vue | 122 ------------------ packages/client/src/pages/mentions.vue | 29 ----- packages/client/src/pages/messages.vue | 32 ----- packages/client/src/pages/notifications.vue | 44 +++++-- .../client/src/pages/user/index.activity.vue | 2 +- packages/client/src/router.ts | 12 -- 14 files changed, 181 insertions(+), 299 deletions(-) rename packages/client/src/pages/{emojis.category.vue => about.emojis.vue} (100%) create mode 100644 packages/client/src/pages/about.federation.vue delete mode 100644 packages/client/src/pages/emojis.vue delete mode 100644 packages/client/src/pages/federation.vue delete mode 100644 packages/client/src/pages/mentions.vue delete mode 100644 packages/client/src/pages/messages.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6b4a99c4a..95d2868ed 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -854,6 +854,7 @@ typeToConfirm: "この操作を行うには {x} と入力してください" deleteAccount: "アカウント削除" numberOfPageCache: "ページキャッシュ数" numberOfPageCacheDescription: "多くすると利便性が向上しますが、負荷とメモリ使用量が増えます。" +document: "ドキュメント" _emailUnavailable: used: "既に使用されています" diff --git a/packages/client/src/components/launch-pad.vue b/packages/client/src/components/launch-pad.vue index 3c1d3f3c1..d875edb53 100644 --- a/packages/client/src/components/launch-pad.vue +++ b/packages/client/src/components/launch-pad.vue @@ -16,13 +16,13 @@
- + -
{{ i18n.t('aboutX', { x: instanceName }) }}
+
{{ i18n.ts.instanceInfo }}
@@ -40,6 +40,7 @@ import { instanceName } from '@/config'; import { defaultStore } from '@/store'; import { i18n } from '@/i18n'; import { deviceKind } from '@/scripts/device-kind'; +import * as os from '@/os'; const props = withDefaults(defineProps<{ src?: HTMLElement; @@ -72,6 +73,28 @@ const items = Object.keys(menuDef).filter(k => !menu.includes(k)).map(k => menuD function close() { modal.close(); } + +function help(ev: MouseEvent) { + os.popupMenu([{ + type: 'link', + to: '/mfm-cheat-sheet', + text: i18n.ts._mfm.cheatSheet, + icon: 'fas fa-code', + }, { + type: 'link', + to: '/scratchpad', + text: i18n.ts.scratchpad, + icon: 'fas fa-terminal', + }, null, { + text: i18n.ts.document, + icon: 'fas fa-question-circle', + action: () => { + window.open('https://misskey-hub.net/help.html', '_blank'); + }, + }], ev.currentTarget ?? ev.target); + + close(); +} diff --git a/packages/client/src/pages/about.vue b/packages/client/src/pages/about.vue index fcb82ee34..ca53f00a2 100644 --- a/packages/client/src/pages/about.vue +++ b/packages/client/src/pages/about.vue @@ -73,7 +73,7 @@ - + @@ -81,6 +81,8 @@ - - diff --git a/packages/client/src/pages/federation.vue b/packages/client/src/pages/federation.vue deleted file mode 100644 index 28acf44f7..000000000 --- a/packages/client/src/pages/federation.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/packages/client/src/pages/mentions.vue b/packages/client/src/pages/mentions.vue deleted file mode 100644 index 36720a011..000000000 --- a/packages/client/src/pages/mentions.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/packages/client/src/pages/messages.vue b/packages/client/src/pages/messages.vue deleted file mode 100644 index 6ac07b165..000000000 --- a/packages/client/src/pages/messages.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/packages/client/src/pages/notifications.vue b/packages/client/src/pages/notifications.vue index c91d3bd4f..ec70851ca 100644 --- a/packages/client/src/pages/notifications.vue +++ b/packages/client/src/pages/notifications.vue @@ -2,8 +2,14 @@ -
- +
+ +
+
+ +
+
+
@@ -13,12 +19,27 @@ import { computed } from 'vue'; import { notificationTypes } from 'foundkey-js'; import XNotifications from '@/components/notifications.vue'; +import XNotes from '@/components/notes.vue'; import * as os from '@/os'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; let tab = $ref('all'); let includeTypes = $ref(null); +let unreadOnly = $computed(() => tab === 'unread'); + +const mentionsPagination = { + endpoint: 'notes/mentions' as const, + limit: 10, +}; + +const directNotesPagination = { + endpoint: 'notes/mentions' as const, + limit: 10, + params: { + visibility: 'specified', + }, +}; function setFilter(ev) { const typeItems = notificationTypes.map(t => ({ @@ -38,18 +59,18 @@ function setFilter(ev) { os.popupMenu(items, ev.currentTarget ?? ev.target); } -const headerActions = $computed(() => [{ +const headerActions = $computed(() => [tab === 'all' ? { text: i18n.ts.filter, icon: 'fas fa-filter', highlighted: includeTypes != null, handler: setFilter, -}, { +} : undefined, tab === 'all' ? { text: i18n.ts.markAllAsRead, icon: 'fas fa-check', handler: () => { os.apiWithDialog('notifications/mark-all-as-read'); }, -}]); +} : undefined].filter(x => x !== undefined)); const headerTabs = $computed(() => [{ key: 'all', @@ -57,6 +78,14 @@ const headerTabs = $computed(() => [{ }, { key: 'unread', title: i18n.ts.unread, +}, { + key: 'mentions', + title: i18n.ts.mentions, + icon: 'fas fa-at', +}, { + key: 'directNotes', + title: i18n.ts.directNotes, + icon: 'fas fa-envelope', }]); definePageMetadata(computed(() => ({ @@ -64,8 +93,3 @@ definePageMetadata(computed(() => ({ icon: 'fas fa-bell', }))); - - diff --git a/packages/client/src/pages/user/index.activity.vue b/packages/client/src/pages/user/index.activity.vue index 90f1632ea..86f872e30 100644 --- a/packages/client/src/pages/user/index.activity.vue +++ b/packages/client/src/pages/user/index.activity.vue @@ -1,6 +1,6 @@