Add mobile and desktop search for QR Plus.
Deploy Ladill QR Plus / deploy (push) Successful in 40s

Introduce a dedicated /search page, wire the bottom nav and topbar to it, and expose JSON results for live lookup of QR codes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 15:37:58 +00:00
co-authored by Cursor
parent de2ad0d393
commit 5fb2de31c8
8 changed files with 253 additions and 58 deletions
+9 -3
View File
@@ -140,14 +140,20 @@ Alpine.data('afia', (config = {}) => ({
}));
Alpine.data('topbarSearch', (config = {}) => ({
query: '',
results: [],
open: false,
query: config.initialQuery || '',
results: Array.isArray(config.initialResults) ? config.initialResults : [],
open: !!config.openOnInit,
loading: false,
active: 0,
_abort: null,
searchUrl: config.searchUrl || '/search',
init() {
if (config.autoFocus) {
this.$nextTick(() => this.$refs.input?.focus());
}
},
onFocus() {
if (this.results.length > 0 || this.query.trim().length >= 2) this.open = true;
},