Skip to content

perf(tui): Ctrl+P file picker runs a synchronous git status subprocess + 20k-file walk on the event loop #3905

Description

@Hmbown

Problem

Opening the Ctrl+P /files picker blocks the event loop on a git status subprocess plus a full synchronous workspace walk before the picker can even paint.

Evidence

Impact

On large repos, cold page cache, or network filesystems, git status alone can take hundreds of ms to seconds; the walk adds more. The whole TUI freezes — no redraws, no input — between pressing Ctrl+P and the picker appearing. Same failure mode #3899/#3900 fixed for adjacent features.

Proposed approach

Mirror the #3900 pattern: push the picker view immediately in a "Scanning workspace…" loading state, run build_relevance (git status) and collect_candidates on spawn_blocking_supervised, and deliver results through a shared cell the loop drains (like poll_mention_completion).

Acceptance criteria

  • Ctrl+P paints the (loading) picker within one frame regardless of repo size.
  • Results populate asynchronously; picker filtering behavior unchanged (existing file_picker.rs tests pass).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestperformanceRuntime/render performance

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions