Skip to content

Commit 884ed16

Browse files
authored
fix(explore): Only shop top events indicator on page 1 (#97915)
The top events indicator only shows the top N results from page 1 and should not be shown on other pages.
1 parent e67649e commit 884ed16

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

static/app/views/explore/queryParams/context.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ export function useQueryParamsAggregateSortBys(): readonly Sort[] {
179179
const queryParams = useQueryParams();
180180
return queryParams.aggregateSortBys;
181181
}
182+
183+
export function useQueryParamsAggregateCursor(): string {
184+
const queryParams = useQueryParams();
185+
return queryParams.aggregateCursor;
186+
}

static/app/views/explore/tables/aggregatesTable.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {IconWarning} from 'sentry/icons/iconWarning';
1414
import {t} from 'sentry/locale';
1515
import type {TagCollection} from 'sentry/types/group';
1616
import {defined} from 'sentry/utils';
17+
import {parseCursor} from 'sentry/utils/cursor';
1718
import {fieldAlignment} from 'sentry/utils/discover/fields';
1819
import {useLocation} from 'sentry/utils/useLocation';
1920
import useProjects from 'sentry/utils/useProjects';
@@ -43,6 +44,7 @@ import {useTraceItemTags} from 'sentry/views/explore/contexts/spanTagsContext';
4344
import type {AggregatesTableResult} from 'sentry/views/explore/hooks/useExploreAggregatesTable';
4445
import {usePaginationAnalytics} from 'sentry/views/explore/hooks/usePaginationAnalytics';
4546
import {TOP_EVENTS_LIMIT, useTopEvents} from 'sentry/views/explore/hooks/useTopEvents';
47+
import {useQueryParamsAggregateCursor} from 'sentry/views/explore/queryParams/context';
4648
import {prettifyAggregation, viewSamplesTarget} from 'sentry/views/explore/utils';
4749

4850
import {FieldRenderer} from './fieldRenderer';
@@ -66,6 +68,7 @@ export function AggregatesTable({aggregatesTableResult}: AggregatesTableProps) {
6668
const sorts = useExploreSortBys();
6769
const setSorts = useSetExploreSortBys();
6870
const query = useExploreQuery();
71+
const cursor = useQueryParamsAggregateCursor();
6972

7073
const visibleAggregateFields = useMemo(
7174
() =>
@@ -204,7 +207,7 @@ export function AggregatesTable({aggregatesTableResult}: AggregatesTableProps) {
204207
return (
205208
<TableRow key={i}>
206209
<TableBodyCell>
207-
{topEvents && i < topEvents && (
210+
{topEvents && i < topEvents && !parseCursor(cursor)?.offset && (
208211
<TopResultsIndicator color={palette[i]!} />
209212
)}
210213
<Tooltip title={t('View Samples')} containerDisplayMode="flex">

0 commit comments

Comments
 (0)