mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-07-11 01:28:03 +00:00
## ELI-5 The "API Keys & Secrets" settings screen lets you save a key for a provider (HuggingFace, Civitai, and now video/image API providers). The list of which providers you can pick is decided by the server. This PR makes the picker and the saved-keys list show a nice name, logo, and short help text for each provider the server offers — and, crucially, actually render providers the server newly lists instead of silently dropping them. ## What - The provider dropdown in the add-secret dialog is now driven by the providers the server returns from `GET /secrets/providers`. Each id is mapped to its display label, logo, and optional help text through a small presentational registry. - Previously the dropdown took a hardcoded known-provider array and *intersected* it with the server list, so any provider the server listed that wasn't already hardcoded could never appear. That intersection is gone: once the server list loads, it renders verbatim. - Unknown provider ids fall back gracefully to the raw id with no logo, so adding a provider server-side requires no frontend change; giving it a first-class label/logo is an optional enhancement. - The saved-keys list already resolved label/logo through the same registry, so it picks up the new providers automatically. - Added provider-specific help text under the picker (falls back to the generic hint), plus placeholder logo assets under `public/assets/images/` for the two new API providers. ## Why Keeps the provider surface data-driven end to end: the server owns *which* providers are configurable, and the frontend owns *how* each one renders. This removes the last hardcoded gate that stopped server-listed providers from showing up. ## Tests - New `providers.test.ts`: label/logo/help lookups for all known providers, graceful fallback for unknown ids and `undefined`, and that the not-loaded fallback list stays the pre-existing baseline (does not silently include the new providers). - Extended `useSecretForm.test.ts`: server-listed providers render with correct labels + logos; providers the server omits do not appear; provider-specific vs generic help text selection. - Full secrets suite green (66 tests). Changed files typecheck clean. Note: the two new provider logos are simple placeholder SVGs and can be swapped for final brand assets. --------- Co-authored-by: GitHub Action <action@github.com>