Skip to content

Commit 07e60c1

Browse files
authored
feat(issue-details): Make View JSON button more visible (#83145)
this pr makes the view JSON button more visible in the streamlined issue details experience, which addresses a common piece of feedback. design follows what we are doing for the "Processing Error" button in the same section of the page <img width="304" alt="Screenshot 2025-01-09 at 11 15 35 AM" src="https://github.com/user-attachments/assets/c4a94475-8c72-4f45-8ce7-4d0776ed243e" />
1 parent ec7662b commit 07e60c1

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

static/app/views/issueDetails/streamline/eventTitle.tsx

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {Button, LinkButton} from 'sentry/components/button';
66
import DropdownButton from 'sentry/components/dropdownButton';
77
import {DropdownMenu} from 'sentry/components/dropdownMenu';
88
import {useActionableItems} from 'sentry/components/events/interfaces/crashContent/exception/useActionableItems';
9+
import ExternalLink from 'sentry/components/links/externalLink';
910
import {ScrollCarousel} from 'sentry/components/scrollCarousel';
1011
import TimeSince from 'sentry/components/timeSince';
1112
import {IconWarning} from 'sentry/icons';
@@ -88,9 +89,10 @@ export const EventTitle = forwardRef<HTMLDivElement, EventNavigationProps>(
8889
font-weight: ${theme.fontWeightNormal};
8990
`;
9091

92+
const host = organization.links.regionUrl;
93+
const jsonUrl = `${host}/api/0/projects/${organization.slug}/${group.project.slug}/events/${event.id}/json/`;
94+
9195
const downloadJson = () => {
92-
const host = organization.links.regionUrl;
93-
const jsonUrl = `${host}/api/0/projects/${organization.slug}/${group.project.slug}/events/${event.id}/json/`;
9496
window.open(jsonUrl);
9597
trackAnalytics('issue_details.event_json_clicked', {
9698
organization,
@@ -156,6 +158,7 @@ export const EventTitle = forwardRef<HTMLDivElement, EventNavigationProps>(
156158
key: 'view-json',
157159
label: t('View JSON'),
158160
onAction: downloadJson,
161+
className: 'hidden-sm hidden-md hidden-lg',
159162
},
160163
]}
161164
/>
@@ -166,6 +169,21 @@ export const EventTitle = forwardRef<HTMLDivElement, EventNavigationProps>(
166169
css={grayText}
167170
aria-label={t('Event timestamp')}
168171
/>
172+
<JsonLinkWrapper className="hidden-xs">
173+
<Divider />
174+
<JsonLink
175+
href={jsonUrl}
176+
onClick={() =>
177+
trackAnalytics('issue_details.event_json_clicked', {
178+
organization,
179+
group_id: parseInt(`${event.groupID}`, 10),
180+
streamline: true,
181+
})
182+
}
183+
>
184+
{t('JSON')}
185+
</JsonLink>
186+
</JsonLinkWrapper>
169187
{hasEventError && (
170188
<Fragment>
171189
<Divider />
@@ -299,3 +317,18 @@ const ProcessingErrorButton = styled(Button)`
299317
color: ${p => p.theme.red300};
300318
}
301319
`;
320+
321+
const JsonLinkWrapper = styled('div')`
322+
display: flex;
323+
gap: ${space(0.5)};
324+
`;
325+
326+
const JsonLink = styled(ExternalLink)`
327+
color: ${p => p.theme.gray300};
328+
text-decoration: underline;
329+
text-decoration-color: ${p => p.theme.translucentGray200};
330+
331+
:hover {
332+
color: ${p => p.theme.gray300};
333+
}
334+
`;

0 commit comments

Comments
 (0)