[feedback] IJPL-177421 Permanent CSAT survey in IDEs

Do not show request feedback notifications twice

(cherry picked from commit a5e2f3278ff19918725ba77dc592347a9ffc4d93)


(cherry picked from commit e43e71f84d59e4ed26e1bef564393e44ed9045a6)

IJ-MR-155667

GitOrigin-RevId: eda1992585305691e954b7356bc2d51f91542e49
This commit is contained in:
Yuriy Artamonov
2025-02-16 16:16:30 +01:00
committed by intellij-monorepo-bot
parent 0a6225844d
commit 962143dff4

View File

@@ -2,13 +2,16 @@
package com.intellij.platform.feedback.impl
import com.intellij.internal.statistic.utils.getPluginInfoByDescriptor
import com.intellij.notification.NotificationsManager
import com.intellij.openapi.application.EDT
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.registry.Registry
import com.intellij.platform.feedback.FeedbackSurvey
import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification
import com.intellij.platform.feedback.impl.state.DontShowAgainFeedbackService
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -40,6 +43,13 @@ class IdleFeedbackResolver(private val cs: CoroutineScope) {
return
}
val feedbackNotifications = NotificationsManager.getNotificationsManager()
.getNotificationsOfType(RequestFeedbackNotification::class.java, project)
if (feedbackNotifications.isNotEmpty()) {
thisLogger().debug("There is already another request feedback notification shown")
return
}
cs.launch {
val suitableFeedbackTypes = IdleFeedbackTypes.entries.filter { it.isSuitable() }
val suitableIdleFeedbackSurveys = getJbIdleFeedbackSurveyExtensionList().filter { it.isSuitableToShow(project) }