fix: Update type dropdown counts when filters are applied#14
Open
mylee04 wants to merge 3 commits into
Open
Conversation
Implements step-length tracking as suggested by Chip Huyen to measure consecutive tool uses before interruption. This helps users understand how autonomously Claude operates in their projects. Changes: - Add step-length calculation in stats.py tracking consecutive tool-using commands - Create distribution and time-series visualizations in dashboard - Add comprehensive test suite with 8 tests covering all edge cases - Display metrics: average, min, max step-length and distribution The feature shows: - Step-Length Distribution: Bar chart of sequence frequency - Step-Length Over Time: Line chart tracking trends - Tool-specific analysis in backend (for future use) Tests: All 8 tests passing
… tab Previously, the type dropdown always showed total counts from all messages, even when filters were applied. This fix ensures the dropdown counts reflect the actual filtered results. Example: - Before: "Errors Only" filter shows "assistant (1643)" but 0 messages - After: "Errors Only" filter shows "assistant (0)" matching the display Changes: - Add updateTypeFilterCounts() function to recalculate counts - Call after applyFilters() to keep counts in sync - Always use filteredMessages for counting (not allMessages) Note: Tool results appearing in both "user" and "tool result" counts is preserved as it may be intentional behavior.
Same issue as type dropdown - tool counts showed totals instead of filtered counts. Added updateToolFilterCounts() to fix this.
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
Fixed bugs where the type and tool dropdowns in the Messages tab show total counts instead of filtered counts when filters are applied.
The Bugs
The Fix
Added two functions that dynamically update dropdown counts:
updateTypeFilterCounts()- Updates type dropdown based on filtered messagesupdateToolFilterCounts()- Updates tool dropdown based on filtered messagesBoth are called after any filter change to keep counts in sync with displayed messages.
Example
Before:
After:
Note
During testing, I noticed that tool result messages appear in both "user" and "tool result" counts. I preserved this behavior as it may be intentional. Happy to discuss if this should be changed in a separate issue.
Testing
Tested with various filter combinations: