Skip to content

Commit

Permalink
Use gray and italicized text for system frames (#51758)
Browse files Browse the repository at this point in the history
Closes #50691 and
#50693

Distinguishes "In App" and "System" frames using gray/italicized text
with no pill for "System".

<img width="1125" alt="Screenshot 2023-07-17 at 4 01 52 PM"
src="https://github.com/getsentry/sentry/assets/22582037/1c6d31df-4b7c-4748-ac36-764fac744987">
<img width="1125" alt="Screenshot 2023-07-17 at 4 01 40 PM"
src="https://github.com/getsentry/sentry/assets/22582037/64efc0ec-5d86-4baf-8887-8f0c80a1a7ca">


### Non-Native stacktrace changes

![Screenshot 2023-06-29 at 10 17 37
AM](https://github.com/getsentry/sentry/assets/22582037/2a76e609-3fc5-489d-af81-8ef1b726d062)
![Screenshot 2023-06-29 at 10 16 38
AM](https://github.com/getsentry/sentry/assets/22582037/417fffd4-3402-4171-91b2-5883ec3ecc50)
  • Loading branch information
Julia Hoge committed Jul 18, 2023
1 parent 7aa790c commit 25f0725
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 14 deletions.
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

0 comments on commit 25f0725

Please sign in to comment.