mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
This pull request refactors how top bar badges are handled in the application, making badge rendering extensible and moving cloud badge logic into the extension system. The main changes include replacing the old `CloudBetaBadge` component with a new, generic badge system, introducing a Pinia store for badge management, and updating the extension API to support top bar badges. **Badge System Refactor and Extensibility** * Replaced the hardcoded `CloudBetaBadge` with a new `TopbarBadges` component, which dynamically renders badges from the store instead of relying on the `isCloud` flag in `TopMenubar.vue`. [[1]](diffhunk://#diff-b7d7bf1028f09fb907c09edf27631214d005c93b80eaff7cf15cfd53671b1e8aL9-R9) [[2]](diffhunk://#diff-b7d7bf1028f09fb907c09edf27631214d005c93b80eaff7cf15cfd53671b1e8aL43-R48) * Renamed and refactored `CloudBetaBadge.vue` to `TopbarBadge.vue`, making it accept a generic `badge` prop and removing i18n logic from the component. * Added a new `TopbarBadges.vue` component to render all badges from the `topbarBadgeStore`. **Badge Data Management** * Introduced a new Pinia store `topbarBadgeStore` that aggregates top bar badges from all extensions, enabling dynamic badge management. **Extension System Integration** * Updated the extension API (`ComfyExtension` interface) to support a new `topbarBadges` property, allowing extensions to contribute badges to the top bar. * Added a core extension (`cloudBadge.ts`) that registers a "Comfy Cloud" beta badge when running in a cloud environment, using the new badge system. [[1]](diffhunk://#diff-b7818ca9daae2411d56695777160b8132507f2a3ff4f700d2510453c8833ca75R1-R16) [[2]](diffhunk://#diff-236993d9e4213efe96d267c75c3292d32b93aa4dd6c3318d26a397e0ae56bc87R2) **Type Definitions** * Added a new `TopbarBadge` type to `comfy.ts` to define the structure for top bar badges, supporting optional labels.