Quick search sent a request on every keystroke and each one ran an
unindexed lower(name) GLOB scan, so searches piled up and the last one
finished last. This:
- debounces the search input by 250ms, aborts the superseded request, and
ignores late responses so the UI cannot show stale results;
- passes the request context into the query (15s timeout) so an abandoned
search is interrupted instead of holding the index DB connection;
- removes the session-cancellation map, which could not interrupt the scan;
- adds one global FTS5 trigram index over (name, source:path) so substring
searches use an index. It is derived data: a schema or health mismatch
deletes and rebuilds the index DB, and it falls back to the old query
when FTS5 is unavailable.
Also fixes GLOB escaping: SQLite GLOB has no backslash escape, so literal
* ? [ in a search term and in the scope prefix now use bracket classes.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>