fix: instant search via frontend library cache — no Go calls at all

The HTTP endpoint approach still crashed due to Wails asset server
issues. Replaced with a pure frontend solution: searchLibraryCache()
does a substring match against the libraryStore's cached artists and
albums arrays. This is pure JS — zero Go calls, zero RPC, zero
network — guaranteed instant.

Results appear immediately as the user types. The full MB+LB search
pipeline still runs via Wails RPC and replaces the library matches
with richer results when done.

Added cachedArtists/cachedAlbums getters to LibraryStore for
synchronous read-only access to the already-loaded data.
Removed the /api/search-local HTTP handler from the backend.
This commit is contained in:
2026-03-29 18:02:59 -04:00
parent 33d42febf1
commit 1999fdb0f4
4 changed files with 73 additions and 59 deletions
-3
View File
@@ -118,9 +118,6 @@ func NewYellowJacketApp(
yjApp.assetHandler.RegisterHandler("/artist-images/", artistImgHandler)
}
// Register local search endpoint — bypasses Wails RPC serialization.
yjApp.assetHandler.RegisterHandler("/api/search-local", yjApp.explore.SearchLocalHandler())
// create playlist service
yjApp.playlist = playlist.NewService(
yjApp.logger, yjApp.database, yjApp.appConfig,