-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add AI Summary tab for replay details with feature flag support #93224
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: master
Are you sure you want to change the base?
Conversation
AI Summary Tab Implementation for Replay DetailsOverviewAdded a new "AI Summary" tab to the Replay Details page that is visible only when the Changes Made1. Updated TabKey EnumFile:
2. Updated FocusTabs ComponentFile:
3. Updated FocusArea ComponentFile:
4. Created AISummary ComponentFile:
API Integration DetailsQuery Key Structurefunction createAISummaryQueryKey(orgSlug: string, replayId: string): ApiQueryKey {
return [
`/organizations/${orgSlug}/replays/summary/`,
{
method: 'POST',
data: {
replayId,
},
},
];
} useApiQuery Configurationconst {data, isLoading, isError} = useApiQuery<SummaryResponse>(
createAISummaryQueryKey(organization.slug, replayRecord?.id ?? ''),
{
staleTime: 5 * 60 * 1000, // 5 minutes
enabled: Boolean(replayRecord?.id),
}
); Endpoint
Request Body{
"replayId": "replay-id-here"
} Expected Response{
"summary": "AI-generated summary text here"
} Benefits of useApiQuery Implementation
User Experience
TestingThe implementation includes:
Dependencies
|
2effe11
to
a624275
Compare
interface SummaryResponse { | ||
summary: string; | ||
} |
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.
interface SummaryResponse { | |
summary: string; | |
} | |
interface SummaryResponse { | |
data: { | |
summary: string; | |
time_ranges: Array<{period_end: string; period_start: string; period_title: string}>; | |
title: string; | |
}; | |
} | |
|
||
return ( | ||
<SummaryContainer> | ||
<SummaryText>{summaryData.summary}</SummaryText> |
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.
<SummaryText>{summaryData.summary}</SummaryText> | |
<SummaryText>{summaryData.data.summary}</SummaryText> |
A new "AI Summary" tab was added to the Replay Details page.
TabKey
enum instatic/app/utils/replays/hooks/useActiveReplayTab.tsx
was updated to includeAI_SUMMARY
, and it was added tosupportedVideoTabs
for mobile compatibility.static/app/views/replays/detail/layout/focusTabs.tsx
, thegetReplayTabs
function was modified to conditionally render the "AI Summary" tab based on theorganizations:replay-ai-summaries
feature flag, positioning it before theBreadcrumbs
tab.AISummary
component was created instatic/app/views/replays/detail/aiSummary/index.tsx
. This component:/organizations/{organization_slug}/replays/summary/
on initial load.LoadingIndicator
while the request is in flight.summary
content upon successful completion.static/app/views/replays/detail/layout/focusArea.tsx
file was updated to import and render the newAISummary
component when theAI_SUMMARY
tab is active.Closes REPLAY-388