[System Pop Up] Add setting to disable version update notifications (#4388)

This commit is contained in:
bmcomfy
2025-07-08 14:43:11 -07:00
committed by Terry Jia
parent fc35d2227c
commit 6e8a9ae41f
7 changed files with 441 additions and 5 deletions

View File

@@ -54,7 +54,7 @@
</Teleport>
<!-- What's New Section -->
<section class="whats-new-section">
<section v-if="showVersionUpdates" class="whats-new-section">
<h3 class="section-description">{{ $t('helpCenter.whatsNew') }}</h3>
<!-- Release Items -->
@@ -126,6 +126,7 @@ import { useI18n } from 'vue-i18n'
import { type ReleaseNote } from '@/services/releaseService'
import { useCommandStore } from '@/stores/commandStore'
import { useReleaseStore } from '@/stores/releaseStore'
import { useSettingStore } from '@/stores/settingStore'
import { electronAPI, isElectron } from '@/utils/envUtil'
import { formatVersionAnchor } from '@/utils/formatUtil'
@@ -168,6 +169,7 @@ const SUBMENU_CONFIG = {
const { t, locale } = useI18n()
const releaseStore = useReleaseStore()
const commandStore = useCommandStore()
const settingStore = useSettingStore()
// Emits
const emit = defineEmits<{
@@ -182,6 +184,9 @@ let hoverTimeout: number | null = null
// Computed
const hasReleases = computed(() => releaseStore.releases.length > 0)
const showVersionUpdates = computed(() =>
settingStore.get('Comfy.Notification.ShowVersionUpdates')
)
const moreMenuItem = computed(() =>
menuItems.value.find((item) => item.key === 'more')

View File

@@ -330,6 +330,14 @@ export const CORE_SETTINGS: SettingParams[] = [
defaultValue: true,
versionAdded: '1.20.3'
},
{
id: 'Comfy.Notification.ShowVersionUpdates',
category: ['Comfy', 'Notification Preferences'],
name: 'Show version updates',
tooltip: 'Show updates for new models, and major new features.',
type: 'boolean',
defaultValue: true
},
{
id: 'Comfy.ConfirmClear',
category: ['Comfy', 'Workflow', 'ConfirmClear'],

View File

@@ -232,6 +232,10 @@
"Comfy_NodeBadge_ShowApiPricing": {
"name": "Show API node pricing badge"
},
"Comfy_Notification_ShowVersionUpdates": {
"name": "Show version updates",
"tooltip": "Show updates for new models, and major new features."
},
"Comfy_NodeSearchBoxImpl": {
"name": "Node search box implementation",
"options": {

View File

@@ -426,6 +426,7 @@ const zSettings = z.object({
'Comfy.NodeBadge.NodeIdBadgeMode': zNodeBadgeMode,
'Comfy.NodeBadge.NodeLifeCycleBadgeMode': zNodeBadgeMode,
'Comfy.NodeBadge.ShowApiPricing': z.boolean(),
'Comfy.Notification.ShowVersionUpdates': z.boolean(),
'Comfy.QueueButton.BatchCountLimit': z.number(),
'Comfy.Queue.MaxHistoryItems': z.number(),
'Comfy.Keybinding.UnsetBindings': z.array(zKeybinding),

View File

@@ -32,6 +32,9 @@ export const useReleaseStore = defineStore('release', () => {
const releaseTimestamp = computed(() =>
settingStore.get('Comfy.Release.Timestamp')
)
const showVersionUpdates = computed(() =>
settingStore.get('Comfy.Notification.ShowVersionUpdates')
)
// Most recent release
const recentRelease = computed(() => {
@@ -73,6 +76,11 @@ export const useReleaseStore = defineStore('release', () => {
// Show toast if needed
const shouldShowToast = computed(() => {
// Skip if notifications are disabled
if (!showVersionUpdates.value) {
return false
}
if (!isNewVersionAvailable.value) {
return false
}
@@ -85,7 +93,7 @@ export const useReleaseStore = defineStore('release', () => {
// Skip if user already skipped or changelog seen
if (
releaseVersion.value === recentRelease.value?.version &&
!['skipped', 'changelog seen'].includes(releaseStatus.value)
['skipped', 'changelog seen'].includes(releaseStatus.value)
) {
return false
}
@@ -95,6 +103,11 @@ export const useReleaseStore = defineStore('release', () => {
// Show red-dot indicator
const shouldShowRedDot = computed(() => {
// Skip if notifications are disabled
if (!showVersionUpdates.value) {
return false
}
// Already latest → no dot
if (!isNewVersionAvailable.value) {
return false
@@ -132,6 +145,11 @@ export const useReleaseStore = defineStore('release', () => {
// Show "What's New" popup
const shouldShowPopup = computed(() => {
// Skip if notifications are disabled
if (!showVersionUpdates.value) {
return false
}
if (!isLatestVersion.value) {
return false
}
@@ -183,7 +201,14 @@ export const useReleaseStore = defineStore('release', () => {
// Fetch releases from API
async function fetchReleases(): Promise<void> {
if (isLoading.value) return
if (isLoading.value) {
return
}
// Skip fetching if notifications are disabled
if (!showVersionUpdates.value) {
return
}
isLoading.value = true
error.value = null