pycharm uv support survey; #PY-78501 Fixed

GitOrigin-RevId: 314259d784d9cbf471a661ee51aa337d312fd613
This commit is contained in:
Aleksandr Sorotskii
2025-02-06 13:40:10 +00:00
committed by intellij-monorepo-bot
parent 4e36f4ead1
commit 42b6334183
3 changed files with 124 additions and 0 deletions
@@ -651,6 +651,7 @@ The Python plug-in provides smart editing for Python scripts. The feature set of
description="Try to detect and automatically set-up module dependencies in a multi-module project"/>
<feedback.idleFeedbackSurvey implementation="com.jetbrains.python.statistics.feedback.PythonJobSurvey"/>
<feedback.idleFeedbackSurvey implementation="com.jetbrains.python.statistics.feedback.PythonUvSupportSurvey"/>
<statistics.counterUsagesCollector implementationClass="com.jetbrains.python.statistics.feedback.PythonJobStatisticsCollector"/>
<backgroundPostStartupActivity implementation="com.jetbrains.python.statistics.feedback.PythonFirstLaunchChecker"/>
@@ -1019,6 +1020,9 @@ The Python plug-in provides smart editing for Python scripts. The feature set of
text="Set PropertiesComponent Value" description="Set value in application-level PropertiesComponent"/>
<action id="PyShowJobSurvey" internal="true" class="com.jetbrains.python.statistics.feedback.PythonShowJobSurveyAction"
text="Show Python Job Survey"/>
<action id="PyUvSupportSurvey" internal="true" class="com.jetbrains.python.statistics.feedback.PythonShowUvSupportAction"
text="Show uv Support Survey"/>
<add-to-group group-id="Internal"/>
</group>
</actions>
@@ -1587,3 +1587,17 @@ python.survey.user.job.dialog.blocks.checkbox.other=Other
validation.invalid.name=Invalid name
dialog.message.command.could.not.complete=Command could not be completed successfully. \
Please see the command's output for information about resolving this problem.
python.survey.uv.support.group=PyCharm uv Support Survey
python.survey.uv.support.title=uv Support Feedback
python.survey.uv.support.content=What do you think about uv support in PyCharm?
python.survey.uv.support.dialog.title=uv Support Feedback
python.survey.uv.support.dialog.blocks.top=uv Support Feedback
python.survey.uv.support.blocks.radiobutton.group=What do you think about uv support in PyCharm?
python.survey.uv.support.blocks.radiobutton.group.good=It's good!
python.survey.uv.support.blocks.radiobutton.group.soso=So-so
python.survey.uv.support.blocks.radiobutton.group.bad=Really bad
python.survey.uv.support.blocks.radiobutton.group.notyet=Didn't try
python.survey.uv.support.blocks.textarea.group=Could you please explain?
@@ -0,0 +1,106 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.python.statistics.feedback
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.project.Project
import com.intellij.platform.feedback.FeedbackSurvey
import com.intellij.platform.feedback.InIdeFeedbackSurveyConfig
import com.intellij.platform.feedback.InIdeFeedbackSurveyType
import com.intellij.platform.feedback.dialog.BlockBasedFeedbackDialog
import com.intellij.platform.feedback.dialog.CommonFeedbackSystemData
import com.intellij.platform.feedback.dialog.SystemDataJsonSerializable
import com.intellij.platform.feedback.dialog.showFeedbackSystemInfoDialog
import com.intellij.platform.feedback.dialog.uiBlocks.FeedbackBlock
import com.intellij.platform.feedback.dialog.uiBlocks.RadioButtonGroupBlock
import com.intellij.platform.feedback.dialog.uiBlocks.RadioButtonItemData
import com.intellij.platform.feedback.dialog.uiBlocks.TextAreaBlock
import com.intellij.platform.feedback.dialog.uiBlocks.TopLabelBlock
import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification
import com.jetbrains.python.PyBundle.message
import kotlinx.datetime.LocalDate
class UvSupportSurvey : InIdeFeedbackSurveyConfig {
private val suitableIdeVersion = "2025.1"
override val surveyId: String = "python_uv_support_survey"
override val lastDayOfFeedbackCollection: LocalDate
get() = LocalDate(2025, 2, 15)
override val requireIdeEAP: Boolean = true
override fun checkIdeIsSuitable(): Boolean = true
override fun updateStateAfterDialogClosedOk(project: Project) {}
override fun updateStateAfterNotificationShowed(project: Project) {}
override fun checkExtraConditionSatisfied(project: Project): Boolean {
return suitableIdeVersion == ApplicationInfo.getInstance().shortVersion
}
override fun createFeedbackDialog(project: Project, forTest: Boolean): BlockBasedFeedbackDialog<out SystemDataJsonSerializable> {
return UvSupportSurveyDialog(project, forTest)
}
override fun createNotification(project: Project, forTest: Boolean): RequestFeedbackNotification {
return RequestFeedbackNotification(
message("python.survey.uv.support.group"),
message("python.survey.uv.support.title"),
message("python.survey.uv.support.content"),
)
}
}
class UvSupportSurveyDialog(
project: Project?,
forTest: Boolean,
) : BlockBasedFeedbackDialog<CommonFeedbackSystemData>(project, forTest) {
override val myFeedbackReportId: String
get() = "python_uv_support_survey"
override val myTitle: String
get() = message("python.survey.uv.support.dialog.title")
private val items = listOf(
RadioButtonItemData(message("python.survey.uv.support.blocks.radiobutton.group.good"), "good"),
RadioButtonItemData(message("python.survey.uv.support.blocks.radiobutton.group.soso"), "soso"),
RadioButtonItemData(message("python.survey.uv.support.blocks.radiobutton.group.bad"), "bad"),
RadioButtonItemData(message("python.survey.uv.support.blocks.radiobutton.group.notyet"), "notyet")
)
override val myBlocks: List<FeedbackBlock>
get() = listOf(
TopLabelBlock(message("python.survey.uv.support.dialog.blocks.top")),
RadioButtonGroupBlock(
message("python.survey.uv.support.blocks.radiobutton.group"),
items,
"python_uv_radiobutton"),
TextAreaBlock(
message("python.survey.uv.support.blocks.textarea.group"),
"python_uv_textarea")
)
override val mySystemInfoData: CommonFeedbackSystemData
get() = CommonFeedbackSystemData.getCurrentData()
override val myShowFeedbackSystemInfoDialog: () -> Unit = {
showFeedbackSystemInfoDialog(myProject, mySystemInfoData)
}
init {
init()
}
}
class PythonShowUvSupportAction : AnAction() {
override fun actionPerformed(e: AnActionEvent) {
PythonUvSupportSurvey().showNotification(e.project!!, true)
}
}
class PythonUvSupportSurvey : FeedbackSurvey() {
override val feedbackSurveyType: InIdeFeedbackSurveyType<InIdeFeedbackSurveyConfig> =
InIdeFeedbackSurveyType(UvSupportSurvey())
}