mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform UI][se] IJPL-227351 Search everywhere: preview window disappears
(cherry picked from commit 1744e4a611640900e68b9accd19350f59fd427f8) IJ-CR-192757 GitOrigin-RevId: f2cb6e1524bd33e2af9f979575c53975244b850b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
81e9f419db
commit
b5aa6a9dee
@@ -477,21 +477,22 @@ class SePopupContentPane(
|
||||
vm.previewConfigurationFlow.collectLatest { configuration ->
|
||||
val isVisible = configuration?.fetchPreview != null
|
||||
|
||||
withContext(Dispatchers.EDT) {
|
||||
usagePreviewPanel?.isVisible = isVisible
|
||||
if (!isVisible) {
|
||||
withContext(Dispatchers.EDT) {
|
||||
usagePreviewPanel?.isVisible = false
|
||||
}
|
||||
return@collectLatest
|
||||
}
|
||||
|
||||
if (isVisible) {
|
||||
selectedItemDataFlow.collectLatest { itemData ->
|
||||
withContext(Dispatchers.EDT) {
|
||||
if (itemData != null) {
|
||||
val usageInfos = configuration.fetchPreview(itemData)
|
||||
usagePreviewPanel?.isVisible = true
|
||||
usagePreviewPanel?.updateLayout(configuration.project, usageInfos)
|
||||
}
|
||||
else {
|
||||
usagePreviewPanel?.isVisible = false
|
||||
}
|
||||
selectedItemDataFlow.collectLatest { itemData ->
|
||||
withContext(Dispatchers.EDT) {
|
||||
if (itemData != null) {
|
||||
val usageInfos = configuration.fetchPreview(itemData)
|
||||
usagePreviewPanel?.isVisible = true
|
||||
usagePreviewPanel?.updateLayout(configuration.project, usageInfos)
|
||||
}
|
||||
else {
|
||||
usagePreviewPanel?.isVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.mapLatest
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.joinAll
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -232,16 +231,12 @@ class SePopupVm(
|
||||
)
|
||||
|
||||
if (PreviewExperiment.isExperimentEnabled && previewFetcher != null) {
|
||||
previewConfigurationFlow = combine(currentTabFlow, showPreviewSetting) { tabVm, previewSetting ->
|
||||
tabVm.isPreviewEnabled.getValue() to previewSetting
|
||||
}.mapLatest { (tabPreviewEnabled, previewSetting) ->
|
||||
if (tabPreviewEnabled) {
|
||||
if (previewSetting) SePreviewConfiguration(previewFetcher.project, this::fetchPreview)
|
||||
previewConfigurationFlow = currentTabFlow.flatMapLatest { tabVm ->
|
||||
val tabPreviewEnabled = tabVm.isPreviewEnabled.getValue()
|
||||
showPreviewSetting.map { previewSetting ->
|
||||
if (tabPreviewEnabled && previewSetting) SePreviewConfiguration(previewFetcher.project, this::fetchPreview)
|
||||
else SePreviewConfiguration(previewFetcher.project, null)
|
||||
}
|
||||
else {
|
||||
SePreviewConfiguration(previewFetcher.project, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user