fix: use reactive \$effect for search debounce instead of oninput bind:value captures the input event, so oninput doesn't fire. Use \$effect watching searchQuery to trigger debounced API search.

Author: Aaron Steven White
Commit 3f7801fa14374da7282626f80413ae29e5f06409
Parent: 07f8db5a6b
Structural diff unavailable

These commits were pushed via plain git push, so no pre-parsed schemas are available. Install git-remote-cospan and re-push via panproto:// to see scope-level changes, breaking change detection, and semantic diffs.

brew install panproto/tap/git-remote-cospan
1 file changed +11 -6
@@ -64,6 +64,17 @@
6464 	let searching = $state(false);
6565 	let searchTimer: ReturnType<typeof setTimeout> | null = null;
6666 
67+	// React to search query changes with debounce
68+	let lastSearchQuery = $state('');
69+	$effect(() => {
70+		const q = searchQuery;
71+		if (q === lastSearchQuery) return;
72+		lastSearchQuery = q;
73+		if (searchTimer) clearTimeout(searchTimer);
74+		searchTimer = setTimeout(() => doSearch(q), 300);
75+		return () => { if (searchTimer) clearTimeout(searchTimer); };
76+	});
77+
6778 	async function loadMore() {
6879 		if (!cursor || loadingMore) return;
6980 		loadingMore = true;
@@ -102,11 +113,6 @@
102113 		}
103114 	}
104115 
105-	function onSearchInput() {
106-		if (searchTimer) clearTimeout(searchTimer);
107-		searchTimer = setTimeout(() => doSearch(searchQuery), 300);
108-	}
109-
110116 	function getHandle(did: string): string {
111117 		return handles[did] || (did.startsWith('did:plc:') ? did.slice(8, 18) + '\u2026' : did);
112118 	}
@@ -226,7 +232,6 @@
226232 				<input
227233 					type="text"
228234 					bind:value={searchQuery}
229-					oninput={onSearchInput}
230235 					placeholder="Search all repos…"
231236 					class="w-full rounded-md border border-line bg-surface py-1.5 pl-9 pr-3 text-[13px] text-ink placeholder:text-ghost focus:border-focus/50 focus:outline-none transition-colors"
232237 				/>
cospan · schematic version control on atproto built on AT Protocol