-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[OPIK-2983] [FE] Fix aggregation change triggering unwanted sort #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[OPIK-2983] [FE] Fix aggregation change triggering unwanted sort #4082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where clicking aggregation type dropdowns (p50/p90/p99 or avg/sum) in table column headers was unintentionally triggering column sorting. The fix adds event propagation stopping to the statistics section wrapper, preventing click events from bubbling up to the parent sort handler.
Key Changes:
- Added
stopPropagation()to statistics section click handler to prevent unwanted sort triggering - Preserves normal column sorting when clicking header text outside the dropdown
|
❌ Test environment deployment failed The deployment encountered an error. Please check the deployment logs for details. |
1 similar comment
|
❌ Test environment deployment failed The deployment encountered an error. Please check the deployment logs for details. |
|
❌ Test environment deployment failed The deployment encountered an error. Please check the deployment logs for details. |
1 similar comment
|
❌ Test environment deployment failed The deployment encountered an error. Please check the deployment logs for details. |
Details
Screen.Recording.2025-11-16.at.17.01.51.mov
Fixed a bug where changing the aggregation type (p50/p90/p99 or avg/sum) in table column headers was unintentionally triggering column sorting.
Root Cause: Click events from the
HeaderStatisticdropdown component were bubbling up to theHeaderWrapper'sonClickhandler, which is used for sorting.Solution: Added
event.stopPropagation()to the statistics section wrapper inHeaderWrapper.tsxto prevent click events from reaching the parent sort handler while preserving the sorting functionality when clicking on the column header text.Impact: This fix applies to all tables using statistics headers:
Change checklist
Issues
Testing
Manual testing scenarios completed:
Trace table - Duration column:
Cost/Token columns:
Experiments comparison:
Affected components:
HeaderWrapperwith statistics (Traces, Spans, Experiments, Annotation queues)Code changes:
apps/opik-frontend/src/components/shared/DataTableHeaders/HeaderWrapper.tsxonClick={(e) => e.stopPropagation()}to statistics section wrapper (line 58)Documentation
No documentation changes needed - this is a bug fix for existing functionality that restores the intended behavior.