검색 동선 통일

This commit is contained in:
2026-04-07 14:41:20 +09:00
parent a952d2a062
commit ede348be96
9 changed files with 40 additions and 129 deletions

View File

@@ -604,6 +604,13 @@ function handleLeftRailSearch() {
function submitGlobalSearch() {
const query = (searchQuery.value || '').trim()
isCollapsedSearchOpen.value = false
if (['home', 'templates', 'topicHub', 'followingFeed', 'favorites'].includes(String(route.name || ''))) {
const nextQuery = { ...route.query }
if (query) nextQuery.q = query
else delete nextQuery.q
router.push({ path: route.path, query: nextQuery })
return
}
router.push(route.name === 'templates' ? templatesPath(query) : homePath(query))
}