Commit 0432f83
fix: convert all blocking TUI operations to async with loading indicators (#470)
Convert 8 blocking operations in the TUI to async using spawn_blocking
to prevent UI freezing during filesystem and command operations:
- handle_sessions_list: Loading sessions from storage
- handle_ls: Directory listing operations
- handle_tree: Directory tree traversal
- handle_commands_list: Loading available commands
- handle_agents_list: Loading available agents
- handle_config_reload: Reloading configuration from disk
- handle_search: External grep/rg command execution
- handle_export: File write operations (two-phase approach)
Each function now shows a loading indicator during execution and
properly handles errors from the spawned tasks.
The handle_export function uses a two-phase approach:
1. Sync: Generate export content (string formatting, no I/O)
2. Async: Write to file using spawn_blocking
This avoids cloning CortexSession while still making blocking I/O async.
Co-authored-by: Droid Agent <droid@factory.ai>1 parent b22473a commit 0432f83
1 file changed
+329
-143
lines changed
0 commit comments