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

Use gray and italicized text for system frames #51758

Merged
merged 23 commits into from
Jul 18, 2023
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
49 changes: 40 additions & 9 deletions static/app/components/events/interfaces/frame/deprecatedLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ export class DeprecatedLine extends Component<Props, State> {
const {isHoverPreviewed, debugFrames, data, isANR, threadId, lockAddress} =
this.props;
const organization = this.props.organization;
const stacktraceChangesEnabled = !!organization?.features.includes(
'issue-details-stacktrace-improvements'
);
const anrCulprit =
isANR &&
analyzeFrameForRootCause(
Expand All @@ -284,8 +287,14 @@ export class DeprecatedLine extends Component<Props, State> {

return (
<StrictClick onClick={this.isExpandable() ? this.toggleContext : undefined}>
<DefaultLine className="title" data-test-id="title">
<DefaultLineTitleWrapper>
<DefaultLine
className="title"
data-test-id="title"
stacktraceChangesEnabled={stacktraceChangesEnabled}
>
<DefaultLineTitleWrapper
stacktraceChangesEnabled={stacktraceChangesEnabled && !data.inApp}
>
<LeftLineTitle>
<SourceMapWarning frame={data} debugFrames={debugFrames} />
<div>
Expand All @@ -306,7 +315,9 @@ export class DeprecatedLine extends Component<Props, State> {
</SuspectFrameTag>
) : null}
{!data.inApp ? (
<InAppTag>{t('System')}</InAppTag>
stacktraceChangesEnabled ? null : (
<InAppTag>{t('System')}</InAppTag>
)
) : (
<InAppTag type="info">{t('In App')}</InAppTag>
)}
Expand All @@ -332,10 +343,18 @@ export class DeprecatedLine extends Component<Props, State> {

const leadHint = this.renderLeadHint();
const packageStatus = this.packageStatus();
const organization = this.props.organization;
const stacktraceChangesEnabled = !!organization?.features.includes(
'issue-details-stacktrace-improvements'
);

return (
<StrictClick onClick={this.isExpandable() ? this.toggleContext : undefined}>
<DefaultLine className="title as-table" data-test-id="title">
<DefaultLine
className="title as-table"
data-test-id="title"
stacktraceChangesEnabled={stacktraceChangesEnabled}
>
<NativeLineContent isFrameAfterLastNonApp={!!isFrameAfterLastNonApp}>
<PackageInfo>
{leadHint}
Expand Down Expand Up @@ -374,9 +393,16 @@ export class DeprecatedLine extends Component<Props, State> {
isHoverPreviewed={isHoverPreviewed}
/>
</NativeLineContent>
{this.renderExpander()}
<DefaultLineTitleWrapper
stacktraceChangesEnabled={stacktraceChangesEnabled && !data.inApp}
>
{this.renderExpander()}
</DefaultLineTitleWrapper>

{!data.inApp ? (
<InAppTag>{t('System')}</InAppTag>
stacktraceChangesEnabled ? null : (
<InAppTag>{t('System')}</InAppTag>
)
) : (
<InAppTag type="info">{t('In App')}</InAppTag>
)}
Expand Down Expand Up @@ -453,10 +479,12 @@ const RepeatedFrames = styled('div')`
display: inline-block;
`;

const DefaultLineTitleWrapper = styled('div')`
const DefaultLineTitleWrapper = styled('div')<{stacktraceChangesEnabled: boolean}>`
display: flex;
align-items: center;
justify-content: space-between;
color: ${p => (p.stacktraceChangesEnabled ? p.theme.subText : '')};
font-style: ${p => (p.stacktraceChangesEnabled ? 'italic' : '')};
`;

const LeftLineTitle = styled('div')`
Expand Down Expand Up @@ -492,9 +520,12 @@ const NativeLineContent = styled('div')<{isFrameAfterLastNonApp: boolean}>`
}
`;

const DefaultLine = styled('div')`
const DefaultLine = styled('div')<{stacktraceChangesEnabled: boolean}>`
display: grid;
grid-template-columns: 1fr auto ${space(2)}; /* sm icon size */
grid-template-columns: ${p =>
p.stacktraceChangesEnabled
? `1fr auto auto`
: `1fr auto ${space(2)}`}; /* sm icon size */
align-items: center;
`;

Expand Down
28 changes: 23 additions & 5 deletions static/app/components/events/interfaces/nativeFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {space} from 'sentry/styles/space';
import {Frame, PlatformType, SentryAppComponent} from 'sentry/types';
import {Event} from 'sentry/types/event';
import {defined} from 'sentry/utils';
import useOrganization from 'sentry/utils/useOrganization';
import withSentryAppComponents from 'sentry/utils/withSentryAppComponents';

import DebugImage from './debugMeta/debugImage';
Expand Down Expand Up @@ -215,11 +216,19 @@ function NativeFrame({
const addressTooltip = getAddressTooltip();
const functionName = getFunctionName();
const status = getStatus();
const organization = useOrganization();
const stacktraceChangesEnabled = !!organization?.features.includes(
'issue-details-stacktrace-improvements'
);

return (
<StackTraceFrame data-test-id="stack-trace-frame">
<StrictClick onClick={handleToggleContext}>
<RowHeader expandable={expandable} expanded={expanded}>
<RowHeader
expandable={expandable}
expanded={expanded}
stacktraceChangesEnabled={stacktraceChangesEnabled && !frame.inApp}
>
<SymbolicatorIcon>
{status === 'error' ? (
<Tooltip
Expand Down Expand Up @@ -298,10 +307,12 @@ function NativeFrame({
)}
</GroupingCell>
<TypeCell>
{frame.inApp ? (
<Tag type="info">{t('In App')}</Tag>
{!frame.inApp ? (
stacktraceChangesEnabled ? null : (
<Tag>{t('System')}</Tag>
)
) : (
<Tag>{t('System')}</Tag>
<Tag type="info">{t('In App')}</Tag>
)}
</TypeCell>
<ExpandCell>
Expand Down Expand Up @@ -401,14 +412,19 @@ const Package = styled('span')`
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
padding-right: 2px; /* Needed to prevent text cropping with italic font */
`;

const FileName = styled('span')`
color: ${p => p.theme.subText};
border-bottom: 1px dashed ${p => p.theme.border};
`;

const RowHeader = styled('span')<{expandable: boolean; expanded: boolean}>`
const RowHeader = styled('span')<{
expandable: boolean;
expanded: boolean;
stacktraceChangesEnabled: boolean;
}>`
display: grid;
grid-template-columns: repeat(2, auto) 1fr repeat(2, auto) ${space(2)};
grid-template-rows: repeat(2, auto);
Expand All @@ -418,6 +434,8 @@ const RowHeader = styled('span')<{expandable: boolean; expanded: boolean}>`
background-color: ${p => p.theme.bodyBackground};
font-size: ${p => p.theme.codeFontSize};
padding: ${space(1)};
color: ${p => (p.stacktraceChangesEnabled ? p.theme.subText : '')};
font-style: ${p => (p.stacktraceChangesEnabled ? 'italic' : '')};
${p => p.expandable && `cursor: pointer;`};
@media (min-width: ${p => p.theme.breakpoints.small}) {
Expand Down
Loading