From 7dcc23344560de6dfb58723bba8d2a3dba304ec3 Mon Sep 17 00:00:00 2001 From: b1rdmania <102524336+b1rdmania@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:35:14 +0000 Subject: [PATCH] Add immediate visual feedback on search click MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Status updates to "Starting search..." immediately when button clicked, before async operations. This will help diagnose if JS handler is running. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/main.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main.ts b/src/main.ts index 570bcfe..70e572b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -147,20 +147,22 @@ class MotifApp { } private setupEventListeners(): void { - this.searchBtn.addEventListener('click', () => { - console.log('[MotifApp] Search button clicked'); + const doSearch = () => { + console.log('[MotifApp] Search triggered'); + // Immediately show feedback so user knows click registered + this.status.textContent = 'Starting search...'; this.handleSearch().catch(err => { console.error('[MotifApp] Search error:', err); this.updateStatus(`Error: ${err instanceof Error ? err.message : 'Unknown error'}`); }); - }); + }; + + // Use both click and touchend for iOS compatibility + this.searchBtn.addEventListener('click', doSearch); this.songInput.addEventListener('keypress', (e) => { if (e.key === 'Enter') { - this.handleSearch().catch(err => { - console.error('[MotifApp] Search error:', err); - this.updateStatus(`Error: ${err instanceof Error ? err.message : 'Unknown error'}`); - }); + doSearch(); } });