summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui
diff options
context:
space:
mode:
authorBryant Chandler <[email protected]>2025-08-07 15:24:55 -0700
committerGitHub <[email protected]>2025-08-07 22:24:55 +0000
commit9fc7115b8654fc193f948570293485f16d89f60a (patch)
tree22b9049754e35deabd61ad0923ab3f22a849bff0 /packages/cli/src/ui
parentc38147a3a61779ee9b82f656f03b51fc0e68e799 (diff)
perf(filesearch): Use async fzf for non-blocking file search (#5771)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/cli/src/ui')
-rw-r--r--packages/cli/src/ui/hooks/useAtCompletion.test.ts6
-rw-r--r--packages/cli/src/ui/hooks/useAtCompletion.ts2
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/cli/src/ui/hooks/useAtCompletion.test.ts b/packages/cli/src/ui/hooks/useAtCompletion.test.ts
index aa198fc1..599f8fdf 100644
--- a/packages/cli/src/ui/hooks/useAtCompletion.test.ts
+++ b/packages/cli/src/ui/hooks/useAtCompletion.test.ts
@@ -157,7 +157,7 @@ describe('useAtCompletion', () => {
});
});
- it('should NOT show a loading indicator for subsequent searches that complete under 100ms', async () => {
+ it('should NOT show a loading indicator for subsequent searches that complete under 200ms', async () => {
const structure: FileSystemStructure = { 'a.txt': '', 'b.txt': '' };
testRootDir = await createTmpDir(structure);
@@ -186,7 +186,7 @@ describe('useAtCompletion', () => {
expect(result.current.isLoadingSuggestions).toBe(false);
});
- it('should show a loading indicator and clear old suggestions for subsequent searches that take longer than 100ms', async () => {
+ it('should show a loading indicator and clear old suggestions for subsequent searches that take longer than 200ms', async () => {
const structure: FileSystemStructure = { 'a.txt': '', 'b.txt': '' };
testRootDir = await createTmpDir(structure);
@@ -194,7 +194,7 @@ describe('useAtCompletion', () => {
const originalSearch = FileSearch.prototype.search;
vi.spyOn(FileSearch.prototype, 'search').mockImplementation(
async function (...args) {
- await new Promise((resolve) => setTimeout(resolve, 200));
+ await new Promise((resolve) => setTimeout(resolve, 300));
return originalSearch.apply(this, args);
},
);
diff --git a/packages/cli/src/ui/hooks/useAtCompletion.ts b/packages/cli/src/ui/hooks/useAtCompletion.ts
index 82439c14..f6835dc8 100644
--- a/packages/cli/src/ui/hooks/useAtCompletion.ts
+++ b/packages/cli/src/ui/hooks/useAtCompletion.ts
@@ -194,7 +194,7 @@ export function useAtCompletion(props: UseAtCompletionProps): void {
slowSearchTimer.current = setTimeout(() => {
dispatch({ type: 'SET_LOADING', payload: true });
- }, 100);
+ }, 200);
try {
const results = await fileSearch.current.search(state.pattern, {