-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(dashboards): Allow custom sorting of releases dropdown #106978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gggritso
merged 50 commits into
master
from
georgegritsouk/dain-1111-allow-custom-sorting-of-releases-dropdown
Jan 29, 2026
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
c8e5eeb
Crimes
gggritso 8784687
refactor(dashboards): Extract URL+localStorage sync hook and update C…
gggritso 70722ad
refactor(dashboards): Improve useSyncedQueryParamState API
gggritso 42c5b57
refactor(dashboards): Rename effectiveSortBy to releaseFilterSortBy
gggritso 7f7bfb8
refactor(dashboards): Move getReleasesSortBy validation to filtersBar
gggritso a2edb17
fix(useSyncedQueryParamState): Fix URL/localStorage fallback chain an…
gggritso 0a864e1
refactor(dashboards): Replace ReleasesProvider with useReleases hook
gggritso 609c3fc
refactor(dashboards): Remove ReleasesProvider from widget builder
gggritso 45491cd
fix(dashboards): Make release sort selector match release selector vi…
gggritso 44dd23b
fix(dashboards): Remove chevron from release sort selector
gggritso 5f00f64
fix(dashboards): Use correct prop to hide chevron in sort selector
gggritso 7161672
refactor(dashboards): Remove default exports in favor of named exports
gggritso 0b35772
refactor(dashboards): Simplify ReleasesSortSelect props and reorganiz…
gggritso cb2cde7
style(dashboards): Remove horizontal padding from sort selector button
gggritso b1cb01e
Revert "style(dashboards): Remove horizontal padding from sort select…
gggritso 1023e2c
style(dashboards): Use muted variant for sort icon to match chevrons
gggritso 30767ad
Merge branch 'master' into georgegritsouk/dain-1111-allow-custom-sort…
gggritso d533af3
refactor(dashboards): Remove text from sort selector, show icon only
gggritso abf3413
refactor(dashboards): Rename sortReleasesBy to releaseFilterSort quer…
gggritso d42f430
Merge branch 'master' into georgegritsouk/dain-1111-allow-custom-sort…
gggritso d692150
Merge branch 'master' into georgegritsouk/dain-1111-allow-custom-sort…
gggritso 88bc3ff
test(dashboards): Fix releasesSelectControl tests to use useReleases …
gggritso 1531d00
ref(dashboards): Modernize release fetching with React Query hook
gggritso fdcf325
test(dashboards): Mock network instead of hook in ReleasesSelectContr…
gggritso 3b8b93b
refactor(dashboards): Use getApiUrl and remove unused ReleasesProvider
gggritso 9b8099f
test(dashboards): Fix release search mock to match all query params
gggritso d195ea5
Merge remote-tracking branch 'origin/georgegritsouk/dain-1163-moderni…
gggritso 13df807
refactor(dashboards): Inline URL+localStorage sync and fix TypeScript…
gggritso c95209d
refactor(dashboards): Change WidgetBuilderFilterBar to default export
gggritso e1974d9
Merge remote-tracking branch 'origin/master' into georgegritsouk/dain…
gggritso 1393e0b
refactor(dashboards): Remove localStorage sync for release sort
gggritso 8ebdfbf
Merge branch 'master' into georgegritsouk/dain-1111-allow-custom-sort…
gggritso 5682ab8
refactor(dashboards): Remove Insights-specific transaction.op filter
gggritso 81dfc25
ref(dashboards): Consolidate release sort options and improve typing
gggritso c640bfb
ref(dashboards): Improve type safety for release sort callbacks
gggritso 7b9afa4
ref(dashboards): Clean up release sorting implementation
gggritso c0be0eb
ref(dashboards): Address code review feedback for release sorting
gggritso 591790c
ref(dashboards): Code review improvements for release sorting
gggritso 572093a
Merge branch 'master' into georgegritsouk/dain-1111-allow-custom-sort…
gggritso 4d13d88
Propagate disabled property
gggritso 6a6d7c0
fix(dashboards): Fix stale metrics data when changing release sort
gggritso a02a07a
ref(dashboards): Use useQueries combine for stable metrics results
gggritso f004341
ref(dashboards): Improve useReleases robustness and code quality
gggritso 21e6612
Improve dropdown layout
gggritso 410db28
fix(dashboards): Fix release dropdown grid layout with missing counts
gggritso 9f32963
Reduce width of release sort selector
gggritso b02ea76
fix(dashboards): Reset ADOPTION sort when environment requirement not…
gggritso f2c4dba
ref(dashboards): Simplify RELEASES_SORT_OPTIONS structure
gggritso c15f63e
ref(dashboards): Add DEFAULT_RELEASES_SORT constant
gggritso 1c49750
Remove unused export
gggritso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
static/app/views/dashboards/components/releasesSortSelect.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import {OverlayTrigger} from '@sentry/scraps/overlayTrigger'; | ||
|
|
||
| import {CompactSelect} from 'sentry/components/core/compactSelect'; | ||
| import {RELEASES_SORT_OPTIONS, ReleasesSortOption} from 'sentry/constants/releases'; | ||
| import {IconSort} from 'sentry/icons'; | ||
| import {t} from 'sentry/locale'; | ||
| import usePageFilters from 'sentry/utils/usePageFilters'; | ||
|
|
||
| interface ReleasesSortSelectProps { | ||
| onChange: (sortBy: ReleasesSortOption) => void; | ||
| sortBy: ReleasesSortOption; | ||
| disabled?: boolean; | ||
| } | ||
|
|
||
| export function ReleasesSortSelect({ | ||
| sortBy, | ||
| onChange, | ||
| disabled, | ||
| }: ReleasesSortSelectProps) { | ||
| const {selection} = usePageFilters(); | ||
| const {environments} = selection; | ||
| return ( | ||
| <CompactSelect | ||
| disabled={disabled} | ||
| value={sortBy} | ||
| onChange={option => { | ||
| onChange(option.value); | ||
| }} | ||
| options={( | ||
| Object.keys(RELEASES_SORT_OPTIONS) as Array<keyof typeof RELEASES_SORT_OPTIONS> | ||
| ).map(name => { | ||
| const filter = RELEASES_SORT_OPTIONS[name]; | ||
| if (name !== ReleasesSortOption.ADOPTION) { | ||
| return { | ||
| label: filter, | ||
| value: name, | ||
| }; | ||
| } | ||
|
|
||
| // Adoption sort requires exactly one environment because it calculates | ||
| // the percentage of sessions/users in that specific environment | ||
| const isNotSingleEnvironment = environments.length !== 1; | ||
| return { | ||
| label: filter, | ||
| value: name, | ||
| disabled: isNotSingleEnvironment, | ||
| tooltip: isNotSingleEnvironment | ||
| ? t('Select one environment to use this sort option.') | ||
| : undefined, | ||
| }; | ||
| })} | ||
| trigger={triggerProps => ( | ||
| <OverlayTrigger.IconButton | ||
| {...triggerProps} | ||
| icon={<IconSort variant="muted" />} | ||
| aria-label={t('Sort Releases')} | ||
| /> | ||
| )} | ||
| /> | ||
| ); | ||
| } | ||
gggritso marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.