diff --git a/packages/design-system/src/css/style.css b/packages/design-system/src/css/style.css index fcadf31de..0d72105c0 100644 --- a/packages/design-system/src/css/style.css +++ b/packages/design-system/src/css/style.css @@ -114,6 +114,9 @@ --color-bypass: #6a246a; --color-error: #962a2a; + /* Comfy menu colors */ + --color-comfy-menu-secondary: var(--comfy-menu-secondary-bg); + --color-blue-selection: rgb(from var(--color-blue-100) r g b / 0.3); --color-node-hover-100: rgb(from var(--color-charcoal-100) r g b/ 0.15); --color-node-hover-200: rgb(from var(--color-charcoal-100) r g b/ 0.1); diff --git a/src/components/topbar/TopMenubar.vue b/src/components/topbar/TopMenubar.vue index e7e049b35..1bed0d400 100644 --- a/src/components/topbar/TopMenubar.vue +++ b/src/components/topbar/TopMenubar.vue @@ -2,15 +2,16 @@
+
@@ -44,6 +45,8 @@ import { app } from '@/scripts/app' import { useWorkspaceStore } from '@/stores/workspaceStore' import { electronAPI, isElectron, isNativeWindow } from '@/utils/envUtil' +import TopbarBadges from './TopbarBadges.vue' + const workspaceState = useWorkspaceStore() const settingStore = useSettingStore() diff --git a/src/components/topbar/TopbarBadges.vue b/src/components/topbar/TopbarBadges.vue new file mode 100644 index 000000000..a6a136dc5 --- /dev/null +++ b/src/components/topbar/TopbarBadges.vue @@ -0,0 +1,32 @@ + + + + diff --git a/src/extensions/core/cloudBadge.ts b/src/extensions/core/cloudBadge.ts new file mode 100644 index 000000000..fddff2aaf --- /dev/null +++ b/src/extensions/core/cloudBadge.ts @@ -0,0 +1,15 @@ +import { isProductionEnvironment } from '@/config/environment' +import { useExtensionService } from '@/services/extensionService' + +useExtensionService().registerExtension({ + name: 'Comfy.CloudBadge', + // Only show badge when running in cloud environment + topbarBadges: isProductionEnvironment() + ? [ + { + label: 'BETA', + text: 'Comfy Cloud' + } + ] + : undefined +}) diff --git a/src/extensions/core/index.ts b/src/extensions/core/index.ts index 5354ef4e9..de4ec3752 100644 --- a/src/extensions/core/index.ts +++ b/src/extensions/core/index.ts @@ -1,4 +1,5 @@ import './clipspace' +import './cloudBadge' import './contextMenuFilter' import './dynamicPrompts' import './editAttention' diff --git a/src/stores/topbarBadgeStore.ts b/src/stores/topbarBadgeStore.ts new file mode 100644 index 000000000..e4547ae46 --- /dev/null +++ b/src/stores/topbarBadgeStore.ts @@ -0,0 +1,18 @@ +import { defineStore } from 'pinia' +import { computed } from 'vue' + +import type { TopbarBadge } from '@/types/comfy' + +import { useExtensionStore } from './extensionStore' + +export const useTopbarBadgeStore = defineStore('topbarBadge', () => { + const extensionStore = useExtensionStore() + + const badges = computed(() => + extensionStore.extensions.flatMap((e) => e.topbarBadges ?? []) + ) + + return { + badges + } +}) diff --git a/src/types/comfy.ts b/src/types/comfy.ts index 0ce8d89dc..cad5b70c5 100644 --- a/src/types/comfy.ts +++ b/src/types/comfy.ts @@ -18,6 +18,14 @@ export interface AboutPageBadge { icon: string } +export interface TopbarBadge { + text: string + /** + * Optional badge label (e.g., "BETA", "ALPHA", "NEW") + */ + label?: string +} + type MenuCommandGroup = { /** * The path to the menu group. @@ -71,6 +79,10 @@ export interface ComfyExtension { * Badges to add to the about page */ aboutPageBadges?: AboutPageBadge[] + /** + * Badges to add to the topbar + */ + topbarBadges?: TopbarBadge[] /** * Allows any initialisation, e.g. loading resources. Called after the canvas is created but before nodes are added * @param app The ComfyUI app instance