From 1c84e9e408c11d63dbf3632fc180dacaa668002e Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Wed, 12 Feb 2025 18:00:29 +0100 Subject: [PATCH] [feedback] IJPL-177421 Permanent CSAT survey in IDEs Run CSAT survey on the client side (cherry picked from commit eb0b819f9ad4326589f013e76998dcfdd3e01b1e) (cherry picked from commit 3ff503981d589ac352f43707abdfd3ee10736036) IJ-MR-155667 GitOrigin-RevId: bf4044b688f353af2d5cc4f57d4e5c58161ca71a --- .../intellij/platform/feedback/csat/CsatFeedbackAction.kt | 5 +++-- .../intellij/platform/feedback/csat/CsatFeedbackSurvey.kt | 8 +++++++- .../platform/feedback/dialog/CommonFeedbackSystemData.kt | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackAction.kt b/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackAction.kt index 5418abd052d4..04c8f4076ec6 100644 --- a/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackAction.kt +++ b/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackAction.kt @@ -5,9 +5,10 @@ import com.intellij.notification.NotificationGroupManager import com.intellij.notification.NotificationType import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent +import com.intellij.openapi.actionSystem.remoting.ActionRemoteBehaviorSpecification import java.time.format.DateTimeFormatter -internal class CsatFeedbackAction : AnAction() { +internal class CsatFeedbackAction : AnAction(), ActionRemoteBehaviorSpecification.Frontend { override fun actionPerformed(e: AnActionEvent) { val project = e.project if (project != null) { @@ -16,7 +17,7 @@ internal class CsatFeedbackAction : AnAction() { } } -internal class CsatFeedbackNextDayAction : AnAction() { +internal class CsatFeedbackNextDayAction : AnAction(), ActionRemoteBehaviorSpecification.Frontend { @Suppress("HardCodedStringLiteral") override fun actionPerformed(e: AnActionEvent) { val project = e.project diff --git a/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackSurvey.kt b/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackSurvey.kt index a504f6d813a1..afca6e391490 100644 --- a/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackSurvey.kt +++ b/platform/feedback/src/com/intellij/platform/feedback/csat/CsatFeedbackSurvey.kt @@ -2,6 +2,7 @@ package com.intellij.platform.feedback.csat import com.intellij.ide.util.PropertiesComponent +import com.intellij.idea.AppMode import com.intellij.internal.statistic.eventLog.fus.MachineIdManager import com.intellij.openapi.application.ApplicationInfo import com.intellij.openapi.application.ConfigImportHelper @@ -14,6 +15,7 @@ import com.intellij.platform.feedback.InIdeFeedbackSurveyType import com.intellij.platform.feedback.dialog.BlockBasedFeedbackDialog import com.intellij.platform.feedback.dialog.SystemDataJsonSerializable import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification +import com.intellij.util.ui.accessibility.ScreenReader import kotlinx.datetime.LocalDate import kotlinx.datetime.Month import java.time.format.DateTimeFormatter @@ -41,7 +43,11 @@ internal class CsatFeedbackSurveyConfig : InIdeFeedbackSurveyConfig { override val requireIdeEAP: Boolean = false override val isIndefinite: Boolean = true - override fun checkIdeIsSuitable(): Boolean = Registry.`is`("csat.survey.enabled") + override fun checkIdeIsSuitable(): Boolean { + return Registry.`is`("csat.survey.enabled") + && !AppMode.isRemoteDevHost() + && !ScreenReader.isActive() + } override fun createFeedbackDialog(project: Project, forTest: Boolean): BlockBasedFeedbackDialog { return CsatFeedbackDialog(project, forTest) diff --git a/platform/feedback/src/com/intellij/platform/feedback/dialog/CommonFeedbackSystemData.kt b/platform/feedback/src/com/intellij/platform/feedback/dialog/CommonFeedbackSystemData.kt index e9c0eb055dd1..ebadde51bf77 100644 --- a/platform/feedback/src/com/intellij/platform/feedback/dialog/CommonFeedbackSystemData.kt +++ b/platform/feedback/src/com/intellij/platform/feedback/dialog/CommonFeedbackSystemData.kt @@ -73,6 +73,8 @@ data class CommonFeedbackSystemData( if (edition != null) { appVersion += " ($edition)" } + + // todo remove dev host info val appBuild = appInfo.build appVersion += CommonFeedbackBundle.message("dialog.feedback.system.info.panel.app.version.build", appBuild.asString()) val timestamp: Date = appInfo.buildDate.time