fix: Timeline filters don't apply to tooltips#77
Merged
Conversation
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>
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
select_best_candidate()as a public static method onTimelineViewfor testabilityDetails
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 samehidden_catscheck to the candidate selection logic insidehit_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 selectedAllCandidatesHiddenReturnsNone— returns -1 when all candidates hiddenNoCategoryFilterSelectsShortest— without filters, shortest duration winsEndEventsSkipped— end events always excludedWrongDepthSkipped— depth mismatch excludedOutOfTimeRangeSkipped— out-of-range excludedEmptyCandidatesReturnsNone— empty input returns -1🤖 Generated with Claude Code