Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export function BreadcrumbWebVital({
}

return (
<Flex gap="lg" justify="between" align="start">
<NoMarginWrapper flex="1">
<Flex direction="column" gap="sm" align="start">
<NoMarginWrapper>
<StructuredEventData
initialExpandedPaths={expandPaths ?? []}
onToggleExpand={(expandedPaths, path) => {
Expand Down Expand Up @@ -156,6 +156,7 @@ const SelectorButton = styled(Button)`
`;

const NoMarginWrapper = styled(Flex)`
width: 100%;
pre {
margin: 0;
flex: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {getFrameDetails} from 'sentry/utils/replays/getFrameDetails';
import {useActiveReplayTab} from 'sentry/utils/replays/hooks/useActiveReplayTab';
import {useCrumbHandlers} from 'sentry/utils/replays/hooks/useCrumbHandlers';
import type {ReplayFrame} from 'sentry/utils/replays/types';
import {isWebVitalFrame} from 'sentry/utils/replays/types';
import type {GraphicsVariant} from 'sentry/utils/theme';

const NODE_SIZES = [8, 12, 16];
Expand Down Expand Up @@ -106,14 +107,20 @@ function Event({
</Container>
);

// Web vital frames render an expandable JSON block that needs more room than
// the default tooltip width, otherwise its content wraps to a very tall sliver.
const hasWebVitalFrame = frames.some(isWebVitalFrame);
const tooltipWidth = hasWebVitalFrame ? 400 : 291;
const mobileMaxWidth = hasWebVitalFrame ? 300 : 220;

const overlayStyle = css`
/* We make sure to override existing styles */
padding: ${theme.space.xs} !important;
max-width: 291px !important;
width: 291px;
max-width: ${tooltipWidth}px !important;
width: ${tooltipWidth}px;

@media screen and (max-width: ${theme.breakpoints.sm}) {
max-width: 220px !important;
max-width: ${mobileMaxWidth}px !important;
}
`;

Expand Down
Loading