diff --git a/plugins/terminal/resources/messages/TerminalBundle.properties b/plugins/terminal/resources/messages/TerminalBundle.properties index 3b4bd72e427b..b02583398223 100644 --- a/plugins/terminal/resources/messages/TerminalBundle.properties +++ b/plugins/terminal/resources/messages/TerminalBundle.properties @@ -105,4 +105,6 @@ feedback.dialog.rating.interface=Interface/Usability: feedback.dialog.rating.feature.set=Feature set: feedback.dialog.rating.performance=Performance: feedback.dialog.other=Is there anything else you'd like to share? -feedback.dialog.other.placeholder=For example, missing features or vice versa, what you particularly like. \ No newline at end of file +feedback.dialog.other.placeholder=For example, missing features or vice versa, what you particularly like. +feedback.system.info.shell=Most used shell: +feedback.system.info.commands.number=Executed commands number: \ No newline at end of file diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUsageLocalStorage.kt b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUsageLocalStorage.kt index 090da3392826..286ef6aac5b5 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUsageLocalStorage.kt +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/exp/TerminalUsageLocalStorage.kt @@ -15,6 +15,9 @@ internal class TerminalUsageLocalStorage : PersistentStateComponent(project, forTest) { +internal class BlockTerminalFeedbackDialog(project: Project, forTest: Boolean) : BlockBasedFeedbackDialog(project, forTest) { override val myFeedbackReportId: String = "new_terminal" override val myTitle: String = TerminalBundle.message("feedback.dialog.title") - override val mySystemInfoData: CommonFeedbackSystemData by lazy { - CommonFeedbackSystemData.getCurrentData() + override val mySystemInfoData: BlockTerminalUsageData by lazy { + val usageStorage = TerminalUsageLocalStorage.getInstance() + BlockTerminalUsageData( + mostUsedShell = usageStorage.mostUsedShell, + executedCommandsNumber = usageStorage.executedCommandsNumber, + systemInfo = CommonFeedbackSystemData.getCurrentData() + ) } override val myShowFeedbackSystemInfoDialog: () -> Unit = { - showFeedbackSystemInfoDialog(myProject, mySystemInfoData) + showFeedbackSystemInfoDialog(myProject, mySystemInfoData.systemInfo) { + row(TerminalBundle.message("feedback.system.info.shell")) { + label(mySystemInfoData.mostUsedShell) + } + row(TerminalBundle.message("feedback.system.info.commands.number")) { + label(mySystemInfoData.executedCommandsNumber.toString()) + } + } } override val myBlocks: List = listOf( @@ -40,4 +59,23 @@ internal class BlockTerminalFeedbackDialog(project: Project, forTest: Boolean) : init { init() } +} + +@Serializable +internal data class BlockTerminalUsageData( + @NlsSafe val mostUsedShell: String, + val executedCommandsNumber: Int, + val systemInfo: CommonFeedbackSystemData +) : SystemDataJsonSerializable { + override fun serializeToJson(json: Json): JsonElement { + return json.encodeToJsonElement(this) + } + + override fun toString(): String = buildString { + appendLine(TerminalBundle.message("feedback.system.info.shell")) + appendLine(mostUsedShell) + appendLine(TerminalBundle.message("feedback.system.info.commands.number")) + appendLine(executedCommandsNumber) + append(systemInfo.toString()) + } } \ No newline at end of file