Skip to content

Commit c1b7e74

Browse files
fix(replay): sort chapters by start and fix breadcrumb timestamp (#94123)
before: <img width="705" alt="SCR-20250623-mpwo" src="https://github.com/user-attachments/assets/55fda7e9-57e5-4d45-9c89-c7215f28d5cd" /> after: <img width="616" alt="SCR-20250623-mpve" src="https://github.com/user-attachments/assets/b1fcac9f-ce58-428a-885d-1ddfe34912b0" />
1 parent 8689fe5 commit c1b7e74

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

static/app/views/replays/detail/ai/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ function AiContent({replayRecord}: Props) {
119119
);
120120
}
121121

122-
const chapterData = summaryData?.data.time_ranges.map(
123-
({period_title, period_start, period_end}) => ({
122+
const chapterData = summaryData?.data.time_ranges
123+
.map(({period_title, period_start, period_end}) => ({
124124
title: period_title,
125125
start: period_start,
126126
end: period_end,
@@ -132,8 +132,8 @@ function AiContent({replayRecord}: Props) {
132132
breadcrumb.timestampMs >= period_start &&
133133
breadcrumb.timestampMs <= period_end
134134
) ?? [],
135-
})
136-
);
135+
}))
136+
.sort((a, b) => a.start - b.start);
137137

138138
return (
139139
<ErrorBoundary mini>
@@ -176,7 +176,7 @@ function AiContent({replayRecord}: Props) {
176176
onShowSnippet={() => {}}
177177
showSnippet={false}
178178
allowShowSnippet={false}
179-
startTimestampMs={breadcrumb.timestampMs}
179+
startTimestampMs={replay?.getStartTimestampMs() ?? 0}
180180
key={`breadcrumb-${j}`}
181181
style={{}}
182182
/>

0 commit comments

Comments
 (0)