From 1a698111a4ab5464ec000e59179a0083669dbc6d Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 29 Jun 2022 00:36:06 +0900 Subject: [PATCH 001/100] refactor(client): remove invalid computed --- packages/client/src/components/captcha.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/captcha.vue b/packages/client/src/components/captcha.vue index 183658471..736073491 100644 --- a/packages/client/src/components/captcha.vue +++ b/packages/client/src/components/captcha.vue @@ -51,7 +51,7 @@ const variable = computed(() => { } }); -const loaded = computed(() => !!window[variable.value]); +const loaded = !!window[variable.value]; const src = computed(() => { switch (props.provider) { @@ -62,7 +62,7 @@ const src = computed(() => { const captcha = computed(() => window[variable.value] || {} as unknown as Captcha); -if (loaded.value) { +if (loaded) { available.value = true; } else { (document.getElementById(props.provider) || document.head.appendChild(Object.assign(document.createElement('script'), { @@ -74,7 +74,7 @@ if (loaded.value) { } function reset() { - if (captcha.value?.reset) captcha.value.reset(); + if (captcha.value.reset) captcha.value.reset(); } function requestRender() { From 0f1c0a42a253dcc5758e4811aaa116708d482305 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 29 Jun 2022 11:13:32 +0900 Subject: [PATCH 002/100] =?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 | 31 ++++- 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 | 18 ++- packages/client/src/pages/admin/index.vue | 2 +- packages/client/src/pages/emojis.vue | 60 --------- packages/client/src/pages/federation.vue | 122 ------------------ packages/client/src/pages/mentions.vue | 27 ---- packages/client/src/pages/messages.vue | 30 ----- packages/client/src/pages/notifications.vue | 44 +++++-- .../client/src/pages/user/index.activity.vue | 6 +- packages/client/src/router.ts | 12 -- packages/client/src/widgets/activity.vue | 2 +- 15 files changed, 190 insertions(+), 300 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 f81338922..139643f72 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -857,6 +857,7 @@ check: "チェック" isSystemAccount: "システムにより自動で作成・管理されているアカウントです。" typeToConfirm: "この操作を行うには {x} と入力してください" deleteAccount: "アカウント削除" +document: "ドキュメント" _emailUnavailable: used: "既に使用されています" diff --git a/packages/client/src/components/launch-pad.vue b/packages/client/src/components/launch-pad.vue index ffefc1b08..a6025f8b2 100644 --- a/packages/client/src/components/launch-pad.vue +++ b/packages/client/src/components/launch-pad.vue @@ -16,13 +16,13 @@
- + -
{{ $t('aboutX', { x: instanceName }) }}
+
{{ $ts.instanceInfo }}
@@ -34,13 +34,14 @@ diff --git a/packages/client/src/pages/about.vue b/packages/client/src/pages/about.vue index c0226bdb6..bacfab771 100644 --- a/packages/client/src/pages/about.vue +++ b/packages/client/src/pages/about.vue @@ -67,6 +67,12 @@
+ + + + + + @@ -75,6 +81,8 @@ - - diff --git a/packages/client/src/pages/federation.vue b/packages/client/src/pages/federation.vue deleted file mode 100644 index 07c5a32bd..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 0835f1f01..000000000 --- a/packages/client/src/pages/mentions.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/packages/client/src/pages/messages.vue b/packages/client/src/pages/messages.vue deleted file mode 100644 index e443b5c46..000000000 --- a/packages/client/src/pages/messages.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/packages/client/src/pages/notifications.vue b/packages/client/src/pages/notifications.vue index 52cb298fa..3df1a3f17 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 'misskey-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(() => ({ @@ -65,8 +94,3 @@ definePageMetadata(computed(() => ({ bg: 'var(--bg)', }))); - - diff --git a/packages/client/src/pages/user/index.activity.vue b/packages/client/src/pages/user/index.activity.vue index aecd25d6b..8a7a86e0f 100644 --- a/packages/client/src/pages/user/index.activity.vue +++ b/packages/client/src/pages/user/index.activity.vue @@ -1,6 +1,6 @@