StatusBar: fix zero-severity noise, filter consistency, and avoid extra array allocation - #5
Merged
Conversation
…es, single-pass memo Co-authored-by: adamgell <27519+adamgell@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add entry count, position indicator, and severity totals to status bar
StatusBar: fix zero-severity noise, filter consistency, and avoid extra array allocation
Mar 13, 2026
adamgell
marked this pull request as ready for review
March 13, 2026 12:03
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines the log view status bar to make its “entries / position / severities” display consistent with the active filter while reducing work done per update.
Changes:
- Suppresses zero-count severities in
formatSeverityCounts(no more"0 info"noise). - Computes severity totals from the filtered set (matching the filtered entry count/position).
- Replaces the filtered-array materialization with a single-pass aggregation over
entriesto derivefilteredCount,severityCounts, andselectedPosition.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the log status bar to present cleaner severity information and keep counts consistent with the active filter, while reducing unnecessary allocations during rendering.
Changes:
- Hide zero-count severities in
formatSeverityCounts(no more “0 info” noise). - Compute severity totals from the filtered entry set to match the displayed entry count/position.
- Remove the intermediate filtered array allocation by computing
filteredCountand severity totals via iteration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+61
to
+67
| const { filteredCount, severityCounts } = useMemo(() => { | ||
| let errors = 0; | ||
| let warnings = 0; | ||
| let info = 0; | ||
| let counter = 0; | ||
|
|
||
| for (const entry of entries) { |
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.
Three issues in the status bar's severity/position display, flagged in review:
formatSeverityCountsunconditionally appended"0 info". All three severity parts now only emit when> 0.severityCountswas computed from the rawentriesarray while entry count and position used the filtered set, creating an inconsistency (e.g. "0 entries | 3 errors"). Totals now reflect the active filter.displayEntriesmaterialized a full filtered copy ofentrieson every update just to get a count and an index. Replaced with a single-pass loop that computesfilteredCount,severityCounts, andselectedPositiontogether, removing both the intermediate array and the now-redundantcomputeSeverityCountshelper.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.