Skip to content

Commit 1a9bdde

Browse files
malwilleygeorge-sentry
authored andcommitted
ref(issues): Remove streamlined UI from stack trace files (#112242)
1 parent 08b8c66 commit 1a9bdde

10 files changed

Lines changed: 8 additions & 228 deletions

File tree

static/app/components/events/interfaces/crashContent/exception/stackTrace.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type {PlatformKey} from 'sentry/types/project';
1111
import {StackType, StackView} from 'sentry/types/stacktrace';
1212
import {defined} from 'sentry/utils';
1313
import {isNativePlatform} from 'sentry/utils/platform';
14-
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';
1514

1615
type Props = {
1716
chainedException: boolean;
@@ -44,7 +43,6 @@ export function StackTrace({
4443
frameSourceMapDebuggerData,
4544
stackType,
4645
}: Props) {
47-
const hasStreamlinedUI = useHasStreamlinedUI();
4846
if (!defined(stacktrace)) {
4947
return null;
5048
}
@@ -90,7 +88,6 @@ export function StackTrace({
9088
newestFirst={newestFirst}
9189
event={event}
9290
meta={meta}
93-
hideIcon={hasStreamlinedUI}
9491
/>
9592
);
9693
}
@@ -107,7 +104,6 @@ export function StackTrace({
107104
threadId={threadId}
108105
frameSourceMapDebuggerData={frameSourceMapDebuggerData}
109106
hideSourceMapDebugger={stackType === StackType.MINIFIED}
110-
hideIcon={hasStreamlinedUI}
111107
/>
112108
);
113109
}

static/app/components/events/interfaces/crashContent/stackTrace/content.spec.tsx

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {EventFixture} from 'sentry-fixture/event';
22
import {EventEntryStacktraceFixture} from 'sentry-fixture/eventEntryStacktrace';
3-
import {EventStacktraceFrameFixture} from 'sentry-fixture/eventStacktraceFrame';
43
import {GitHubIntegrationFixture} from 'sentry-fixture/githubIntegration';
54
import {OrganizationFixture} from 'sentry-fixture/organization';
65
import {ProjectFixture} from 'sentry-fixture/project';
@@ -63,9 +62,6 @@ describe('StackTrace', () => {
6362
const stackTraceContent = screen.getByTestId('stack-trace-content');
6463
expect(stackTraceContent).toBeInTheDocument();
6564

66-
// platform icon
67-
expect(screen.getByTestId('platform-icon-python')).toBeInTheDocument();
68-
6965
// frame list
7066
const frames = screen.getByTestId('frames');
7167
expect(frames.children).toHaveLength(5);
@@ -453,94 +449,4 @@ describe('StackTrace', () => {
453449
expect(frameTitles[1]).toHaveTextContent('raven/base.py in build_msg at line 303');
454450
});
455451
});
456-
457-
describe('platform icons', () => {
458-
it('uses the top in-app frame file extension for mixed stack trace platforms', () => {
459-
render(
460-
<StackTraceContent
461-
{...defaultProps}
462-
data={{
463-
...data,
464-
frames: [
465-
EventStacktraceFrameFixture({
466-
inApp: true,
467-
filename: 'foo.cs',
468-
}),
469-
EventStacktraceFrameFixture({
470-
inApp: true,
471-
filename: 'foo.py',
472-
}),
473-
EventStacktraceFrameFixture({
474-
inApp: true,
475-
filename: 'foo',
476-
}),
477-
EventStacktraceFrameFixture({
478-
inApp: false,
479-
filename: 'foo.rb',
480-
}),
481-
],
482-
}}
483-
event={event}
484-
/>
485-
);
486-
487-
// foo.py is the most recent in-app frame with a valid file extension
488-
expect(screen.getByTestId('platform-icon-python')).toBeInTheDocument();
489-
});
490-
491-
it('uses frame.platform if file extension does not work', () => {
492-
render(
493-
<StackTraceContent
494-
{...defaultProps}
495-
data={{
496-
...data,
497-
frames: [
498-
EventStacktraceFrameFixture({
499-
inApp: true,
500-
filename: 'foo.cs',
501-
}),
502-
EventStacktraceFrameFixture({
503-
inApp: true,
504-
filename: 'foo',
505-
platform: 'node',
506-
}),
507-
EventStacktraceFrameFixture({
508-
inApp: true,
509-
filename: 'foo',
510-
}),
511-
EventStacktraceFrameFixture({
512-
inApp: false,
513-
filename: 'foo.rb',
514-
}),
515-
],
516-
}}
517-
event={event}
518-
/>
519-
);
520-
521-
expect(screen.getByTestId('platform-icon-node')).toBeInTheDocument();
522-
});
523-
524-
it('falls back to the event platform if there is no other information', () => {
525-
render(
526-
<StackTraceContent
527-
{...defaultProps}
528-
data={{
529-
...data,
530-
frames: [
531-
EventStacktraceFrameFixture({
532-
inApp: true,
533-
filename: 'foo',
534-
platform: null,
535-
}),
536-
],
537-
}}
538-
platform="python"
539-
event={event}
540-
/>
541-
);
542-
543-
expect(screen.getByTestId('platform-icon-python')).toBeInTheDocument();
544-
});
545-
});
546452
});

static/app/components/events/interfaces/crashContent/stackTrace/content.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Fragment, useState} from 'react';
2-
import {css} from '@emotion/react';
32
import styled from '@emotion/styled';
43

