Skip to content

fix: Timeline filters don't apply to tooltips#77

Merged
traplol merged 2 commits intomainfrom
agent/issue-67
Mar 21, 2026
Merged

fix: Timeline filters don't apply to tooltips#77
traplol merged 2 commits intomainfrom
agent/issue-67

Conversation

@traplol
Copy link
Copy Markdown
Owner

@traplol traplol commented Mar 21, 2026

Summary

  • Apply category filters to timeline hit-testing so that hidden events no longer show tooltips or respond to clicks
  • Extract select_best_candidate() as a public static method on TimelineView for testability
  • Add 7 unit tests covering category filtering, end-event skipping, depth matching, time range, and empty candidates

Details

When a category filter was turned off, the rendering loop correctly skipped hidden events, but the hit_test() function still matched them — causing phantom tooltips to appear on hover. The fix adds the same hidden_cats check to the candidate selection logic inside hit_test().

To make this testable without ImGui state, the inner candidate filtering loop was extracted into TimelineView::select_best_candidate(), a pure function that takes candidates, events, hidden categories, depth, time, and tolerance, and returns the best matching event index.

Closes #67

Test plan

  • HiddenCategoryFilteredOut — hidden category event skipped, visible one selected
  • AllCandidatesHiddenReturnsNone — returns -1 when all candidates hidden
  • NoCategoryFilterSelectsShortest — without filters, shortest duration wins
  • EndEventsSkipped — end events always excluded
  • WrongDepthSkipped — depth mismatch excluded
  • OutOfTimeRangeSkipped — out-of-range excluded
  • EmptyCandidatesReturnsNone — empty input returns -1

🤖 Generated with Claude Code

Mick and others added 2 commits March 21, 2026 13:20
Skip events with hidden categories in hit_test() so tooltips and
click-selection no longer trigger on filtered-out events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract select_best_candidate() from hit_test() as a public static
method so the candidate filtering logic (hidden categories, end events,
depth, time range) is directly testable without ImGui state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@traplol traplol merged commit 8585194 into main Mar 21, 2026
3 checks passed
@traplol traplol deleted the agent/issue-67 branch March 21, 2026 17:35
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.

Timeline - Filters don't apply to tooltips.

1 participant