Fix persistent and disappearing error badges for Inspector#9805
Fix persistent and disappearing error badges for Inspector#9805khanak0509 wants to merge 8 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the ErrorBadgeManager to use a derived-count model for the Inspector, where the badge count is automatically updated based on the number of unread errors. This change removes the need for manual badge count increments and the filterErrors logic in the InspectorController. A concern was raised regarding redundant calls to clearErrorCount remaining in the InspectorController files, which should be removed to maintain code clarity and align with the new error tracking model.
ebc60b7 to
161cb10
Compare
161cb10 to
ecbab42
Compare
ecbab42 to
4b2de64
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the error badge management system to ensure the Inspector's badge count accurately reflects unread errors. It removes manual error filtering and explicit badge increments, implementing an automated update mechanism within ErrorBadgeManager that recalculates unread counts when errors are added or marked as read. Feedback suggests simplifying a redundant conditional check and notes a potential performance bottleneck in the O(N) unread count calculation.
…ger.dart Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
issue #9524
This PR fixes issue #9524 where the Inspector error badge was acting weird — like it kept increasing incorrectly and sometimes disappeared on tab switch. The count was blindly incremented, errors were getting deleted due to aggressive filtering, and the badge was cleared too early.
How I fixed it:
Basically, I made the badge count derived from actual unread errors instead of manually incrementing it, removed the aggressive filtering, and stopped clearing the badge on tab switch — like now it only resets on a fresh connection or Hot Restart.
before
before.mov
after
after.mov
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.