1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-26 18:24:36 +02:00

refactor(frontend): MkRadiosの指定をpropsから行うように (#16597)

* refactor(frontend): MkRadiosの指定をpropsから行うように

* spdx

* fix lint

* fix: mkradiosを動的slotsに対応させる

* fix: remove comment [ci skip]

* fix lint

* fix lint

* migrate

* rename

* fix

* fix

* fix types

* remove unused imports

* fix

* wip

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
かっこかり
2026-01-14 14:02:50 +09:00
committed by GitHub
parent 153ebd4392
commit b941c896aa
34 changed files with 505 additions and 284 deletions

View File

@@ -19,11 +19,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #header>{{ i18n.ts.options }}</template>
<div class="_gaps_m">
<MkRadios v-model="searchScope">
<option v-if="instance.federation !== 'none' && noteSearchableScope === 'global'" value="all">{{ i18n.ts._search.searchScopeAll }}</option>
<option value="local">{{ instance.federation === 'none' ? i18n.ts._search.searchScopeAll : i18n.ts._search.searchScopeLocal }}</option>
<option v-if="instance.federation !== 'none' && noteSearchableScope === 'global'" value="server">{{ i18n.ts._search.searchScopeServer }}</option>
<option value="user">{{ i18n.ts._search.searchScopeUser }}</option>
<MkRadios
v-model="searchScope"
:options="searchScopeDef"
>
</MkRadios>
<div v-if="instance.federation !== 'none' && searchScope === 'server'" :class="$style.subOptionRoot">
@@ -127,6 +126,7 @@ import MkNotesTimeline from '@/components/MkNotesTimeline.vue';
import MkRadios from '@/components/MkRadios.vue';
import MkUserCardMini from '@/components/MkUserCardMini.vue';
import { Paginator } from '@/utility/paginator.js';
import type { MkRadiosOption } from '@/components/MkRadios.vue';
const props = withDefaults(defineProps<{
query?: string;
@@ -183,6 +183,24 @@ const searchScope = ref<'all' | 'local' | 'server' | 'user'>((() => {
return 'all';
})());
const searchScopeDef = computed<MkRadiosOption[]>(() => {
const options: MkRadiosOption[] = [];
if (instance.federation !== 'none' && noteSearchableScope === 'global') {
options.push({ value: 'all', label: i18n.ts._search.searchScopeAll });
}
options.push({ value: 'local', label: instance.federation === 'none' ? i18n.ts._search.searchScopeAll : i18n.ts._search.searchScopeLocal });
if (instance.federation !== 'none' && noteSearchableScope === 'global') {
options.push({ value: 'server', label: i18n.ts._search.searchScopeServer });
}
options.push({ value: 'user', label: i18n.ts._search.searchScopeUser });
return options;
});
type SearchParams = {
readonly query: string;
readonly host?: string;