rename globalSearch

This commit is contained in:
pa
2026-03-14 20:05:10 +09:00
parent b750d3fb9a
commit 84f46a5645
14 changed files with 51 additions and 51 deletions

View File

@@ -5,7 +5,7 @@
<button
type="button"
class="border-input dark:bg-input/30 flex h-9 w-full items-center gap-2 rounded-md border bg-transparent px-3 shadow-xs transition-[color,box-shadow] hover:border-ring cursor-pointer overflow-hidden"
@click="openGlobalSearch">
@click="openQuickSearch">
<Search class="size-4 shrink-0 opacity-50" />
<span class="search-text flex-1 min-w-0 text-left text-sm text-muted-foreground truncate">{{
t('side_panel.search_placeholder')
@@ -240,7 +240,7 @@
</TabsUnderline>
<NotificationCenterSheet />
<GroupOrderSheet v-model:open="isGroupOrderSheetOpen" />
<GlobalSearchDialog />
<QuickSearchDialog />
</div>
</template>
@@ -279,10 +279,10 @@
} from '../../stores';
import { runRefreshFriendsListFlow } from '../../coordinators/friendSyncCoordinator';
import { normalizeFavoriteGroupsChange, resolveFavoriteGroups } from './sidebarSettingsUtils';
import { useGlobalSearchStore } from '../../stores/globalSearch';
import { useQuickSearchStore } from '../../stores/quickSearch';
import FriendsSidebar from './components/FriendsSidebar.vue';
import GlobalSearchDialog from '../../components/GlobalSearchDialog.vue';
import QuickSearchDialog from '../../components/QuickSearchDialog.vue';
import GroupOrderSheet from './components/GroupOrderSheet.vue';
import GroupsSidebar from './components/GroupsSidebar.vue';
import NotificationCenterSheet from './components/NotificationCenterSheet.vue';
@@ -291,21 +291,21 @@
const { groupInstances } = storeToRefs(useGroupStore());
const notificationStore = useNotificationStore();
const { isNotificationCenterOpen, hasUnseenNotifications } = storeToRefs(notificationStore);
const globalSearchStore = useGlobalSearchStore();
const quickSearchStore = useQuickSearchStore();
const { t } = useI18n();
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
// Keyboard shortcut: Ctrl+K (Windows) / ⌘K (Mac)
const keys = useMagicKeys();
whenever(keys['Meta+k'], () => openGlobalSearch());
whenever(keys['Ctrl+k'], () => openGlobalSearch());
whenever(keys['Meta+k'], () => openQuickSearch());
whenever(keys['Ctrl+k'], () => openQuickSearch());
/**
*
*/
function openGlobalSearch() {
globalSearchStore.open();
function openQuickSearch() {
quickSearchStore.open();
}
/**

View File

@@ -53,8 +53,8 @@ vi.mock('../../../stores', () => ({
localFriendFavoriteGroups: ref([])
})
}));
vi.mock('../../../stores/globalSearch', () => ({
useGlobalSearchStore: () => ({ open: (...a) => mocks.openSearch(...a) })
vi.mock('../../../stores/quickSearch', () => ({
useQuickSearchStore: () => ({ open: (...a) => mocks.openSearch(...a) })
}));
vi.mock('../../../coordinators/friendSyncCoordinator', () => ({
runRefreshFriendsListFlow: (...a) => mocks.refreshFriends(...a)
@@ -135,7 +135,7 @@ vi.mock('../components/GroupOrderSheet.vue', () => ({
vi.mock('../components/NotificationCenterSheet.vue', () => ({
default: { template: '<div />' }
}));
vi.mock('../../../components/GlobalSearchDialog.vue', () => ({
vi.mock('../../../components/QuickSearchDialog.vue', () => ({
default: { template: '<div />' }
}));
@@ -147,7 +147,7 @@ describe('Sidebar.vue', () => {
mocks.markAllAsSeen.mockClear();
});
it('opens global search and marks notifications read', async () => {
it('opens quick search and marks notifications read', async () => {
const wrapper = mount(Sidebar);
const buttons = wrapper.findAll('button');
for (const button of buttons) {