From 925cc06aea4aea0bed4624df82bc84c6ca4a98a0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 16 Mar 2023 11:56:20 +0900 Subject: [PATCH] enhance(client): tweak search page --- locales/ja-JP.yml | 1 + packages/frontend/src/navbar.ts | 8 + packages/frontend/src/pages/notifications.vue | 2 + packages/frontend/src/pages/search.vue | 170 ++++++++---------- packages/frontend/src/scripts/lookup.ts | 41 +++++ 5 files changed, 127 insertions(+), 95 deletions(-) create mode 100644 packages/frontend/src/scripts/lookup.ts diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index feb09b9054..a3a1d2cd24 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -973,6 +973,7 @@ rolesAssignedToMe: "自分に割り当てられたロール" resetPasswordConfirm: "パスワードリセットしますか?" sensitiveWords: "センシティブワード" sensitiveWordsDescription: "設定したワードが含まれるノートの公開範囲をホームにします。改行で区切って複数設定できます。" +notesSearchNotAvailable: "ノート検索は利用できません。" _achievements: earnedAt: "獲得日時" diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts index 032d68862d..0e2f787d50 100644 --- a/packages/frontend/src/navbar.ts +++ b/packages/frontend/src/navbar.ts @@ -2,6 +2,7 @@ import { computed, reactive } from 'vue'; import { $i } from './account'; import { miLocalStorage } from './local-storage'; import { openInstanceMenu } from './ui/_common_/common'; +import { lookup } from './scripts/lookup'; import * as os from '@/os'; import { i18n } from '@/i18n'; import { ui } from '@/config'; @@ -44,6 +45,13 @@ export const navbarItemDef = reactive({ icon: 'ti ti-search', to: '/search', }, + lookup: { + title: i18n.ts.lookup, + icon: 'ti ti-world-search', + action: (ev) => { + lookup(); + }, + }, lists: { title: i18n.ts.lists, icon: 'ti ti-list', diff --git a/packages/frontend/src/pages/notifications.vue b/packages/frontend/src/pages/notifications.vue index da64a4c1e0..a5c7cdaa71 100644 --- a/packages/frontend/src/pages/notifications.vue +++ b/packages/frontend/src/pages/notifications.vue @@ -75,9 +75,11 @@ const headerActions = $computed(() => [tab === 'all' ? { const headerTabs = $computed(() => [{ key: 'all', title: i18n.ts.all, + icon: 'ti ti-point', }, { key: 'unread', title: i18n.ts.unread, + icon: 'ti ti-loader', }, { key: 'mentions', title: i18n.ts.mentions, diff --git a/packages/frontend/src/pages/search.vue b/packages/frontend/src/pages/search.vue index 7e81cd2c0d..cc6f8cc0cc 100644 --- a/packages/frontend/src/pages/search.vue +++ b/packages/frontend/src/pages/search.vue @@ -1,26 +1,42 @@