diff --git a/src/extensions/core/index.ts b/src/extensions/core/index.ts index f50493d82..e1675dfb2 100644 --- a/src/extensions/core/index.ts +++ b/src/extensions/core/index.ts @@ -1,4 +1,4 @@ -import { isCloud } from '@/platform/distribution/types' +import { isCloud, isNightly } from '@/platform/distribution/types' import './clipspace' import './contextMenuFilter' @@ -38,3 +38,8 @@ if (isCloud) { await import('./cloudSubscription') } } + +// Nightly-only extensions +if (isNightly && !isCloud) { + await import('./nightlyBadges') +} diff --git a/src/extensions/core/nightlyBadges.ts b/src/extensions/core/nightlyBadges.ts new file mode 100644 index 000000000..a453a6397 --- /dev/null +++ b/src/extensions/core/nightlyBadges.ts @@ -0,0 +1,17 @@ +import { t } from '@/i18n' +import { useExtensionService } from '@/services/extensionService' +import type { TopbarBadge } from '@/types/comfy' + +const badges: TopbarBadge[] = [ + { + text: t('nightly.badge.label'), + label: t('g.nightly'), + variant: 'warning', + tooltip: t('nightly.badge.tooltip') + } +] + +useExtensionService().registerExtension({ + name: 'Comfy.Nightly.Badges', + topbarBadges: badges +}) diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 16116ac1c..9dacb3d64 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -275,6 +275,7 @@ "1x": "1x", "2x": "2x", "beta": "BETA", + "nightly": "NIGHTLY", "profile": "Profile", "noItems": "No items" }, @@ -2634,5 +2635,11 @@ "workspaceNotFound": "Workspace not found", "tokenExchangeFailed": "Failed to authenticate with workspace: {error}" } + }, + "nightly": { + "badge": { + "label": "Preview Version", + "tooltip": "You are using a nightly version of ComfyUI. Please use the feedback button to share your thoughts about these features." + } } } \ No newline at end of file