Skip to content

fix(search): dedupe bare and explicit filter key twins - #121700

Draft
sentry-junior[bot] wants to merge 2 commits into
masterfrom
fix/search-duplicate-pretty-filter-keys
Draft

fix(search): dedupe bare and explicit filter key twins#121700
sentry-junior[bot] wants to merge 2 commits into
masterfrom
fix/search-duplicate-pretty-filter-keys

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Explore search can show the same attribute twice (for example user.email). That happens when both the bare key and the explicit form (tags[user.email,string]) are present. The UI prettifies both labels to the same name, but dedupe only compared raw keys.

Fix

Prefer the bare/canonical key and drop its explicit tags[key,type] twin when both exist.

  • Shared helpers in static/app/utils/tag.ts
  • Key dropdown merge in useSortedFilterKeyItems
  • has values from getHasTag
  • Async has value suggestions in valueCombobox

Distinct typed explicit keys still both show when no bare key exists (for example tags[foo,string] and tags[foo,number]).

Tests

  • Unit coverage for the collapse helpers and getHasTag
  • SearchQueryBuilder cases for static+async bare/explicit twins and typed explicit pairs

Verified with:
pnpm test-ci static/app/utils/tag.spec.ts static/app/components/searchQueryBuilder/index.spec.tsx -t "async filter keys|collapseDuplicate|getHasTag|isRedundant"

Requested by Alexandra Cota.

--

View Junior Session [Sentry]

Collapse tags[key,type] suggestions when the bare key already exists so
search dropdowns no longer show duplicate attributes like user.email.

Co-Authored-By: Alexandra Cota <[email protected]>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants