Skip to content

Commit 74e0902

Browse files
yuvmenclaude
authored andcommitted
fix(issue-details): Preserve page filters when searching issues by tag value (#109102)
The "Search issues with this tag value" and related navigation links in the tag details drawer and event tags tree row dropdown were constructing URLs without carrying over page filter parameters (project, environment, date range) from the current URL. When a user clicked these links, the issues list page would fall back to the default or last-saved project selection instead of staying on the project they were viewing. This uses `extractSelectionParameters(location.query)` to spread global page filter params into the navigation query objects in both `tagDetailsDrawerContent.tsx` and `eventTagsTreeRow.tsx`, matching the pattern already established in `groupTagValues.tsx` and used widely across the codebase for cross-page navigation. Fixes ID-1361 fixes #108799 Co-authored-by: Claude <noreply@anthropic.com>
1 parent b838b97 commit 74e0902

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

static/app/components/events/eventTags/eventTagsTreeRow.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {DropdownMenu, type MenuItemProps} from 'sentry/components/dropdownMenu';
1111
import type {TagTreeContent} from 'sentry/components/events/eventTags/eventTagsTree';
1212
import EventTagsValue from 'sentry/components/events/eventTags/eventTagsValue';
1313
import {AnnotatedTextErrors} from 'sentry/components/events/meta/annotatedText/annotatedTextErrors';
14+
import {extractSelectionParameters} from 'sentry/components/pageFilters/parse';
1415
import Version from 'sentry/components/version';
1516
import VersionHoverCard from 'sentry/components/versionHoverCard';
1617
import {IconEllipsis} from 'sentry/icons';
@@ -154,6 +155,7 @@ function EventTagsTreeRowDropdown({
154155
key: escapeIssueTagKey(originalTag.key),
155156
}
156157
);
158+
const globalSelectionParams = extractSelectionParameters(location.query);
157159

158160
const isProjectAdmin = hasEveryAccess(['project:admin'], {
159161
organization,
@@ -178,7 +180,7 @@ function EventTagsTreeRowDropdown({
178180
hidden: !event.groupID || isFeedback,
179181
to: {
180182
pathname: `/organizations/${organization.slug}/issues/${event.groupID}/events/`,
181-
query,
183+
query: {...globalSelectionParams, ...query},
182184
},
183185
},
184186
{
@@ -187,7 +189,7 @@ function EventTagsTreeRowDropdown({
187189
hidden: isFeedback,
188190
to: {
189191
pathname: `/organizations/${organization.slug}/issues/`,
190-
query,
192+
query: {...globalSelectionParams, ...query},
191193
},
192194
},
193195
{
@@ -196,7 +198,7 @@ function EventTagsTreeRowDropdown({
196198
hidden: !isFeedback,
197199
to: {
198200
pathname: `/organizations/${organization.slug}/feedback/`,
199-
query,
201+
query: {...globalSelectionParams, ...query},
200202
},
201203
},
202204
{

static/app/views/issueDetails/groupTags/tagDetailsDrawerContent.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {DropdownMenu} from 'sentry/components/dropdownMenu';
1515
import {getContextIcon} from 'sentry/components/events/contexts/utils';
1616
import LoadingError from 'sentry/components/loadingError';
1717
import LoadingIndicator from 'sentry/components/loadingIndicator';
18+
import {extractSelectionParameters} from 'sentry/components/pageFilters/parse';
1819
import Pagination from 'sentry/components/pagination';
1920
import TimeSince from 'sentry/components/timeSince';
2021
import {IconArrow, IconEllipsis, IconOpen} from 'sentry/icons';
@@ -275,6 +276,7 @@ function TagValueActionsMenu({
275276
tagValue: TagValue;
276277
}) {
277278
const organization = useOrganization();
279+
const location = useLocation();
278280
const {copy} = useCopyToClipboard();
279281

280282
const referrer = 'tag-details-drawer';
@@ -284,6 +286,7 @@ function TagValueActionsMenu({
284286
query: tagValue.query,
285287
}
286288
: generateQueryWithTag({referrer}, {key, value: tagValue.value});
289+
const globalSelectionParams = extractSelectionParameters(location.query);
287290
const eventView = useIssueDetailsEventView({group, queryProps: query});
288291
const [isVisible, setIsVisible] = useState(false);
289292

@@ -314,15 +317,15 @@ function TagValueActionsMenu({
314317
label: t('View other events with this tag value'),
315318
to: {
316319
pathname: `/organizations/${organization.slug}/issues/${group.id}/events/`,
317-
query,
320+
query: {...globalSelectionParams, ...query},
318321
},
319322
},
320323
{
321324
key: 'view-issues',
322325
label: t('Search issues with this tag value'),
323326
to: {
324327
pathname: `/organizations/${organization.slug}/issues/`,
325-
query,
328+
query: {...globalSelectionParams, ...query},
326329
},
327330
},
328331
{

0 commit comments

Comments
 (0)