Skip to content

Commit b4d6bee

Browse files
authored
fix(tracemetrics): Update split panel to use different ratio for nav open state (#103297)
Always tries to show all of the telemetry icons on the right panel in the default split, not the minimum right side width.
1 parent 1596475 commit b4d6bee

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

static/app/views/explore/metrics/metricInfoTabs/metricsSamplesTable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const TWO_MINUTE_DELAY = 120;
3232
const MAX_TELEMETRY_WIDTH = 40;
3333

3434
export const SAMPLES_PANEL_MIN_WIDTH = 350;
35+
export const WIDTH_WITH_TELEMETRY_ICONS_VISIBLE =
36+
SAMPLES_PANEL_MIN_WIDTH + MAX_TELEMETRY_WIDTH * 3;
3537

3638
interface MetricsSamplesTableProps {
3739
embedded?: boolean;

static/app/views/explore/metrics/metricPanel/sideBySideOrientation.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ import type {useMetricTimeseries} from 'sentry/views/explore/metrics/hooks/useMe
88
import type {TableOrientation} from 'sentry/views/explore/metrics/hooks/useOrientationControl';
99
import {MetricsGraph} from 'sentry/views/explore/metrics/metricGraph';
1010
import MetricInfoTabs from 'sentry/views/explore/metrics/metricInfoTabs';
11-
import {SAMPLES_PANEL_MIN_WIDTH} from 'sentry/views/explore/metrics/metricInfoTabs/metricsSamplesTable';
11+
import {
12+
SAMPLES_PANEL_MIN_WIDTH,
13+
WIDTH_WITH_TELEMETRY_ICONS_VISIBLE,
14+
} from 'sentry/views/explore/metrics/metricInfoTabs/metricsSamplesTable';
1215
import {HideContentButton} from 'sentry/views/explore/metrics/metricPanel/hideContentButton';
1316
import {PanelPositionSelector} from 'sentry/views/explore/metrics/metricPanel/panelPositionSelector';
1417
import type {TraceMetric} from 'sentry/views/explore/metrics/metricQuery';
1518

1619
const MIN_LEFT_WIDTH = 400;
1720

1821
// Defined by the size of the expected samples tab component
19-
const PADDING_SIZE = 16;
22+
const PADDING_SIZE = 20;
23+
const DIVIDER_WIDTH = 16;
2024
const MIN_RIGHT_WIDTH = SAMPLES_PANEL_MIN_WIDTH + PADDING_SIZE;
2125

2226
export function SideBySideOrientation({
@@ -42,11 +46,11 @@ export function SideBySideOrientation({
4246
const {width} = useDimensions({elementRef: measureRef});
4347

4448
const hasSize = width > 0;
45-
// Default split is 65% of the available width, but not less than MIN_LEFT_WIDTH
46-
// and at most the maximum size allowed for the left panel (i.e. width - MIN_RIGHT_WIDTH)
49+
// Default split is 65% of the available width but not less than MIN_LEFT_WIDTH
50+
// while also accommodating the desired right panel width to show all of the telemetry icons.
4751
const defaultSplit = Math.min(
4852
Math.max(width * 0.65, MIN_LEFT_WIDTH),
49-
width - MIN_RIGHT_WIDTH
53+
width - (WIDTH_WITH_TELEMETRY_ICONS_VISIBLE + PADDING_SIZE + DIVIDER_WIDTH)
5054
);
5155

5256
const additionalActions = (

0 commit comments

Comments
 (0)