Skip to content

fix(watcher): show "Indexing" in TUI during rebuilds + rebuild symbols on branch switch - #169

Merged
flupkede merged 7 commits into
developfrom
fix/watcher-reindex-tui-visibility
Jul 29, 2026
Merged

fix(watcher): show "Indexing" in TUI during rebuilds + rebuild symbols on branch switch#169
flupkede merged 7 commits into
developfrom
fix/watcher-reindex-tui-visibility

Conversation

@flupkede

@flupkede flupkede commented Jul 29, 2026

Copy link
Copy Markdown
Owner

What

Two related watcher/TUI-visibility fixes + a small DRY refactor:

  • "Indexing" indicator in TUI during text-batch refresh and during watcher-triggered symbol rebuilds (C# indicator), so the UI no longer looks idle while a rebuild is in flight.
  • Rebuild symbols on branch switch — fixes find_impact staleness when the watcher's git branch moves: the symbol index is now rebuilt so find_impact stops returning pre-switch results.
  • Refactor: extract run_full_rebuild_logged() (DRY) and route the .ts debounce 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.md

Validation

  • cargo fmt --all -- --check
  • cargo check --all-targets ✅ (19s)
  • cargo clippy --all-targets -- -D warnings ✅ (no issues)

Notes

Test User and others added 7 commits July 28, 2026 16:56
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>
@flupkede
flupkede merged commit 130a8a4 into develop Jul 29, 2026
2 checks passed
@flupkede
flupkede deleted the fix/watcher-reindex-tui-visibility branch July 29, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant