feat(llma): add sentiment bar to session trace rows#49147
feat(llma): add sentiment bar to session trace rows#49147andrewm4894 merged 5 commits intomasterfrom
Conversation
Show a SentimentBar for each trace in the AI session detail view, gated behind the LLM_ANALYTICS_SENTIMENT feature flag. Uses the existing lazy loader logic to batch-load sentiment data.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcc2efc001
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const loading = isTraceLoading(traceId) | ||
|
|
||
| if (cached === undefined && !loading) { | ||
| ensureSentimentLoaded(traceId) |
There was a problem hiding this comment.
Pass session date range when loading trace sentiment
This loader call drops the session’s date bounds, so sentiment requests use the backend default lookback window instead of the active session range. For sessions/traces older than that window, the API returns no result and sentimentByTraceId is set to null, which then prevents later reloads for that trace in this tab because ensureSentimentLoaded only retries when the cache entry is undefined. Please pass the session date range (like the traces table does) when calling ensureSentimentLoaded.
Useful? React with 👍 / 👎.
|
Size Change: +708 B (0%) Total Size: 106 MB ℹ️ View Unchanged
|
Thread traceId through LLMAnalyticsTraceEvents to LLMAnalyticsEventCard so generation events can look up their per-generation sentiment from the lazy loader cache and render a SentimentBar inline.
ConversationDisplay was missing generationEventId and inputSourceIndices, so per-message sentiment bars never rendered on user messages. Add both to match EventContentGeneration.
Visual regression: Storybook UI snapshots updatedChanges: 4 snapshots (4 modified, 0 added, 0 deleted) What this means:
Next steps:
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Problem
The AI session detail view shows traces in a session but lacks sentiment information. Users viewing a session have to navigate to individual trace detail pages to see sentiment data.
Changes
Add a
SentimentBarinline on each trace row in the session detail view, between the cost tag and the "View full trace" link. Uses the existingllmSentimentLazyLoaderLogicwhich automatically batches and debounces sentiment API requests across all visible trace rows.SessionTraceSentimentBarcomponent handles per-trace loading/displayLLM_ANALYTICS_SENTIMENTfeature flagnullwhen no sentiment data is available (no visual noise)How did you test this code?
LazySentimentColumnCellin the traces table column rendererPublish to changelog?
No