singularity-forge/packages/pi-tui/src
Tom Boucher f29d54b7e0 fix(tui): prevent freeze when using @ file finder (#1832)
The @ file autocomplete triggered a synchronous native fuzzyFind call
that walks the entire directory tree. On large repos this blocked the
Node.js event loop and froze the TUI.

Three changes fix this:

1. Skip the fuzzy search when the query is empty (bare "@" with nothing
   typed yet) — there is no point walking the full tree with no query.

2. Debounce the initial "@" keystroke instead of firing the search
   synchronously, so rapid typing cancels pending walks and the search
   only runs once the user pauses.

3. Deduplicate consecutive lookups using lastAutocompleteLookupPrefix
   (previously declared but unused) to avoid redundant synchronous
   searches when the prefix hasn't changed.

Fixes #1824

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:55:12 -06:00
..
__tests__ fix(tui): prevent freeze when using @ file finder (#1832) 2026-03-21 12:55:12 -06:00
components fix(tui): prevent freeze when using @ file finder (#1832) 2026-03-21 12:55:12 -06:00
autocomplete.ts fix(tui): prevent freeze when using @ file finder (#1832) 2026-03-21 12:55:12 -06:00
editor-component.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
fuzzy.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
index.ts feat: wire native Rust image module into image processing pipeline 2026-03-13 13:41:53 -06:00
keybindings.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
keys.ts refactor: deduplicate rendering patterns in markdown and keys 2026-03-19 16:39:18 -03:00
kill-ring.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
overlay-layout.ts refactor: extract overlay layout and compositing from TUI into separate module (#1482) 2026-03-19 15:35:00 -06:00
stdin-buffer.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
terminal-image.ts feat: integrate cmux with gsd runtime (#1532) 2026-03-19 20:05:06 -06:00
terminal.ts fix: prevent arrow keys from inserting escape sequences as text (#493) 2026-03-15 17:17:58 -05:00
tui.ts fix(tui,gsd): tool-call loop guard + TUI stack overflow prevention (#1801) 2026-03-21 11:41:37 -06:00
undo-stack.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
utils.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00