Skip to content

fix: Update type dropdown counts when filters are applied#14

Open
mylee04 wants to merge 3 commits into
chiphuyen:mainfrom
mylee04:fix/message-filter-type-counts
Open

fix: Update type dropdown counts when filters are applied#14
mylee04 wants to merge 3 commits into
chiphuyen:mainfrom
mylee04:fix/message-filter-type-counts

Conversation

@mylee04

@mylee04 mylee04 commented Jul 27, 2025

Copy link
Copy Markdown

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

  1. Type dropdown: Shows total counts (e.g., "assistant (1643)") even when filtered results have 0 matches
  2. Tool dropdown: Shows total counts (e.g., "Bash (201)") even when filtered messages don't use those tools

The Fix

Added two functions that dynamically update dropdown counts:

  • updateTypeFilterCounts() - Updates type dropdown based on filtered messages
  • updateToolFilterCounts() - Updates tool dropdown based on filtered messages

Both are called after any filter change to keep counts in sync with displayed messages.

Example

Before:

  • Apply "Errors Only" → Type shows "assistant (1643)" → Click it → 0 messages
  • Apply "Errors Only" → Tools shows "Bash (201)" → But errors don't use Bash

After:

  • Apply "Errors Only" → Type shows "assistant (0)" → Matches the display
  • Apply "Errors Only" → Tools shows "Bash (0)" → Correctly reflects no Bash usage in errors

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:

  • ✅ Error filter + type filter
  • ✅ Error filter + tool filter
  • ✅ All filters combined
  • ✅ Search + filters
  • ✅ Clearing filters restores original counts

mylee04 added 3 commits July 26, 2025 17:17
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant