Skip to content

Commit 3d569f3

Browse files
authored
feat: Keep profile spans collapsed (#737)
This helps with crazy rendering times with deep profile trees
1 parent d3a2f0a commit 3d569f3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.changeset/big-cheetahs-change.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@spotlightjs/spotlight': minor
3+
'@spotlightjs/electron': minor
4+
'@spotlightjs/overlay': minor
5+
'@spotlightjs/astro': minor
6+
---
7+
8+
feat: Keep profile spans collapsed

packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanItem.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ const SpanItem = ({
3333
const containerRef = useRef<HTMLLIElement>(null);
3434
const childrenCount = span.children ? span.children.length : 0;
3535
const [isItemCollapsed, setIsItemCollapsed] = useState(
36-
((span.transaction && totalTransactions > 1) || depth >= 10 || childrenCount > 10) && depth !== 1,
36+
((span.transaction && totalTransactions > 1) ||
37+
depth >= 10 ||
38+
childrenCount > 10 ||
39+
span.tags?.source === 'profile') &&
40+
depth !== 1,
3741
);
3842
const [isResizing, setIsResizing] = useState(false);
3943

0 commit comments

Comments
 (0)