PY-82344 Track update ready restart notifications in PyCharm unified promotion

GitOrigin-RevId: 83d5f1b69ba960a5aef19206d0bc262f31b25a2e
This commit is contained in:
Daniil Kalinin
2025-10-13 15:11:47 +00:00
committed by intellij-monorepo-bot
parent 742c256b45
commit 7578c556a6
3 changed files with 27 additions and 0 deletions
@@ -112,4 +112,10 @@
<statistics.counterUsagesCollector
implementationClass="com.intellij.pycharm.community.ide.impl.promotion.communityToUnified.statistics.PyCommunityUnifiedPromoFusCollector"/>
</extensions>
<applicationListeners>
<listener
class="com.intellij.pycharm.community.ide.impl.promotion.communityToUnified.statistics.PyCommunityUpdateReadyNotificationListener"
topic="com.intellij.notification.Notifications"/>
</applicationListeners>
</idea-plugin>
@@ -39,4 +39,7 @@ internal object PyCommunityUnifiedPromoFusCollector : CounterUsagesCollector() {
// Update dialog
internal val UpdateDialogShown = GROUP.registerEvent("update.dialog.shown")
internal val UpdateDialogClosed = GROUP.registerEvent("update.dialog.closed", UpdateDialogCloseReasonField, DurationMsField)
// Update ready restart notification (balloon)
internal val UpdateReadyRestartNotificationShown = GROUP.registerEvent("update.ready.restart.notification.shown")
}
@@ -0,0 +1,18 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.pycharm.community.ide.impl.promotion.communityToUnified.statistics
import com.intellij.notification.Notification
import com.intellij.notification.Notifications
import com.intellij.openapi.updateSettings.impl.UpdateChecker
import com.intellij.util.PlatformUtils
internal class PyCommunityUpdateReadyNotificationListener : Notifications {
override fun notify(notification: Notification) {
if (!PlatformUtils.isPyCharmCommunity()) return
val targetGroupId = UpdateChecker.getNotificationGroupForIdeUpdateResults().displayId
val restartDisplayId = "ide.update.suggest.restart"
if (notification.groupId == targetGroupId && notification.displayId == restartDisplayId) {
PyCommunityUnifiedPromoFusCollector.UpdateReadyRestartNotificationShown.log()
}
}
}