diff --git a/plugins/github/github-core/src/org/jetbrains/plugins/github/pullrequest/ui/filters/GHPRSearchPanelFactory.kt b/plugins/github/github-core/src/org/jetbrains/plugins/github/pullrequest/ui/filters/GHPRSearchPanelFactory.kt index febae56a21b7..2c0e1ec37eb8 100644 --- a/plugins/github/github-core/src/org/jetbrains/plugins/github/pullrequest/ui/filters/GHPRSearchPanelFactory.kt +++ b/plugins/github/github-core/src/org/jetbrains/plugins/github/pullrequest/ui/filters/GHPRSearchPanelFactory.kt @@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.flow import org.jetbrains.annotations.Nls import org.jetbrains.plugins.github.i18n.GithubBundle import org.jetbrains.plugins.github.ui.icons.GHAvatarIconsProvider +import org.jetbrains.plugins.github.ui.util.GHUIUtil import javax.swing.JComponent internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val avatarIconsProvider: GHAvatarIconsProvider) : @@ -41,12 +42,7 @@ internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val ChooserPopupUtil.showAsyncChooserPopup( point, itemsLoader = flow { emit(runCatching { vm.getAuthors() }) }, - presenter = { - PopupItemPresentation.Simple( - it.shortName, - avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE), - it.name?.let { fullName -> "(${fullName})" }) - } + presenter = GHUIUtil.SelectionPresenters.Users(avatarIconsProvider) )?.login }, DropDownComponentFactory(vm.labelFilterState) @@ -54,7 +50,7 @@ internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val ChooserPopupUtil.showAsyncChooserPopup( point, itemsLoader = flow { emit(runCatching { vm.getLabels() }) }, - presenter = { PopupItemPresentation.Simple(it.name) } + presenter = GHUIUtil.SelectionPresenters.Labels() )?.name }, DropDownComponentFactory(vm.assigneeFilterState) @@ -62,12 +58,7 @@ internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val ChooserPopupUtil.showAsyncChooserPopup( point, itemsLoader = flow { emit(runCatching { vm.getAssignees() }) }, - presenter = { - PopupItemPresentation.Simple( - it.shortName, - avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE), - it.name?.let { fullName -> "($fullName)" }) - } + presenter = GHUIUtil.SelectionPresenters.Users(avatarIconsProvider) )?.login }, DropDownComponentFactory(vm.reviewFilterState) diff --git a/plugins/github/github-core/src/org/jetbrains/plugins/github/ui/util/GHUIUtil.kt b/plugins/github/github-core/src/org/jetbrains/plugins/github/ui/util/GHUIUtil.kt index f0e4b2c429bf..792bb05bd028 100644 --- a/plugins/github/github-core/src/org/jetbrains/plugins/github/ui/util/GHUIUtil.kt +++ b/plugins/github/github-core/src/org/jetbrains/plugins/github/ui/util/GHUIUtil.kt @@ -47,7 +47,7 @@ internal object GHUIUtil { PopupItemPresentation.Simple( it.shortName, avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE), - null + it.name ) } @@ -55,7 +55,7 @@ internal object GHUIUtil { PopupItemPresentation.Simple( it.login, avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE), - null + it.name ) }