feat(tui): move search to background worker with deferred filters#55
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 841534350e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !self.semantic_ready() { | ||
| self.run_search(store, engine, None); | ||
| pub fn apply_search_response(&mut self, store: &Store, response: SearchResponse) { | ||
| if response.id != self.active_search_id || response.query != self.query.trim() { |
There was a problem hiding this comment.
Invalidate in-flight searches when applying filters
When filters are applied while a previous search for the same query is still in flight, close_filters updates the active filters but only queues a debounced replacement search; until that new request is sent, this guard still accepts the old response because it only compares request id and query text. That can briefly replace the list with results from the old source/project/time scope under the new filter bar, and a quick Enter can open a session outside the selected filters; invalidate the active request or include the filter snapshot in the staleness check when filters change.
Useful? React with 👍 / 👎.
Signed-off-by: samzong <samzong.lu@gmail.com>
8415343 to
12be17a
Compare
What's changed?
SearchWorkerthat runs text search first, then semantic refinementWhy
Verification
cargo test— 247 tests passed (192 unit, 7 CLI, 5 eval harness, 43 regression)