fix(watcher): show "Indexing" in TUI during rebuilds + rebuild symbols on branch switch - #169
Merged
Merged
Conversation
The FSW text-batch flush called process_batch_with_stores without ever signalling the IndexingStatusCallback, so ordinary file edits — the most common watcher activity — never surfaced in the TUI status column. Only branch changes and symbol rebuilds toggled the indicator. This contradicted the IndexingStatusCallback doc, which claims it fires on "batch flushes". Wrap the batch flush in indexing_cb(true/false) so normal text reindexes are visible. Also add a per-repo label (derived from the repo directory name, which equals the serve alias) to the watcher's batch-flush and branch-change log lines for multi-repo attribution. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The watcher-triggered C# symbol rebuild toggled the general repo-state label (via indexing_cb → active_reindexes) but the CSharpRebuildNotifier could only report a terminal Ready/Error state, so the C#-specific TUI indicator never showed "Indexing" while the (35–84s) rebuild was actually running — unlike the serve-side trigger_symbol_rebuild path, which sets CSharpIndexStatus::Indexing. Refactor the notifier from a two-argument (success, error) callback to a three-state SymbolRebuildSignal (Started / Succeeded / Failed). The watcher now emits Started just before the rebuild runs, so make_csharp_notifier flips the indicator to Indexing and back to Ready/Error on completion. Also add the per-repo label to all C# symbol-rebuild log lines (skip, grouped and ungrouped-fallback paths) and refresh two stale callback doc comments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On a git branch change the watcher refreshed only the text/vector index; it then discarded the buffered .cs/.ts events and performed NO symbol rebuild. As a result find_impact kept serving references from the previous branch until the next incidental .cs edit (or a serve restart) triggered a debounce rebuild. Add a fire-and-forget FULL symbol rebuild (spawn_branch_change_symbol_rebuild) after the branch-change text refresh, for every applicable + available language (C# and TypeScript). Full scope is correct here: a branch switch rewrites arbitrary files, so no incremental scope can be computed. The rebuild runs in a detached blocking task so the watcher loop is never blocked by the scip helper. It toggles the general "Indexing" TUI label (indexing_cb) and, for C#, the CSharpIndexStatus indicator (Started/Succeeded/Failed); non-applicable repos and unavailable helpers are skipped without touching status. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…lds) Addresses the Stage 3 review remark: the "run a Full symbol rebuild, log the outcome, emit the terminal SymbolRebuildSignal" block was duplicated across the new branch-change helper (C# + TypeScript) and the .cs debounce full-solution fallback. Extract it into IndexManager::run_full_rebuild_logged so the log wording and notifier semantics live in one place. Callers still own the in-progress signalling (indexing_cb + the C# Started signal) since one caller can batch several rebuilds under a single "Indexing" window. No behavior change. cargo fmt/check/clippy clean; 609 lib tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…uild_logged Closes the re-review remark: the TypeScript .ts/.tsx debounce full rebuild was the last remaining hand-rolled copy of the "Full rebuild + log outcome" block. Route it through IndexManager::run_full_rebuild_logged (notifier=None, since the TS path has no serve-side status notifier yet), leaving a single source of truth for all full-rebuild log paths. Also adds the [repo_label] prefix to the .ts trigger and skip log lines for multi-repo attribution consistency. No behavior change. cargo fmt/check/clippy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related watcher/TUI-visibility fixes + a small DRY refactor:
find_impactstaleness when the watcher's git branch moves: the symbol index is now rebuilt sofind_impactstops returning pre-switch results.run_full_rebuild_logged()(DRY) and route the.tsdebounce rebuild path through it.Files
src/index/manager.rs,src/index/mod.rs,src/serve/mod.rs,CHANGELOG.md,docs/watcher-reindex-tui-visibility/worklog.mdValidation
cargo fmt --all -- --check✅cargo check --all-targets✅ (19s)cargo clippy --all-targets -- -D warnings✅ (no issues)Notes