diff --git a/static/app/views/performance/newTraceDetails/trace.tsx b/static/app/views/performance/newTraceDetails/trace.tsx index 08b32113b06f..67a8d3940d20 100644 --- a/static/app/views/performance/newTraceDetails/trace.tsx +++ b/static/app/views/performance/newTraceDetails/trace.tsx @@ -687,7 +687,7 @@ function RenderTraceRow(props: { : TRACE_CHILDREN_COUNT_WRAPPER_CLASSNAME; const listColumnStyle: React.CSSProperties = { - paddingLeft: TraceTree.Depth(node) * props.manager.row_depth_padding, + paddingLeft: TraceTree.depth(node) * props.manager.row_depth_padding, }; const rowProps: TraceRowProps = { diff --git a/static/app/views/performance/newTraceDetails/traceModels/makeExampleTrace.spec.tsx b/static/app/views/performance/newTraceDetails/traceModels/makeExampleTrace.spec.tsx index b44dc5d42186..eec21af789e5 100644 --- a/static/app/views/performance/newTraceDetails/traceModels/makeExampleTrace.spec.tsx +++ b/static/app/views/performance/newTraceDetails/traceModels/makeExampleTrace.spec.tsx @@ -11,7 +11,7 @@ describe('makeExampleTrace', () => { // Root span + its descendants expect(tree.list).toHaveLength(22); - expect(Math.max(...tree.list.map(node => TraceTree.Depth(node)))).toBeGreaterThan(1); + expect(Math.max(...tree.list.map(node => TraceTree.depth(node)))).toBeGreaterThan(1); }); it('makes spans with unique ids so none are dropped as cycles', () => { diff --git a/static/app/views/performance/newTraceDetails/traceModels/traceTree.spec.tsx b/static/app/views/performance/newTraceDetails/traceModels/traceTree.spec.tsx index 4486f33521cc..5249e02b8b6c 100644 --- a/static/app/views/performance/newTraceDetails/traceModels/traceTree.spec.tsx +++ b/static/app/views/performance/newTraceDetails/traceModels/traceTree.spec.tsx @@ -844,11 +844,11 @@ describe('TraceTree', () => { ]); expect(TraceTree.VisibleParent(childTransactionA)).toBe(rootTransaction); expect(TraceTree.VisibleParent(childTransactionB)).toBe(rootTransaction); - expect(TraceTree.Depth(childTransactionA)).toBe( - TraceTree.Depth(rootTransaction) + 1 + expect(TraceTree.depth(childTransactionA)).toBe( + TraceTree.depth(rootTransaction) + 1 ); - expect(TraceTree.Depth(childTransactionB)).toBe( - TraceTree.Depth(rootTransaction) + 1 + expect(TraceTree.depth(childTransactionB)).toBe( + TraceTree.depth(rootTransaction) + 1 ); expect(TraceTree.IsLastVisibleChild(childTransactionA)).toBe(false); expect(TraceTree.IsLastVisibleChild(childTransactionB)).toBe(true); @@ -865,8 +865,8 @@ describe('TraceTree', () => { expect(childTransactionB.parent).toBe(spanB); expect(TraceTree.VisibleParent(childTransactionA)).toBe(spanA); expect(TraceTree.VisibleParent(childTransactionB)).toBe(spanB); - expect(TraceTree.Depth(childTransactionA)).toBe(TraceTree.Depth(spanA) + 1); - expect(TraceTree.Depth(childTransactionB)).toBe(TraceTree.Depth(spanB) + 1); + expect(TraceTree.depth(childTransactionA)).toBe(TraceTree.depth(spanA) + 1); + expect(TraceTree.depth(childTransactionB)).toBe(TraceTree.depth(spanB) + 1); expect(tree.list.slice(rootTransactionIndex, rootTransactionIndex + 5)).toEqual([ rootTransaction, spanA, diff --git a/static/app/views/performance/newTraceDetails/traceModels/traceTree.tsx b/static/app/views/performance/newTraceDetails/traceModels/traceTree.tsx index c235599fcb3b..78cc9d1d09ad 100644 --- a/static/app/views/performance/newTraceDetails/traceModels/traceTree.tsx +++ b/static/app/views/performance/newTraceDetails/traceModels/traceTree.tsx @@ -1198,13 +1198,13 @@ export class TraceTree extends TraceTreeEventDispatcher { * Return a lazily calculated depth of the node in the tree. * Root node has a value of -1 as it is abstract. */ - static Depth(node: BaseNode): number { + static depth(node: BaseNode): number { if (node.depth !== undefined) { return node.depth; } const visibleParent = TraceTree.VisibleParent(node); - node.depth = visibleParent ? TraceTree.Depth(visibleParent) + 1 : 0; + node.depth = visibleParent ? TraceTree.depth(visibleParent) + 1 : 0; return node.depth; } @@ -1251,12 +1251,12 @@ export class TraceTree extends TraceTreeEventDispatcher { let start = TraceTree.VisibleParent(node); if (start?.isRootNodeChild() && !TraceTree.IsLastVisibleChild(node)) { - node.connectors = [-TraceTree.Depth(node)]; + node.connectors = [-TraceTree.depth(node)]; return node.connectors; } if (!TraceTree.IsLastVisibleChild(node)) { - connectors.push(TraceTree.Depth(node)); + connectors.push(TraceTree.depth(node)); } while (start) { @@ -1275,7 +1275,7 @@ export class TraceTree extends TraceTreeEventDispatcher { } connectors.push( - visibleParent.isRootNodeChild() ? -TraceTree.Depth(start) : TraceTree.Depth(start) + visibleParent.isRootNodeChild() ? -TraceTree.depth(start) : TraceTree.depth(start) ); start = visibleParent; } @@ -1513,7 +1513,7 @@ export class TraceTree extends TraceTreeEventDispatcher { function printTraceTreeNode(node: BaseNode, offset: number): string { // +1 because we may be printing from the root which is -1 indexed - const padding = ' '.repeat(TraceTree.Depth(node) + offset); + const padding = ' '.repeat(TraceTree.depth(node) + offset); return padding + node.printNode(); } diff --git a/static/app/views/performance/newTraceDetails/traceRenderers/virtualizedViewManager.tsx b/static/app/views/performance/newTraceDetails/traceRenderers/virtualizedViewManager.tsx index d7d175156eac..4e05a1fc5b37 100644 --- a/static/app/views/performance/newTraceDetails/traceRenderers/virtualizedViewManager.tsx +++ b/static/app/views/performance/newTraceDetails/traceRenderers/virtualizedViewManager.tsx @@ -1101,8 +1101,8 @@ export class VirtualizedViewManager { max = Math.max(max, width); innerMostNode = !innerMostNode || - TraceTree.Depth(this.columns.list.column_nodes[i]!) < - TraceTree.Depth(innerMostNode) + TraceTree.depth(this.columns.list.column_nodes[i]!) < + TraceTree.depth(innerMostNode) ? this.columns.list.column_nodes[i] : innerMostNode; } @@ -1111,7 +1111,7 @@ export class VirtualizedViewManager { if (translation + max < 0) { this.scrollRowIntoViewHorizontally(innerMostNode); } else if ( - translation + TraceTree.Depth(innerMostNode) * this.row_depth_padding > + translation + TraceTree.depth(innerMostNode) * this.row_depth_padding > this.columns.list.width * this.view.trace_container_physical_space.width ) { this.scrollRowIntoViewHorizontally(innerMostNode); @@ -1129,8 +1129,8 @@ export class VirtualizedViewManager { const translation = this.columns.list.translate[0]; return ( - translation + TraceTree.Depth(node) * this.row_depth_padding < 0 || - translation + TraceTree.Depth(node) * this.row_depth_padding > + translation + TraceTree.depth(node) * this.row_depth_padding < 0 || + translation + TraceTree.depth(node) * this.row_depth_padding > (this.columns.list.width * this.view.trace_container_physical_space.width) / 2 ); } @@ -1141,7 +1141,7 @@ export class VirtualizedViewManager { offset_px = 0, position: 'exact' | 'measured' = 'measured' ) { - const depth_px = -TraceTree.Depth(node) * this.row_depth_padding + offset_px; + const depth_px = -TraceTree.depth(node) * this.row_depth_padding + offset_px; const newTransform = position === 'exact' ? depth_px : this.clampRowTransform(depth_px); diff --git a/static/app/views/performance/newTraceDetails/traceRow/traceLoadingRow.tsx b/static/app/views/performance/newTraceDetails/traceRow/traceLoadingRow.tsx index 1fc4668b43c1..64e69954b4bf 100644 --- a/static/app/views/performance/newTraceDetails/traceRow/traceLoadingRow.tsx +++ b/static/app/views/performance/newTraceDetails/traceRow/traceLoadingRow.tsx @@ -42,7 +42,7 @@ export function TraceLoadingRow(props: {