Debounce completion index rebuilds for action/command cache updates#896
Merged
multiplex55 merged 2 commits intomasterfrom Feb 19, 2026
Merged
Conversation
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.
Motivation
update_suggestionsbehavior unchanged while ensuring rebuilds are coalesced and only the relevant caches trigger a rebuild.Description
COMPLETION_REBUILD_DEBOUNCEand per-source dirty flagsaction_completion_dirtyandcommand_completion_dirtyonLauncherAppto track which part of the completion index needs rebuilding.update_action_cacheandupdate_command_cacheto mark only their respective dirty flag and callschedule_completion_rebuildinstead of directly runningupdate_completion_index.schedule_completion_rebuild,maybe_rebuild_completion_index, andrebuild_completion_index_nowhelpers to clear stalecompletion_index/suggestions, defer the rebuild for the debounce period, and handle immediate rebuild at startup.maybe_rebuild_completion_indexat the end ofprocess_watch_eventsso bursts ofWatchEvents are coalesced; leaveupdate_suggestionslogic intact once the index is rebuilt.src/gui/mod.rstest module:watch_event_bursts_delay_completion_rebuild_until_debounce_windowandcompletion_suggestions_clear_until_rebuild_and_match_latest_entriesto validate debouncing and suggestion freshness.Testing
cargo fmtwhich completed successfully.cargo test, and specifically exercisedwatch_event_bursts_delay_completion_rebuild_until_debounce_window, but the test run could not complete in this environment because building the dependency graph failed due to a missing system library (alsa.pc) required byalsa-sys(system pkg-config dependency), so tests did not finish here.Codex Task