mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-27 08:25:50 +00:00
*PR Created by the Glary-Bot Agent* --- ## Summary Extend the existing frontend version-mismatch warning UI to consume the new `comfy_package_versions` array now exposed by ComfyUI's `/system_stats` endpoint. The backend ships installed/required versions for every `comfy*` package pinned in `requirements.txt` (frontend, workflow-templates, embedded-docs, kitchen, aimdo, …); the frontend now surfaces one toast per outdated package, reusing the existing N=1 frontend-version warning shape. Backend PR: https://github.com/Comfy-Org/ComfyUI/pull/13875 ## Changes - `src/schemas/apiSchema.ts` — add `comfy_package_versions: Array<{name, installed, required}>` to the `SystemStats` schema and export a `ComfyPackageVersion` type. The field is `.optional()` so older backends remain compatible. - `src/platform/updates/common/versionCompatibilityStore.ts` — new `outdatedComfyPackages` / `packageWarningMessages` computeds that mirror the existing semver `gt` comparison (same `valid` guard). Skip `comfyui-frontend-package` because the dedicated frontend warning above already covers it (and uses the running bundle's version rather than the installed pip version). Outdated packages are sorted by `name`/`installed`/`required` before being folded into the dismissal storage key so the key is stable across response orderings — a fresh package bump re-shows the warning, but the same outdated set in a different order does not. - `src/platform/updates/common/useFrontendVersionMismatchWarning.ts` — emit one toast per outdated package in addition to the existing frontend toast, reusing the same i18n wrapper and the existing `hasShownWarning` once-per-session guard. - `src/locales/en/main.json` — new `g.comfyPackageOutdated` string. - Unit tests — added coverage for outdated/skip/invalid-version paths, dismissal-key inclusion, and stable ordering. Existing 21 store + 8 composable tests untouched and still passing. CI suppression is unchanged: warnings still gate on `versionCompatibilityStore.shouldShowWarning` (which respects the `Comfy.VersionCompatibility.DisableWarnings` setting and the 7-day dismissal cache), and unit tests continue to mock the store the same way. ## Verification - `pnpm vitest run` for the version-warning module: **31/31** passing. - Targeted sweep across `src/platform/updates`, `src/stores/systemStatsStore.test.ts`, `src/schemas`: **160/160** passing. - `pnpm typecheck`: clean. - `pnpm lint`: 0 errors (3 pre-existing warnings in unrelated 3D test files). - `pnpm format`: applied, no incidental changes. - **Manual Playwright run** against the real dev server with `/api/system_stats` intercepted to return outdated package data — produced exactly the expected toasts and correctly skipped `comfyui-frontend-package` and the up-to-date `comfy-kitchen` entry. Same run with all-up-to-date data produced zero toasts. ### Toasts produced (manual verification) The fixture used: `required_frontend_version=99.99.99`, plus `comfy_package_versions=[frontend-package (outdated, skipped), workflow-templates 0.9.0→0.9.5 (outdated), embedded-docs 0.4.0→0.5.0 (outdated), comfy-kitchen 0.2.8→0.2.8 (up to date)]`. ## Screenshots   ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12167-feat-extend-version-warning-to-all-comfy_package_versions-entries-35e6d73d365081e7b993d0f06c9e5c98) by [Unito](https://www.unito.io) --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com>