You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Global search should clear badges as soon as the related search term is deleted or changed #1672
After performing a global search with matches, the search term in the header bar was deleted. The badges remained but there is no longer any information as to what search they refer.
Steps to Reproduce
Perform a global search with matches
Delete the search term
Observe the badges remain
Expected Behavior
The badges should disappear as soon as the search term to which they relate is changed.
changed the title [-]Global search should clear badges as soon as a the related search term is deleted or changed[/-][+]Global search should clear badges as soon as the related search term is deleted or changed[/+]on Nov 10, 2025
Hi @jeremypw , I looked at the code and thought of a naive solution to call FileView.clear_badges() whenever search_entry changes. However, this means we need to maintain a weak reference of sidebar in search_bar and I'm not sure if the coupling between the two widgets is desired.
The alternative solution would be to add a separate dedicated search_bar for the sidebar (or FileView) for searching within the entire project (I can come up with a design for this).
@kahhong Thanks for your suggestions and interest. I think a separate searchbar for the sidebar could be confused with the "fuzzy search" facility for the sidebar that already exists as a plugin. At the moment this is only accessed with a shortcut (Alt + F) but the intention is to bring it into the main code and expose in the sidebar at some point.
SearchBar already has a reference to MainWindow (which has a public reference to sidebar) so no new references are needed I don't think.
Activity
[-]Global search should clear badges as soon as a the related search term is deleted or changed[/-][+]Global search should clear badges as soon as the related search term is deleted or changed[/+]kahhong commentedon Sep 19, 2026
Hi @jeremypw , I looked at the code and thought of a naive solution to call
FileView.clear_badges()wheneversearch_entrychanges. However, this means we need to maintain a weak reference ofsidebarinsearch_barand I'm not sure if the coupling between the two widgets is desired.The alternative solution would be to add a separate dedicated
search_barfor thesidebar(orFileView) for searching within the entire project (I can come up with a design for this).Let me know what you think!
jeremypw commentedon Sep 19, 2026
@kahhong Thanks for your suggestions and interest. I think a separate searchbar for the sidebar could be confused with the "fuzzy search" facility for the sidebar that already exists as a plugin. At the moment this is only accessed with a shortcut (Alt + F) but the intention is to bring it into the main code and expose in the sidebar at some point.
SearchBar already has a reference to MainWindow (which has a public reference to sidebar) so no new references are needed I don't think.
Remove search count badges from sidebar when searched text changes (e…
Fix stale global search result badges (#1822)