From 7f4fb6f14b45eac882bb5fe25af71494f8379a1d Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Wed, 21 Jan 2026 21:07:00 -0800 Subject: [PATCH] fix: reset isLoading state in file autocomplete early-return paths (#631) Co-authored-by: Letta --- src/cli/components/FileAutocomplete.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/components/FileAutocomplete.tsx b/src/cli/components/FileAutocomplete.tsx index 14701c0..0c66d49 100644 --- a/src/cli/components/FileAutocomplete.tsx +++ b/src/cli/components/FileAutocomplete.tsx @@ -81,6 +81,7 @@ export function FileAutocomplete({ if (!result) { setMatches([]); + setIsLoading(false); onActiveChange?.(false); return; } @@ -96,6 +97,7 @@ export function FileAutocomplete({ // Always hide if there's more non-whitespace content after, or another @ if (afterSpace.trim().length > 0 || afterSpace.includes("@")) { setMatches([]); + setIsLoading(false); onActiveChange?.(false); return; } @@ -107,12 +109,14 @@ export function FileAutocomplete({ if (matches[0]?.path !== query) { setMatches([{ path: query, type: "file" }]); } + setIsLoading(false); onActiveChange?.(false); // Don't block Enter key return; } // No valid selection was made, hide setMatches([]); + setIsLoading(false); onActiveChange?.(false); return; } @@ -138,6 +142,7 @@ export function FileAutocomplete({ // Check if it's a URL pattern (no debounce) if (query.startsWith("http://") || query.startsWith("https://")) { setMatches([{ path: query, type: "url" }]); + setIsLoading(false); onActiveChange?.(true); return; }