search: async background refresh with notmuch revision check#134
Open
klement wants to merge 2 commits intoakissinger:masterfrom
Open
search: async background refresh with notmuch revision check#134klement wants to merge 2 commits intoakissinger:masterfrom
klement wants to merge 2 commits intoakissinger:masterfrom
Conversation
Use dataChanged for updates and beginRemoveRows for removals instead of beginResetModel/endResetModel, so Qt only repaints the affected row rather than rebuilding the entire view. Eliminates UI stalls on large search results (e.g. 3500 threads). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After each mail sync, check the notmuch database revision via 'notmuch count --lastmod' before doing any work. If the revision is unchanged (no mail arrived), skip all refreshes entirely. When mail does arrive, search panels refresh concurrently in the background via QProcess so the UI thread is never blocked. A _refreshing guard prevents duplicate refreshes; a second call while one is in flight is silently dropped and the in-flight refresh still finalises normally. Tab switches are instant since data is already fresh by the time the user looks. Other panel types (thread, compose) stay on the existing lazy-dirty path and refresh synchronously on next focus. Co-Authored-By: Claude Opus 4.6 <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.
Summary
QProcessso the UI is never blocked during large mailbox scans.Together these changes make periodic sync refreshes nearly invisible to the user in the common case where no new mail arrived.
Test plan