Skip to content

Commit f6e84ff

Browse files
feat(compare queries): tightened padding, added tooltips, and fixed panel heights (#86227)
**Before:** ![Screenshot 2025-03-03 at 12 11 29 PM](https://github.com/user-attachments/assets/43021634-8e0a-474c-88cf-46c921abf458) **After:** ![Screenshot 2025-03-03 at 12 11 36 PM](https://github.com/user-attachments/assets/49fde52a-eec9-4698-ab74-342135737555) --------- Co-authored-by: Shruthi <[email protected]>
1 parent 505f496 commit f6e84ff

File tree

10 files changed

+31
-28
lines changed

10 files changed

+31
-28
lines changed

static/app/views/explore/multiQueryMode/components/miniTable.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const Table = React.forwardRef<HTMLTableElement, TableProps>(
2222

2323
const _TableWrapper = styled(Body)`
2424
overflow-x: hidden;
25+
margin: 0;
2526
`;
2627

2728
const _Table = styled(Grid)<{height?: string | number; scrollable?: boolean}>`

static/app/views/explore/multiQueryMode/content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ export function MultiQueryModeContent() {
8181
}
8282

8383
const StyledPageFilterBar = styled(PageFilterBar)`
84-
margin-bottom: ${space(2)};
84+
margin-bottom: ${space(1)};
8585
`;

static/app/views/explore/multiQueryMode/queryConstructors/groupBy.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {useMemo} from 'react';
22
import styled from '@emotion/styled';
33

44
import {CompactSelect, type SelectOption} from 'sentry/components/compactSelect';
5+
import {Tooltip} from 'sentry/components/tooltip';
56
import {t} from 'sentry/locale';
67
import {useSpanTags} from 'sentry/views/explore/contexts/spanTagsContext';
78
import {
@@ -46,7 +47,13 @@ export function GroupBySection({query, index}: Props) {
4647
return (
4748
<Section data-test-id={`section-group-by-${index}`}>
4849
<SectionHeader>
49-
<SectionLabel underlined={false}>{t('Group By')}</SectionLabel>
50+
<Tooltip
51+
title={t(
52+
'Aggregate data by a key attribute to calculate averages, percentiles, count and more.'
53+
)}
54+
>
55+
<SectionLabel>{t('Group By')}</SectionLabel>
56+
</Tooltip>
5057
</SectionHeader>
5158
<StyledCompactSelect
5259
multiple

static/app/views/explore/multiQueryMode/queryConstructors/search.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {EAPSpanSearchQueryBuilder} from 'sentry/components/performance/spanSearchQueryBuilder';
2+
import {Tooltip} from 'sentry/components/tooltip';
23
import {t} from 'sentry/locale';
34
import usePageFilters from 'sentry/utils/usePageFilters';
45
import {useSpanTags} from 'sentry/views/explore/contexts/spanTagsContext';
@@ -27,7 +28,9 @@ export function SearchBarSection({query, index}: Props) {
2728
return (
2829
<Section data-test-id={`section-filter-${index}`}>
2930
<SectionHeader>
30-
<SectionLabel underlined={false}>{t('Filter')}</SectionLabel>
31+
<Tooltip title={t('Key attributes you would like to narrow results down to')}>
32+
<SectionLabel>{t('Filter')}</SectionLabel>
33+
</Tooltip>
3134
</SectionHeader>
3235
<EAPSpanSearchQueryBuilder
3336
projects={selection.projects}

static/app/views/explore/multiQueryMode/queryConstructors/sortBy.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export function SortBySection({query, index}: Props) {
5151
<Section data-test-id={`section-sort-by-${index}`}>
5252
<SectionHeader>
5353
<Tooltip
54-
position="right"
5554
title={t('Results you see first and last in your samples or aggregates.')}
5655
>
5756
<SectionLabel>{t('Sort By')}</SectionLabel>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import styled from '@emotion/styled';
22

33
import {space} from 'sentry/styles/space';
4-
import {defined} from 'sentry/utils';
54

6-
export const Section = styled('div')`
7-
margin-bottom: ${space(2)};
8-
`;
5+
export const Section = styled('div')``;
96

107
export const SectionHeader = styled('div')`
118
display: flex;
@@ -15,14 +12,12 @@ export const SectionHeader = styled('div')`
1512
margin-bottom: ${space(0.5)};
1613
`;
1714

18-
export const SectionLabel = styled('h6')<{disabled?: boolean; underlined?: boolean}>`
15+
export const SectionLabel = styled('h6')<{disabled?: boolean}>`
1916
color: ${p => (p.disabled ? p.theme.gray300 : p.theme.gray500)};
2017
height: ${p => p.theme.form.md.height};
2118
min-height: ${p => p.theme.form.md.minHeight};
2219
font-size: ${p => p.theme.form.md.fontSize};
2320
margin: 0;
24-
${p =>
25-
!defined(p.underlined) || p.underlined
26-
? `text-decoration: underline dotted ${p.disabled ? p.theme.gray300 : p.theme.gray300}`
27-
: ''};
21+
text-decoration: underline dotted
22+
${p => (p.disabled ? p.theme.gray300 : p.theme.gray300)};
2823
`;

static/app/views/explore/multiQueryMode/queryConstructors/visualize.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export function VisualizeSection({query, index}: Props) {
4747
<Section data-test-id={`section-visualize-${index}`}>
4848
<SectionHeader>
4949
<Tooltip
50-
position="right"
5150
title={t(
5251
'Primary metric that appears in your chart. You can also overlay a series onto an existing chart or add an equation.'
5352
)}

static/app/views/explore/multiQueryMode/queryRow.tsx

+8-9
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,28 @@ export function QueryRow({query: queryParts, index, totalQueryRows}: Props) {
110110

111111
const QueryConstructionSection = styled('div')`
112112
display: grid;
113-
width: 100%;
113+
gap: ${space(1)};
114+
margin-bottom: ${space(1)};
114115
115116
@media (min-width: ${p => p.theme.breakpoints.large}) {
116117
grid-template-columns: minmax(400px, 1fr) 1fr;
117-
margin-bottom: 0;
118-
gap: ${space(2)};
119118
}
120119
`;
121120

122121
const DropDownGrid = styled('div')`
123122
display: grid;
124123
grid-template-columns: repeat(3, minmax(0, auto)) ${space(2)};
125-
align-items: start;
126-
gap: ${space(2)};
124+
align-items: center;
125+
gap: ${space(1)};
127126
`;
128127

129128
const DeleteButton = styled(Button)`
130-
margin-top: ${space(4)};
129+
margin-top: ${space(2)};
131130
`;
132131

133132
const QueryVisualizationSection = styled('div')`
134133
display: grid;
135-
grid-template-columns: 2fr 1fr;
136-
margin-bottom: ${space(1)};
137-
gap: ${space(2)};
134+
grid-template-columns: 2fr 1.2fr;
135+
gap: ${space(1)};
136+
margin-bottom: ${space(2)};
138137
`;

static/app/views/explore/multiQueryMode/queryVisualizations/table.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ function SpansTable({spansTableResult, query: queryParts, index}: SampleTablePro
317317
const TopResultsIndicator = styled('div')<{index: number}>`
318318
position: absolute;
319319
left: -1px;
320-
width: 9px;
320+
width: 8px;
321321
height: 16px;
322-
border-radius: 0 3px 3px 0;
322+
border-radius: 0 2px 2px 0;
323323
324324
background-color: ${p => {
325325
return CHART_PALETTE[TOP_EVENTS_LIMIT - 1]![p.index];
@@ -331,14 +331,14 @@ const StyledLink = styled(Link)`
331331
`;
332332

333333
const TableBodyCell = styled(GridBodyCell)`
334-
min-height: 30px;
335334
font-size: ${p => p.theme.fontSizeSmall};
335+
min-height: 12px;
336336
`;
337337

338338
const TableHeadCell = styled(GridHeadCell)<{align?: Alignments}>`
339339
${p => p.align && `justify-content: ${p.align};`}
340-
height: 32px;
341340
font-size: ${p => p.theme.fontSizeSmall};
341+
height: 33px;
342342
`;
343343

344344
const TableHeadCellContent = styled('div')`

static/app/views/explore/toolbar/toolbarSaveAs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export function ToolbarSaveAs() {
182182
fields,
183183
sortBys,
184184
})}
185-
>{`${t('Compare')}`}</LinkButton>
185+
>{`${t('Compare Queries')}`}</LinkButton>
186186
)}
187187
</ButtonBar>
188188
</ToolbarSection>

0 commit comments

Comments
 (0)