Skip to content
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

feat(replays): add scroll breadcrumb #84142

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions static/app/utils/replays/getFrameDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import type {
NavFrame,
RawBreadcrumbFrame,
ReplayFrame,
ScrollFrame,
SlowClickFrame,
SwipeFrame,
TapFrame,
Expand Down Expand Up @@ -211,6 +212,13 @@ const MAPPER_FOR_FRAME: Record<string, (frame: any) => Details> = {
title: 'User Swipe',
icon: <IconTap size="xs" />,
}),
'ui.scroll': (frame: ScrollFrame) => ({
color: 'blue400',
description: frame.data,
tabKey: TabKey.BREADCRUMBS,
title: 'User Scroll',
icon: <IconTap size="xs" />,
}),
'ui.tap': (frame: TapFrame) => ({
color: 'purple400',
description: frame.message,
Expand Down
4 changes: 3 additions & 1 deletion static/app/utils/replays/replayReader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,9 @@ export default class ReplayReader {
const crumbs = removeDuplicateClicks(
this._sortedBreadcrumbFrames.filter(
frame =>
['navigation', 'ui.click', 'ui.tap', 'ui.swipe'].includes(frame.category) ||
['navigation', 'ui.click', 'ui.tap', 'ui.swipe', 'ui.scroll'].includes(
frame.category
) ||
(frame.category === 'ui.slowClickDetected' &&
(isDeadClick(frame as SlowClickFrame) ||
isDeadRageClick(frame as SlowClickFrame)))
Expand Down
9 changes: 9 additions & 0 deletions static/app/utils/replays/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ type MobileBreadcrumbTypes =
type: string;
message?: string;
}
| {
category: 'ui.scroll';
data: any;
timestamp: number;
type: string;
message?: string;
}
| {
category: 'device.battery';
data: {charging: boolean; level: number};
Expand Down Expand Up @@ -366,6 +373,7 @@ export type BlurFrame = HydratedBreadcrumb<'ui.blur'>;
export type ClickFrame = HydratedBreadcrumb<'ui.click'>;
export type TapFrame = HydratedBreadcrumb<'ui.tap'>;
export type SwipeFrame = HydratedBreadcrumb<'ui.swipe'>;
export type ScrollFrame = HydratedBreadcrumb<'ui.scroll'>;
export type ConsoleFrame = HydratedBreadcrumb<'console'>;
export type FocusFrame = HydratedBreadcrumb<'ui.focus'>;
export type InputFrame = HydratedBreadcrumb<'ui.input'>;
Expand Down Expand Up @@ -403,6 +411,7 @@ export const BreadcrumbCategories = [
'ui.click',
'ui.tap',
'ui.swipe',
'ui.scroll',
'ui.focus',
'ui.input',
'ui.keyDown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const TYPE_TO_LABEL: Record<string, string> = {
input: 'Input',
tap: 'User Tap',
swipe: 'User Swipe',
scroll: 'User Scroll',
device: 'Device',
app: 'App',
custom: 'Custom',
Expand All @@ -77,6 +78,7 @@ const OPORCATEGORY_TO_TYPE: Record<string, keyof typeof TYPE_TO_LABEL> = {
'ui.click': 'click',
'ui.tap': 'tap',
'ui.swipe': 'swipe',
'ui.scroll': 'scroll',
'ui.keyDown': 'keydown',
'ui.input': 'input',
feedback: 'feedback',
Expand Down
Loading