Skip to content

Commit 2ade2ca

Browse files
authored
fix(trace): fix collapsing to minimized value (#69614)
1 parent 5e2cffe commit 2ade2ca

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

static/app/views/performance/newTraceDetails/traceDrawer/traceDrawer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ export function TraceDrawer(props: TraceDrawerProps) {
203203
height: 0,
204204
};
205205

206-
const initialSize =
207-
props.trace_state.preferences.layout === 'drawer bottom'
206+
const initialSize = props.trace_state.preferences.drawer.minimized
207+
? 0
208+
: props.trace_state.preferences.layout === 'drawer bottom'
208209
? height * initialSizeInPercentage
209210
: width * initialSizeInPercentage;
210211

static/app/views/performance/newTraceDetails/traceRenderers/traceVirtualizedList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export const useVirtualizedList = (
217217
scrollContainerRef.current.style.pointerEvents = 'auto';
218218
pointerEventsRaf.current = null;
219219
}
220-
}, 50);
220+
}, 150);
221221
};
222222

223223
props.container.addEventListener('scroll', onScroll, {passive: true});

static/app/views/performance/newTraceDetails/traceRenderers/virtualizedViewManager.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ export class VirtualizedViewManager {
756756
// Holding shift key allows for horizontal scrolling
757757
const distance = event.shiftKey ? event.deltaY : event.deltaX;
758758

759-
if (Math.abs(event.deltaX) !== 0) {
759+
if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
760760
// Prevents firing back/forward navigation
761761
event.preventDefault();
762762
} else {
@@ -1452,23 +1452,30 @@ export class VirtualizedViewManager {
14521452
options.span_list_width;
14531453
this.indicator_container.style.transform = `transform(${-this.scrollbar_width}px, 0)`;
14541454
const new_indicator_container_width = options.span_list_width - correction;
1455+
14551456
if (this.last_indicator_width !== new_indicator_container_width) {
14561457
this.indicator_container.style.width = new_indicator_container_width * 100 + '%';
14571458
this.last_indicator_width = new_indicator_container_width;
14581459
}
14591460
}
14601461

1462+
const dividerPosition =
1463+
Math.round(
1464+
(options.list_width *
1465+
(this.container_physical_space.width - this.scrollbar_width) -
1466+
DIVIDER_WIDTH / 2 -
1467+
1) *
1468+
10
1469+
) / 10;
1470+
1471+
if (this.horizontal_scrollbar_container) {
1472+
this.horizontal_scrollbar_container.style.width =
1473+
(dividerPosition / this.container_physical_space.width) * 100 + '%';
1474+
}
1475+
14611476
if (this.divider) {
14621477
this.divider.style.transform = `translate(
1463-
${
1464-
Math.round(
1465-
(options.list_width *
1466-
(this.container_physical_space.width - this.scrollbar_width) -
1467-
DIVIDER_WIDTH / 2 -
1468-
1) *
1469-
10
1470-
) / 10
1471-
}px, 0)`;
1478+
${dividerPosition}px, 0)`;
14721479
}
14731480
}
14741481
last_list_column_width = 0;

0 commit comments

Comments
 (0)