summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkSuperMenu.vue
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-08-03 11:02:20 +0900
committerGitHub <noreply@github.com>2025-08-03 11:02:20 +0900
commit6f3cc2cdf7e47a2dd4dd6d7478579746e2af652c (patch)
treeb6820cddaf963fe0489c7f1c44fd9324022c10e4 /packages/frontend/src/components/MkSuperMenu.vue
parentperf(frontend): tweak css performance (diff)
downloadmisskey-6f3cc2cdf7e47a2dd4dd6d7478579746e2af652c.tar.gz
misskey-6f3cc2cdf7e47a2dd4dd6d7478579746e2af652c.tar.bz2
misskey-6f3cc2cdf7e47a2dd4dd6d7478579746e2af652c.zip
コントロールパネルの検索 (#16343)
* Update settings.vue * Update settings.vue * Update settings.vue * Update settings.vue * Update settings.vue * Update performance.vue * Update performance.vue * Update performance.vue * Update external-services.vue * wip * wip * Update security.vue * Update settings.vue * Update CHANGELOG.md * wip * Update moderation.vue * wip * Update branding.vue * wip * Update email-settings.vue * Update system-webhook.vue * Update MkSuperMenu.vue * Update index.vue
Diffstat (limited to 'packages/frontend/src/components/MkSuperMenu.vue')
-rw-r--r--packages/frontend/src/components/MkSuperMenu.vue32
1 files changed, 24 insertions, 8 deletions
diff --git a/packages/frontend/src/components/MkSuperMenu.vue b/packages/frontend/src/components/MkSuperMenu.vue
index 5c89a6530d..dbc673333c 100644
--- a/packages/frontend/src/components/MkSuperMenu.vue
+++ b/packages/frontend/src/components/MkSuperMenu.vue
@@ -52,9 +52,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ item.label }}
</template>
<template v-else>
- <span style="opacity: 0.7; font-size: 90%;">{{ item.parentLabels.join(' > ') }}</span>
+ <span style="opacity: 0.7; font-size: 90%; word-break: break-word;">{{ item.parentLabels.join(' > ') }}</span>
<br>
- <span>{{ item.label }}</span>
+ <span style="word-break: break-word;">{{ item.label }}</span>
</template>
</span>
</MkA>
@@ -95,7 +95,7 @@ export type SuperMenuDef = {
<script lang="ts" setup>
import { useTemplateRef, ref, watch, nextTick, computed } from 'vue';
import { getScrollContainer } from '@@/js/scroll.js';
-import type { SearchIndexItem } from '@/utility/settings-search-index.js';
+import type { SearchIndexItem } from '@/utility/inapp-search.js';
import MkInput from '@/components/MkInput.vue';
import { i18n } from '@/i18n.js';
import { useRouter } from '@/router.js';
@@ -165,12 +165,28 @@ watch(rawSearchQuery, (value) => {
});
};
- for (const item of searchIndexItemById.values()) {
- if (
- compareStringIncludes(item.label, value) ||
- item.keywords.some((x) => compareStringIncludes(x, value))
- ) {
+ // label, keywords, texts の順に優先して表示
+
+ let items = Array.from(searchIndexItemById.values());
+
+ for (const item of items) {
+ if (compareStringIncludes(item.label, value)) {
+ addSearchResult(item);
+ items = items.filter(i => i.id !== item.id);
+ }
+ }
+
+ for (const item of items) {
+ if (item.keywords.some((x) => compareStringIncludes(x, value))) {
+ addSearchResult(item);
+ items = items.filter(i => i.id !== item.id);
+ }
+ }
+
+ for (const item of items) {
+ if (item.texts.some((x) => compareStringIncludes(x, value))) {
addSearchResult(item);
+ items = items.filter(i => i.id !== item.id);
}
}
}