From 4f1c30c082b494b12a20e73dcbd604acff62ca78 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Fri, 3 Jan 2025 13:39:46 +0100 Subject: [PATCH] separate options --- .../views/insights/common/components/releaseSelector.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/static/app/views/insights/common/components/releaseSelector.tsx b/static/app/views/insights/common/components/releaseSelector.tsx index 95cc2f21a70ae8..e9679cdd9136dd 100644 --- a/static/app/views/insights/common/components/releaseSelector.tsx +++ b/static/app/views/insights/common/components/releaseSelector.tsx @@ -106,12 +106,19 @@ export function ReleaseSelector({ searchable value={selectorValue} options={[ + { + value: '_selected_release', + // We do this because the selected/default release might not be sorted, + // but instead could have been added to the top of options list. + options: options.slice(0, 1), + }, { value: '_releases', label: tct('Sorted by [sortBy]', { sortBy: SORT_BY_OPTIONS[sortBy].label, }), - options, + // Display other releases sorted by the selected option + options: options.slice(1), }, ]} onSearch={debounce(val => {