Skip to content

feat(index): show indexing progress during background code indexing#1927

Merged
bug-ops merged 6 commits intomainfrom
show-indexing-progress
Mar 16, 2026
Merged

feat(index): show indexing progress during background code indexing#1927
bug-ops merged 6 commits intomainfrom
show-indexing-progress

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 16, 2026

Closes #1923

Summary

  • Add IndexProgress { files_done, files_total, chunks_created } struct in zeph-index
  • Pass progress via tokio::sync::watch channel as Option<&Sender<IndexProgress>> to index_project()
  • CLI mode: print start/completion messages to stderr (guarded, suppressed in TUI mode)
  • TUI mode: forward_index_progress_to_tui() in tui_bridge.rs feeds AgentEvent::Status — shows Indexing codebase… N/M files (X%), then Index ready (N files, M chunks) for 3s on completion

Changes

  • crates/zeph-index/src/indexer.rsIndexProgress struct, progress sending in loop
  • crates/zeph-index/src/lib.rs — re-export IndexProgress
  • src/agent_setup.rs — watch channel creation, CLI progress messages, cli_mode: bool guard
  • src/runner.rsCodeIndexerSetup extended to 3-tuple, receiver passed to TUI
  • src/tui_bridge.rsforward_index_progress_to_tui() task

Test plan

  • CLI: run with --index flag, verify start + completion messages appear on stderr
  • TUI: run with --tui --index, verify status bar shows progress counter and clears after 3s
  • Empty project (0 files): no messages, no panic
  • Unit tests: 4 new tests in zeph-index (6057 total, all pass)

Add IndexProgress struct to zeph-index with files_done, files_total,
and chunks_created fields. Expose progress via tokio::sync::watch
channel passed as Option<&Sender<IndexProgress>> to index_project().

CLI mode: print start and completion messages to stderr (guarded by
cli_mode flag to avoid output in TUI raw-terminal mode).
TUI mode: forward progress updates via AgentEvent::Status to show
"Indexing codebase… N/M files (X%)" in the status bar; display
completion summary for 3s then clear.

Closes #1923
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes enhancement New feature or request size/M Medium PR (51-200 lines) labels Mar 16, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 16, 2026 19:08
@bug-ops bug-ops merged commit c00e4fd into main Mar 16, 2026
20 checks passed
@bug-ops bug-ops deleted the show-indexing-progress branch March 16, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(index): show indexing progress during background code indexing

1 participant