[OPIK-2477] [FE] Add expand/collapse feedback score reasons toggle button
Details
https://github.com/user-attachments/assets/615bc0ff-6edb-4a0b-b3fa-e268d139d134
https://github.com/user-attachments/assets/5042de3e-1bbd-4a6c-885b-37269da6c6bb
Added an "Expand reasons" toggle in the Columns menu to display feedback score reasons inline within the same cell when row size is Medium or Large.
Problem: Currently, the "score reason" field is only visible via hover tooltips, limiting readability and making it difficult to compare reasoning across multiple rows.
Solution: Introduced an "Expand reasons" / "Collapse reasons" toggle button in the Columns menu (next to "Feedback scores" section) that displays reasons inline within feedback score cells. This provides a clean, contextual UX without adding extra columns or cluttering the UI.
Implementation Approach
Contextual Toggle in Columns Menu ✨
- Added "Expand reasons" / "Collapse reasons" button in the Columns menu, next to "Feedback scores"
- When expanded: Score reasons appear inline below the score value in the same cell (when row height is Medium or Large)
- When collapsed: Reasons are only visible via tooltip icons
- Automatically adjusts row height from Small to Medium when expanding (if currently Small)
- Button is only visible when at least one feedback score column is selected
- State persisted in localStorage per table type
Technical Details
Created Components:
-
FeedbackScoreReasonToggle- Reusable toggle button component with visibility logic
Updated Components:
-
FeedbackScoreCell- Displays reasons inline whenshowReasonsis true and row height is Medium/Large -
CompareExperimentsFeedbackScoreCell- Same inline reason display for experiment comparisons -
useExperimentsTableConfig- Manages toggle state and passes it to column sections -
ColumnsButton- Enhanced to support action elements in column sections
Updated Table Pages:
-
ExperimentsPage- Added showReasons state and toggle integration -
TracesSpansTab- Added toggle with automatic row height adjustment -
ThreadsTab- Added toggle with automatic row height adjustment -
TraceQueueItemsTab- Added toggle with automatic row height adjustment -
ThreadQueueItemsTab- Added toggle with automatic row height adjustment -
PromptPage/ExperimentsTab- Integrated with hook's column sections
Features:
- Reasons display inline in the same cell (below score value)
- Multiline support with
line-clamp-3(max 3 lines with ellipsis) -
overflow-hiddenprevents content from spilling into cells below -
break-wordsensures proper text wrapping within cell boundaries - Supports multi-value feedback scores (joins multiple reasons with ", ")
- Only shows toggle when feedback score columns are selected
- Clean UI - toggle is contextual and only appears when relevant
- Consistent behavior across all table types (Experiments, Traces, Threads, Annotation Queues)
Change checklist
- [x] User facing
- [x] Documentation update
Issues
- OPIK-2477
Testing
Manual testing steps:
- Navigate to Experiments/Traces/Threads/Annotation Queue tables
- Ensure at least one feedback score column is visible
- Open the Columns menu and locate the "Expand reasons" button next to "Feedback scores"
- Click "Expand reasons" - verify row height adjusts to Medium if it was Small
- Verify reasons appear inline below score values in Medium/Large rows
- Verify reasons wrap properly within cell boundaries (max 3 lines with ellipsis)
- Verify content doesn't overflow into cells below
- Click "Collapse reasons" - verify reasons return to tooltip-only display
- Hide all feedback score columns - verify toggle button disappears
- Test with multi-value feedback scores (multiple reasons joined with ", ")
- Verify state persists after page refresh
- Test across all table types (Experiments, Traces spans, Threads, Queue items)
Changes:
- Created
FeedbackScoreReasonTogglereusable component with visibility logic - Updated
FeedbackScoreCellandCompareExperimentsFeedbackScoreCellfor inline reason display - Enhanced
ColumnsButtonto support action elements in column sections - Integrated toggle into all relevant table pages
- Added automatic row height adjustment when expanding from Small
- Implemented multiline support with proper overflow constraints
- Verified toggle visibility based on selected score columns
- Tested state persistence in localStorage
Documentation
No documentation changes required - UI is self-explanatory with the contextual toggle in Columns menu.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-543
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-545
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-548
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-560
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-564
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-565
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-566
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.19-4127-merge-572
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.38-4127-merge-620
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.
🔄 Test environment deployment started
Building images for PR #4127...
You can monitor the build progress here.
✅ Test environment is now available!
Access Information
- URL: https://pr-4127.dev.comet.com
- Cluster: comet-ml-development
- Namespace: pr-4127
- Version: 1.9.38-4127-merge-626
- Application logs: View in Grafana
The deployment has completed successfully and the version has been verified.