[platform UI][se] IJPL-227258 Reset freezer on list invalidation

..., so the new upcoming results would be sorted appropriately.
+ added a short throttling in case of all the essential providers are finished. That helps to avoid blinking when essential providers don't have results, but non-essential Text and Actions generate same results in consequent search requests.

GitOrigin-RevId: cc27304a979d93285e098007c0c28aeee4ed6121
This commit is contained in:
Aydar Mukhametzyanov
2026-02-12 18:25:00 +00:00
committed by intellij-monorepo-bot
parent 464c38be0a
commit c2d927a4b7
2 changed files with 2 additions and 1 deletions
@@ -46,6 +46,7 @@ class SeResultListModel(private val searchStatePublisher: SeSearchStatePublisher
SeLog.log(SeLog.THROTTLING) { "Will invalidate result list model" }
_isValidState.value = false
isValidAndHasOnlySemantic = false
freezer.reset()
}
fun removeLoadingItem() {
@@ -363,7 +363,7 @@ private fun Flow<SeResultEvent>.throttleUntilEssentialsArrive(essentialProviderI
}
}
return@throttledWithAccumulation if (essentialProvidersCounts.isEmpty()) 0
return@throttledWithAccumulation if (essentialProvidersCounts.isEmpty()) ESSENTIALS_THROTTLE_DELAY
else if (essentialProvidersCounts.values.all { it >= ESSENTIALS_ENOUGH_COUNT }) 0
else if (essentialProvidersCounts.values.all { it > 0 }) ESSENTIALS_THROTTLE_DELAY
else null