|
|
|
@ -143,6 +143,54 @@ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update URL with search query for all search types |
|
|
|
|
|
|
|
if (clearInput) { |
|
|
|
|
|
|
|
const searchType = getSearchType(query); |
|
|
|
|
|
|
|
if (searchType) { |
|
|
|
|
|
|
|
const { type, term } = searchType; |
|
|
|
|
|
|
|
const encoded = encodeURIComponent(term); |
|
|
|
|
|
|
|
if (type === "d") { |
|
|
|
|
|
|
|
goto(`?d=${encoded}`, { |
|
|
|
|
|
|
|
replaceState: false, |
|
|
|
|
|
|
|
keepFocus: true, |
|
|
|
|
|
|
|
noScroll: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else if (type === "t") { |
|
|
|
|
|
|
|
goto(`?t=${encoded}`, { |
|
|
|
|
|
|
|
replaceState: false, |
|
|
|
|
|
|
|
keepFocus: true, |
|
|
|
|
|
|
|
noScroll: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else if (type === "n") { |
|
|
|
|
|
|
|
goto(`?n=${encoded}`, { |
|
|
|
|
|
|
|
replaceState: false, |
|
|
|
|
|
|
|
keepFocus: true, |
|
|
|
|
|
|
|
noScroll: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else if (type === "nip05") { |
|
|
|
|
|
|
|
goto(`?q=${encodeURIComponent(query)}`, { |
|
|
|
|
|
|
|
replaceState: false, |
|
|
|
|
|
|
|
keepFocus: true, |
|
|
|
|
|
|
|
noScroll: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else if (type === "event") { |
|
|
|
|
|
|
|
goto(`?id=${encoded}`, { |
|
|
|
|
|
|
|
replaceState: false, |
|
|
|
|
|
|
|
keepFocus: true, |
|
|
|
|
|
|
|
noScroll: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// No specific search type detected, treat as general search |
|
|
|
|
|
|
|
const encoded = encodeURIComponent(query); |
|
|
|
|
|
|
|
goto(`?q=${encoded}`, { |
|
|
|
|
|
|
|
replaceState: false, |
|
|
|
|
|
|
|
keepFocus: true, |
|
|
|
|
|
|
|
noScroll: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Handle different search types |
|
|
|
// Handle different search types |
|
|
|
const searchType = getSearchType(query); |
|
|
|
const searchType = getSearchType(query); |
|
|
|
if (searchType) { |
|
|
|
if (searchType) { |
|
|
|
@ -151,9 +199,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// AI-NOTE: 2025-01-24 - If no specific search type is detected, treat as event ID search |
|
|
|
// AI-NOTE: 2025-01-24 - If no specific search type is detected, treat as event ID search |
|
|
|
if (clearInput) { |
|
|
|
// URL navigation is now handled in the URL update logic above |
|
|
|
navigateToSearch(query, "id"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
await handleEventSearch(query); |
|
|
|
await handleEventSearch(query); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -210,7 +256,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
if (type === "d") { |
|
|
|
if (type === "d") { |
|
|
|
console.log("EventSearch: Processing d-tag search:", term); |
|
|
|
console.log("EventSearch: Processing d-tag search:", term); |
|
|
|
navigateToSearch(term, "d"); |
|
|
|
// URL navigation is now handled in handleSearchEvent |
|
|
|
updateSearchState(false, false, null, null); |
|
|
|
updateSearchState(false, false, null, null); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -222,6 +268,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
if (type === "event") { |
|
|
|
if (type === "event") { |
|
|
|
console.log("EventSearch: Processing event ID search:", term); |
|
|
|
console.log("EventSearch: Processing event ID search:", term); |
|
|
|
|
|
|
|
// URL navigation is now handled in handleSearchEvent |
|
|
|
await handleEventSearch(term); |
|
|
|
await handleEventSearch(term); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|