[feedback] IJPL-177421 Permanent CSAT survey in IDEs

Do not show Evaluate Feedback once we have shown any CSAT notifications

(cherry picked from commit ecc781963a95bd1bec36e6f5c95ad800e81882da)


(cherry picked from commit 3e29b3f95ec161a1749a87d6bbf8e89cfb17c991)

IJ-MR-155667

GitOrigin-RevId: 872d4e474fe95e350b38b90c6d6835ff95ca2841
This commit is contained in:
Yuriy Artamonov
2025-02-16 16:28:32 +01:00
committed by intellij-monorepo-bot
parent 962143dff4
commit 579d2eefad
2 changed files with 12 additions and 3 deletions

View File

@@ -116,8 +116,10 @@ internal class CsatFeedbackSurveyConfig : InIdeFeedbackSurveyConfig {
}
override fun updateStateAfterNotificationShowed(project: Project) {
PropertiesComponent.getInstance().setValue(CSAT_SURVEY_LAST_NOTIFICATION_DATE_KEY,
getCsatToday().format(DateTimeFormatter.ISO_LOCAL_DATE))
val propertiesComponent = PropertiesComponent.getInstance()
propertiesComponent.setValue(CSAT_SURVEY_LAST_NOTIFICATION_DATE_KEY, getCsatToday().format(DateTimeFormatter.ISO_LOCAL_DATE))
// disable an automatic Evaluate Feedback form so we don't have them both shown
propertiesComponent.setValue("evaluation.feedback.enabled", "false")
}
}

View File

@@ -10,6 +10,8 @@ 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.openapi.wm.IdeFrame
import com.intellij.openapi.wm.WindowManager
import com.intellij.platform.feedback.FeedbackSurvey
import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification
import com.intellij.platform.feedback.impl.state.DontShowAgainFeedbackService
@@ -43,10 +45,15 @@ class IdleFeedbackResolver(private val cs: CoroutineScope) {
return
}
if (WindowManager.getInstance().mostRecentFocusedWindow !is IdeFrame) {
thisLogger().debug("There is a dialog shown on top of the IDE frame, not showing the feedback notifications")
return
}
val feedbackNotifications = NotificationsManager.getNotificationsManager()
.getNotificationsOfType(RequestFeedbackNotification::class.java, project)
if (feedbackNotifications.isNotEmpty()) {
thisLogger().debug("There is already another request feedback notification shown")
thisLogger().debug("There is already another request feedback notification shown, not showing more feedback notifications")
return
}