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
fix: History "N of M" count stays high after a delete #887
Deleting a history entry removes it from the list but leaves matchCount unchanged. The header's "N of M" stays one too high after every delete, until the next load. #828 fixed the same problem for Clear.
Reproduce
Open ?mock=connected and open History.
Note the count.
Delete an entry with its X button.
The list shrinks by one; the count doesn't.
Cause
removeEntry in src/stores/historyStore.ts filters entries but doesn't touch matchCount, or the facet counts that included the entry.
Fix
In removeEntry, decrement matchCount (not below 0) when the removed entry was one of the loaded matches. Also decrement the facet bucket it belonged to, or re-read the facets. Restore both if the backend delete fails, as clearHistory now does. Add a test to src/stores/__tests__/historyStore.test.ts next to the #828 tests.
Activity
fix: update history count and facets on delete