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(issue-details): Make View JSON button more visible #83145

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Changes from 2 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
35 changes: 29 additions & 6 deletions static/app/views/issueDetails/streamline/eventTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {DropdownMenu} from 'sentry/components/dropdownMenu';
import {useActionableItems} from 'sentry/components/events/interfaces/crashContent/exception/useActionableItems';
import {ScrollCarousel} from 'sentry/components/scrollCarousel';
import TimeSince from 'sentry/components/timeSince';
import {IconWarning} from 'sentry/icons';
import {IconJson, IconWarning} from 'sentry/icons';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {Event} from 'sentry/types/event';
Expand Down Expand Up @@ -152,11 +152,6 @@ export const EventTitle = forwardRef<HTMLDivElement, EventNavigationProps>(
label: t('Copy Event Link'),
onAction: copyLink,
},
{
key: 'view-json',
label: t('View JSON'),
onAction: downloadJson,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill add it back for the small screens where we hide the other button

]}
/>
<StyledTimeSince
Expand All @@ -166,6 +161,17 @@ export const EventTitle = forwardRef<HTMLDivElement, EventNavigationProps>(
css={grayText}
aria-label={t('Event timestamp')}
/>
<JsonButtonWrapper>
<Divider />
<ViewJsonButton
borderless
size="zero"
onClick={downloadJson}
icon={<IconJson />}
>
{t('View JSON')}
</ViewJsonButton>
</JsonButtonWrapper>
{hasEventError && (
<Fragment>
<Divider />
Expand Down Expand Up @@ -299,3 +305,20 @@ const ProcessingErrorButton = styled(Button)`
color: ${p => p.theme.red300};
}
`;

const ViewJsonButton = styled(Button)`
color: ${p => p.theme.subText};
font-weight: ${p => p.theme.fontWeightNormal};
font-size: ${p => p.theme.fontSizeSmall};
`;

const JsonButtonWrapper = styled('div')`
display: flex;
flex-direction: row;
align-items: center;
gap: ${space(1)};

@media (max-width: ${p => p.theme.breakpoints.xsmall}) {
display: none;
}
`;
Loading