Skip to content

Commit c4c38ec

Browse files
aaanhMatthewKhouzam
authored andcommitted
Remove custom reset zoom logic and UI for flame graph due to regression from refactoring. No fix yet.
1 parent 77eebb1 commit c4c38ec

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

packages/react-components/src/components/gantt-chart-output-component.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ export class GanttChartOutputComponent extends AbstractGanttOutputComponent<
6363
// TODO Show header, when we can have entries in-line with timeline-chart
6464
return (
6565
<>
66-
<div className="zoom-reset-button-container">
67-
<button className="item zoom-reset-button" onClick={this.handleResetZoom} aria-label="reset zoom">
68-
<i className="codicon codicon-arrow-both" /> Reset Zoom
69-
</button>
70-
</div>
7166
<div
7267
ref={this.chartTreeRef}
7368
className="scrollable"
@@ -122,20 +117,4 @@ export class GanttChartOutputComponent extends AbstractGanttOutputComponent<
122117
</>
123118
);
124119
}
125-
126-
private handleResetZoom = () => {
127-
// Reset the view range to the initial global view range snapshot
128-
const initial = this.initialViewRangeSnapshot || this.props.unitController.viewRange;
129-
this.props.unitController.viewRange = {
130-
start: initial.start,
131-
end: initial.end
132-
};
133-
if (this.chartLayer) {
134-
this.chartLayer.update();
135-
}
136-
this.setState(prev => ({ zoomResetCounter: (prev.zoomResetCounter ?? 0) + 1 }));
137-
if (this.props.onResetZoom) {
138-
this.props.onResetZoom();
139-
}
140-
};
141120
}

packages/react-components/src/components/trace-context-component.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export interface TraceContextState {
5959
backgroundTheme: string;
6060
pinnedView: OutputDescriptor | undefined;
6161
ganttChartRanges?: Record<string, { start: bigint; end: bigint }>;
62-
ganttChartResetZoomKey?: number;
6362
}
6463

6564
export interface PersistedState {
@@ -184,8 +183,7 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
184183
lineColor: this.props.backgroundTheme === 'light' ? 0x757575 : 0xbbbbbb
185184
},
186185
backgroundTheme: this.props.backgroundTheme,
187-
ganttChartRanges: {},
188-
ganttChartResetZoomKey: 0
186+
ganttChartRanges: {}
189187
};
190188
const absoluteRange = traceRange.getDuration();
191189
const offset = viewRange.getOffset();
@@ -837,7 +835,6 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
837835
addWidgetResizeHandler={this.addWidgetResizeHandler}
838836
removeWidgetResizeHandler={this.removeWidgetResizeHandler}
839837
className={this.state.pinnedView?.id === output.id ? 'pinned-view-shadow' : ''}
840-
onResetZoom={this.handleGanttChartResetZoom}
841838
>
842839
<div
843840
style={{
@@ -848,7 +845,6 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
848845
}}
849846
>
850847
<TimeAxisComponent
851-
key={this.state.ganttChartResetZoomKey}
852848
unitController={ganttChartUnitController}
853849
style={{ ...this.state.style, width: chartWidth, verticalAlign: 'bottom' }}
854850
addWidgetResizeHandler={this.addWidgetResizeHandler}
@@ -1045,8 +1041,4 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
10451041
}
10461042
}));
10471043
};
1048-
1049-
private handleGanttChartResetZoom = () => {
1050-
this.setState(prev => ({ ganttChartResetZoomKey: (prev.ganttChartResetZoomKey ?? 0) + 1 }));
1051-
};
10521044
}

0 commit comments

Comments
 (0)