Skip to content

Commit 7c83865

Browse files
authored
chore: fix the split view, reset window on timeline click (#27007)
1 parent d9eabda commit 7c83865

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

packages/trace-viewer/src/ui/timeline.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,10 @@ export const Timeline: React.FunctionComponent<{
182182
const action = model?.actions.findLast(action => action.startTime <= time);
183183
if (action)
184184
onSelected(action);
185-
// Include both, last action as well as the click position.
186-
if (selectedTime && (time < selectedTime.minimum || time > selectedTime.maximum)) {
187-
const minimum = action ? Math.max(Math.min(action.startTime, time), boundaries.minimum) : boundaries.minimum;
188-
const maximum = action ? Math.min(Math.max(action.endTime, time), boundaries.maximum) : boundaries.maximum;
189-
setSelectedTime({ minimum, maximum });
190-
}
185+
setSelectedTime(undefined);
191186
}
192187
setDragWindow(undefined);
193-
}, [boundaries, dragWindow, measure, model, selectedTime, setSelectedTime, onSelected]);
188+
}, [boundaries, dragWindow, measure, model, setSelectedTime, onSelected]);
194189

195190
const onMouseMove = React.useCallback((event: React.MouseEvent) => {
196191
if (!ref.current)

packages/web/src/components/splitView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ export const SplitView: React.FC<SplitViewProps> = ({
4747
let size: number;
4848
if (orientation === 'vertical') {
4949
size = vSize / window.devicePixelRatio;
50-
if (measure && measure.height < vSize)
50+
if (measure && measure.height < size)
5151
size = measure.height - 10;
5252
} else {
5353
size = hSize / window.devicePixelRatio;
54-
if (measure && measure.width < hSize)
54+
if (measure && measure.width < size)
5555
size = measure.width - 10;
5656
}
5757

0 commit comments

Comments
 (0)