feat: persistent inline header search with overlay results
Replaces the hidden toggle-based mobile search bar with a permanently visible pill-shaped search input in the header row, next to the logo. - Search is always visible — no button click required - Typing shows a floating overlay with library results (artists, albums, songs) without navigating away from the current page - Clearing the input or navigating to any page closes the overlay silently - The ✕ clear button appears only while text is present - navigate() now calls closeHeaderSearch() so results disappear cleanly when tapping any result or bottom nav tab - Old toggleMobileSearch / closeMobileSearch kept as no-op stubs for safety Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b7afa19f70
commit
36f968881b
5 files changed
+48
-38
No files matched your search
@@ -25,24 +25,12 @@ export function switchNavMode(mode) {
|
||||
document.getElementById('bnav-tab-discover')?.classList.toggle('active', mode==='discover');
|
||||
}
|
||||
|
||||
// ─── MOBILE SEARCH ───
|
||||
// ─── MOBILE SEARCH (legacy stubs — header search is now always visible) ───
|
||||
export function toggleMobileSearch() {
|
||||
const bar = document.getElementById('mobile-search-bar');
|
||||
const btn = document.getElementById('mobile-search-btn');
|
||||
const open = bar.style.display==='none' || bar.style.display==='';
|
||||
bar.style.display = open ? 'block' : 'none';
|
||||
btn.style.color = open ? 'var(--accent)' : 'var(--text2)';
|
||||
if(open) { setTimeout(() => document.getElementById('mobile-search-input').focus(), 50); }
|
||||
else { closeMobileSearch(); }
|
||||
document.getElementById('header-search-input')?.focus();
|
||||
}
|
||||
export function closeMobileSearch() {
|
||||
const bar = document.getElementById('mobile-search-bar');
|
||||
const inp = document.getElementById('mobile-search-input');
|
||||
const btn = document.getElementById('mobile-search-btn');
|
||||
bar.style.display = 'none';
|
||||
btn.style.color = 'var(--text2)';
|
||||
inp.value = '';
|
||||
navigate('home');
|
||||
import('./views.js').then(m => m.closeHeaderSearch());
|
||||
}
|
||||
|
||||
// ─── SETUP ───
|
||||
|
||||
Reference in new issue
Block a user