54
import type {DeprecatedLineProps} from 'sentry/components/events/interfaces/frame/deprecatedLine';
@@ -9,7 +8,6 @@ import {
98
getHiddenFrameIndices,
109
getLastFrameIndex,
1110
isRepeatedFrame,
12-
stackTracePlatformIcon,
1311
} from 'sentry/components/events/interfaces/utils';
1412
import {Panel} from 'sentry/components/panels/panel';
1513
import type {Event, Frame} from 'sentry/types/event';
@@ -18,7 +16,6 @@ import type {StackTraceMechanism, StacktraceType} from 'sentry/types/stacktrace'
1816
import {defined} from 'sentry/utils';
1917

2018
import {OmittedFrames} from './omittedFrames';
21-
import {StacktracePlatformIcon} from './platformIcon';
2219

2320
type DefaultProps = {
2421
expandFirstFrame: boolean;
@@ -32,7 +29,6 @@ type Props = {
3229
platform: PlatformKey;
3330
className?: string;
3431
frameSourceMapDebuggerData?: FrameSourceMapDebuggerData[];
35-
hideIcon?: boolean;
3632
hideSourceMapDebugger?: boolean;
3733
isHoverPreviewed?: boolean;
3834
lockAddress?: string;
@@ -53,7 +49,6 @@ export function Content({
5349
isHoverPreviewed = false,
5450
maxDepth,
5551
meta,
56-
hideIcon,
5752
threadId,
5853
lockAddress,
5954
frameSourceMapDebuggerData,
@@ -202,15 +197,11 @@ export function Content({
202197
includeSystemFrames ? 'full-traceback' : 'in-app-traceback'
203198
}`;
204199

205-
const platformIcon = stackTracePlatformIcon(platform, data.frames ?? []);
206-
207200
return (
208201
<Wrapper>
209-
{hideIcon ? null : <StacktracePlatformIcon platform={platformIcon} />}
210202
<StackTraceContentPanel
211203
className={wrapperClassName}
212204
data-test-id="stack-trace-content"
213-
hideIcon={hideIcon}
214205
>
215206
<StyledList data-test-id="frames">
216207
{newestFirst ? [...convertedFrames].reverse() : convertedFrames}
@@ -224,18 +215,9 @@ const Wrapper = styled('div')`
224215
position: relative;
225216
`;
226217

227-
export const StackTraceContentPanel = styled(Panel)<{hideIcon?: boolean}>`
218+
export const StackTraceContentPanel = styled(Panel)`
228219
position: relative;
229220
overflow: hidden;
230-
231-
${p =>
232-
!p.hideIcon &&
233-
css`
234-
border-top-left-radius: 0;
235-
@media (max-width: ${p.theme.breakpoints.md}) {
236-
border-top-left-radius: ${p.theme.radius.md};
237-
}
238-
`}
239221
`;
240222

241223
const StyledList = styled('ul')`

static/app/components/events/interfaces/crashContent/stackTrace/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type {PlatformKey} from 'sentry/types/project';
66
import type {StacktraceType} from 'sentry/types/stacktrace';
77
import {StackView} from 'sentry/types/stacktrace';
88
import {isNativePlatform} from 'sentry/utils/platform';
9-
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';
109

1110
import {Content} from './content';
1211
import {NativeContent} from './nativeContent';
@@ -39,7 +38,6 @@ export function StackTraceContent({
3938
threadId,
4039
lockAddress,
4140
}: Props) {
42-
const hasStreamlinedUI = useHasStreamlinedUI();
4341
if (stackView === StackView.RAW) {
4442
return (
4543
<ErrorBoundary mini>
@@ -62,7 +60,6 @@ export function StackTraceContent({
6260
groupingCurrentLevel={groupingCurrentLevel}
6361
meta={meta}
6462
inlined={inlined}
65-
hideIcon={inlined || hasStreamlinedUI}
6663
maxDepth={maxDepth}
6764
/>
6865
</ErrorBoundary>
@@ -79,7 +76,6 @@ export function StackTraceContent({
7976
event={event}
8077
newestFirst={newestFirst}
8178
meta={meta}
82-
hideIcon={inlined || hasStreamlinedUI}
8379
inlined={inlined}
8480
maxDepth={maxDepth}
8581
threadId={threadId}

static/app/components/events/interfaces/crashContent/stackTrace/nativeContent.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
getLastFrameIndex,
99
isRepeatedFrame,
1010
parseAddress,
11-
stackTracePlatformIcon,
1211
} from 'sentry/components/events/interfaces/utils';
1312
import {Panel} from 'sentry/components/panels/panel';
1413
import type {Event, Frame} from 'sentry/types/event';
@@ -18,7 +17,6 @@ import type {StacktraceType} from 'sentry/types/stacktrace';
1817
import {defined} from 'sentry/utils';
1918

2019
import {OmittedFrames} from './omittedFrames';
21-
import {StacktracePlatformIcon} from './platformIcon';
2220

2321
function isFrameUsedForGrouping(
2422
frame: Frame,
@@ -40,7 +38,6 @@ type Props = {
4038
platform: PlatformKey;
4139
className?: string;
4240
groupingCurrentLevel?: Group['metadata']['current_level'];
43-
hideIcon?: boolean;
4441
includeSystemFrames?: boolean;
4542
inlined?: boolean;
4643
isHoverPreviewed?: boolean;
@@ -56,7 +53,6 @@ export function NativeContent({
5653
newestFirst,
5754
isHoverPreviewed,
5855
inlined,
59-
hideIcon,
6056
groupingCurrentLevel,
6157
includeSystemFrames = true,
6258
maxDepth,
@@ -241,15 +237,9 @@ export function NativeContent({
241237

242238
return (
243239
<Wrapper>
244-
{hideIcon ? null : (
245-
<StacktracePlatformIcon
246-
platform={stackTracePlatformIcon(platform, data.frames ?? [])}
247-
/>
248-
)}
249240
<ContentPanel
250241
className={wrapperClassName}
251242
data-test-id="native-stack-trace-content"
252-
hideIcon={hideIcon}
253243
>
254244
<Frames data-test-id="stack-trace">{convertedFrames}</Frames>
255245
</ContentPanel>
@@ -261,9 +251,8 @@ const Wrapper = styled('div')`
261251
position: relative;
262252
`;
263253

264-
const ContentPanel = styled(Panel)<{hideIcon?: boolean}>`
254+
const ContentPanel = styled(Panel)`
265255
position: relative;
266-
border-top-left-radius: ${p => (p.hideIcon ? p.theme.radius.md : 0)};
267256
overflow: hidden;
268257
`;
269258

static/app/components/events/interfaces/crashContent/stackTrace/platformIcon.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

static/app/components/events/interfaces/exception.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {EntryType} from 'sentry/types/event';
1010
import type {Group} from 'sentry/types/group';
1111
import type {Project} from 'sentry/types/project';
1212
import {SectionDivider} from 'sentry/views/issueDetails/streamline/foldSection';
13-
import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';
1413

1514
import {ExceptionContent} from './crashContent/exception';
1615
import {NoStackTraceMessage} from './noStackTraceMessage';
@@ -33,8 +32,6 @@ export function Exception({
3332
groupingCurrentLevel,
3433
}: Props) {
3534
const eventHasThreads = !!event.entries.some(entry => entry.type === EntryType.THREADS);
36-
const hasStreamlinedUI = useHasStreamlinedUI();
37-
3835
// in case there are threads in the event data, we don't render the
3936
// exception block. Instead the exception is contained within the
4037
// thread interface.
@@ -106,7 +103,7 @@ export function Exception({
106103
groupingCurrentLevel={groupingCurrentLevel}
107104
meta={meta}
108105
/>
109-
{hasStreamlinedUI && group && (
106+
{group && (
110107
<Fragment>
111108
{data.values && data.values.length > 1 && (
112109
<SectionDivider orientation="horizontal" />

0 commit comments

Comments
 (0)