Der Suchen-Tab war 59 Zeilen: ein Textfeld ueber einer flachen
Liederliste, nur ueber Titel/Kuenstler/Album. Wer "Nightcore" eingab,
fand alle Titel dieses Kuenstlers untereinander, aber weder den
Kuenstler selbst noch eine gleichnamige Kategorie oder Liste.
- Vier Abschnitte mit Ueberschrift und Trefferzahl. Alben stecken in
"Kategorien" — der Album-Name ist in Melo die erste Kategorie eines
Titels, ein eigener Abschnitt waere dieselbe Liste zweimal.
- Treffer am Wortanfang zuerst, dann alphabetisch.
- Entprellt (250 ms); vorher baute jeder Tastendruck alles neu auf.
- Letzte acht Suchen, gemerkt beim Abschicken, mit Loeschen-Knopf.
- Der Tab folgt jetzt dem Aufbau der uebrigen Tabs (war ein Scaffold
mit eigener AppBar innerhalb eines Tabs).
- Bewusst rein lokal, ohne Server-Abfrage.
Herausgeloest, weil es sonst eine dritte Kopie gegeben haette:
TitelListenScreen ("Ueberschrift + Liederliste", stand zweimal wortgleich
im Baum) und SongZeile (die Suche setzt einzelne Zeilen in ihre
Abschnitte; eine ganze SongList waere dort verschachteltes Scrollen).
Aus dem Code-Review nachgebessert: Suche und Zuordnung benutzen dieselbe
Normalform, sonst zeigte ein Treffer "0 Titel" und oeffnete eine leere
Liste; Kategorien ohne lebende Titel fallen weg; alle Abschnitte sind
gedeckelt; die Drift-Stroeme werden nicht mehr je Rebuild neu abonniert;
das Loeschkreuz erscheint sofort statt nach 250 ms.
Tot geworden und entfernt: MeloDb.searchSongs samt Test.
396 Tests gruen (vorher 360), flutter analyze ohne Befund, Release-APK
gebaut.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xAHJTJM6UUqmjUgk1PUEd
## Critical Blockers Fixed
- Remove playbackState.addError() which broke audio_service permanently
- Move error handling from audio_handler to song_list where UI context exists
- Display error in SnackBar instead of destroying playback stream
- Add escapeChar parameter to LIKE queries for correct wildcard handling
- Fixes broken search for titles with _ or % characters
- Add dismissScanError() method to allow closing error banner
- Previously banner couldn't be dismissed (missing notifyListeners())
## Improvements
- Remove dead livePaths list, use companions.isNotEmpty instead
- Add initial progress update to show total files when scan starts
- Add tooltip to now_playing_screen Zurück button
- Add proper error handling in song_list with async/await
## Testing
- Add regression test for CRITICAL-1: empty scan doesn't delete songs
- Add regression test for CRITICAL-2: tombstoned files restore on re-scan
- All 11 tests pass
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
## Critical Fixes
- Fix CRITICAL-1: Empty scans no longer delete entire library
- Use timestamp-based tombstone logic instead of path-based
- Only mark missing if livePaths is not empty
- Fix CRITICAL-2: Re-scanned files now return from deleted state
- Add deleted=false to SongsCompanion.insert in both scanners
## High Priority Fixes
- HIGH-1: Fix SQLite variable limit crash on large libraries
- Replace isNotIn() with timestamp comparison (O(1) not O(n))
- HIGH-2: Fix UI freezing during scan
- Throttle progress updates (every 50 files or end of scan)
- HIGH-3: Add error handling for scan failures
- Wrap scanFolders/scanAndroidMediaStore in try/catch
- Display scanError banner in LibraryScreen
- HIGH-4: Add error handling for playback failures
- Wrap loadPlaylist in try/catch
## Medium Priority Fixes
- MEDIUM-1: Replace ! with ?? to handle unknown ProcessingState
- MEDIUM-2: Escape LIKE wildcards in search queries
- MEDIUM-4: Display StreamBuilder errors instead of treating as empty
- MEDIUM-8: Add tooltips to all IconButtons for accessibility
- Add doc comments to public database APIs
## Testing
- Add regression tests for CRITICAL-1 and CRITICAL-2
- All 9 existing tests pass
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>