Skip to content

Conversation

@JetoPistola
Copy link
Contributor

@JetoPistola JetoPistola commented Nov 19, 2025

Details

Screen.Recording.2025-11-26.at.16.50.49.mov
Screen.Recording.2025-11-26.at.16.49.55.mov

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 when showReasons is 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-hidden prevents content from spilling into cells below
  • break-words ensures 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

  • User facing
  • Documentation update

Issues

  • OPIK-2477

Testing

Manual testing steps:

  1. Navigate to Experiments/Traces/Threads/Annotation Queue tables
  2. Ensure at least one feedback score column is visible
  3. Open the Columns menu and locate the "Expand reasons" button next to "Feedback scores"
  4. Click "Expand reasons" - verify row height adjusts to Medium if it was Small
  5. Verify reasons appear inline below score values in Medium/Large rows
  6. Verify reasons wrap properly within cell boundaries (max 3 lines with ellipsis)
  7. Verify content doesn't overflow into cells below
  8. Click "Collapse reasons" - verify reasons return to tooltip-only display
  9. Hide all feedback score columns - verify toggle button disappears
  10. Test with multi-value feedback scores (multiple reasons joined with ", ")
  11. Verify state persists after page refresh
  12. Test across all table types (Experiments, Traces spans, Threads, Queue items)

Changes:

  • Created FeedbackScoreReasonToggle reusable component with visibility logic
  • Updated FeedbackScoreCell and CompareExperimentsFeedbackScoreCell for inline reason display
  • Enhanced ColumnsButton to 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.

@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from f04509f to 85e33d8 Compare November 23, 2025 07:27
- Add single 'Reasons' toggle button in toolbar instead of individual column settings
- Reason columns now controlled by global showReasons state (persisted in localStorage)
- Toggle button appears between row height selector and columns button
- Button highlights when active (default variant) and shows outline when inactive
- Applies to Experiments, Traces, and Threads tables consistently
- Move toggle button from toolbar to Columns menu under Feedback scores section
- Button appears to the right of 'Feedback scores' title
- Button text: 'Expand reasons' / 'Collapse reasons' with MessageSquareText icon
- For Traces/Threads: Auto-switch row height from Small to Medium when expanding
- Updated ColumnsButton to support optional action prop in sections
- Applies to Experiments, Traces, and Threads tables consistently
@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from 8c1b4f8 to 252982f Compare November 26, 2025 10:44
@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from 3c2da70 to 16ea198 Compare November 26, 2025 10:57
@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from 5fa9dab to b753f17 Compare November 26, 2025 14:12
@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from 337e02c to 0b38cb7 Compare November 26, 2025 17:10
@JetoPistola JetoPistola added the test-environment Deploy Opik adhoc environment label Nov 26, 2025
@github-actions
Copy link
Contributor

🔄 Test environment deployment started

Building images for PR #4127...

You can monitor the build progress here.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from 6d10939 to 8df202e Compare November 27, 2025 14:15
@JetoPistola JetoPistola force-pushed the danield/OPIK-2477-add-score-reason-optional-column branch from 192c822 to a452951 Compare November 27, 2025 14:20
@JetoPistola JetoPistola added test-environment Deploy Opik adhoc environment and removed test-environment Deploy Opik adhoc environment labels Nov 27, 2025
@github-actions
Copy link
Contributor

🔄 Test environment deployment started

Building images for PR #4127...

You can monitor the build progress here.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

@JetoPistola JetoPistola added test-environment Deploy Opik adhoc environment and removed test-environment Deploy Opik adhoc environment labels Nov 27, 2025
@github-actions
Copy link
Contributor

🔄 Test environment deployment started

Building images for PR #4127...

You can monitor the build progress here.

@JetoPistola JetoPistola added test-environment Deploy Opik adhoc environment and removed test-environment Deploy Opik adhoc environment labels Nov 27, 2025
@github-actions
Copy link
Contributor

🔄 Test environment deployment started

Building images for PR #4127...

You can monitor the build progress here.

@JetoPistola JetoPistola added test-environment Deploy Opik adhoc environment and removed test-environment Deploy Opik adhoc environment labels Nov 27, 2025
@github-actions
Copy link
Contributor

🔄 Test environment deployment started

Building images for PR #4127...

You can monitor the build progress here.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

…apply flex-wrap and overflow styles based on inline reasons visibility
@JetoPistola JetoPistola added test-environment Deploy Opik adhoc environment and removed test-environment Deploy Opik adhoc environment labels Nov 27, 2025
@github-actions
Copy link
Contributor

🔄 Test environment deployment started

Building images for PR #4127...

You can monitor the build progress here.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend test-environment Deploy Opik adhoc environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants