mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-12 16:40:05 +00:00
fix: show correct empty state on Missing tab instead of misleading registry error (#9640)
## Summary Show tab-specific empty state messages instead of a misleading registry connection error on tabs that don't depend on the Manager API. ## Changes - **What**: Scoped `comfyManagerStore.error` to only affect tabs that actually use the Manager API (AllInstalled, UpdateAvailable, Conflicting). Missing and Workflow tabs use the registry directly, so the Manager API error is irrelevant to them. Previously, any prior Manager API failure would cause `"Error connecting to the Comfy Node Registry"` to appear on the Missing tab even when there are simply no missing nodes. ## Review Focus The `isManagerErrorRelevant` computed only shows the error for Manager API-dependent tabs. Verify that AllInstalled/UpdateAvailable/Conflicting still correctly show the error when Manager API fails. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9640-fix-show-correct-empty-state-on-Missing-tab-instead-of-misleading-registry-error-31e6d73d365081868da1d226a9bb5fdc) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -402,7 +402,7 @@ const isUnresolvedTab = computed(
|
||||
)
|
||||
|
||||
// Map of tab IDs to their empty state i18n key suffixes
|
||||
const tabEmptyStateKeys: Partial<Record<ManagerTab, string>> = {
|
||||
const tabEmptyStateKeys: Record<string, string> = {
|
||||
[ManagerTab.AllInstalled]: 'allInstalled',
|
||||
[ManagerTab.UpdateAvailable]: 'updateAvailable',
|
||||
[ManagerTab.Conflicting]: 'conflicting',
|
||||
@@ -410,12 +410,27 @@ const tabEmptyStateKeys: Partial<Record<ManagerTab, string>> = {
|
||||
[ManagerTab.Missing]: 'missing'
|
||||
}
|
||||
|
||||
const managerApiDependentTabs = new Set<string>([
|
||||
ManagerTab.AllInstalled,
|
||||
ManagerTab.UpdateAvailable,
|
||||
ManagerTab.Conflicting,
|
||||
ManagerTab.NotInstalled,
|
||||
ManagerTab.Missing
|
||||
])
|
||||
|
||||
const isManagerErrorRelevant = computed(() => {
|
||||
const tabId = selectedTab.value?.id
|
||||
return (
|
||||
!!comfyManagerStore.error && !!tabId && managerApiDependentTabs.has(tabId)
|
||||
)
|
||||
})
|
||||
|
||||
// Empty state messages based on current tab and search state
|
||||
const emptyStateTitle = computed(() => {
|
||||
if (comfyManagerStore.error) return t('manager.errorConnecting')
|
||||
if (isManagerErrorRelevant.value) return t('manager.errorConnecting')
|
||||
if (searchQuery.value) return t('manager.noResultsFound')
|
||||
|
||||
const tabId = selectedTab.value?.id as ManagerTab | undefined
|
||||
const tabId = selectedTab.value?.id
|
||||
const emptyStateKey = tabId ? tabEmptyStateKeys[tabId] : undefined
|
||||
|
||||
return emptyStateKey
|
||||
@@ -424,7 +439,7 @@ const emptyStateTitle = computed(() => {
|
||||
})
|
||||
|
||||
const emptyStateMessage = computed(() => {
|
||||
if (comfyManagerStore.error) return t('manager.tryAgainLater')
|
||||
if (isManagerErrorRelevant.value) return t('manager.tryAgainLater')
|
||||
if (searchQuery.value) {
|
||||
const baseMessage = t('manager.tryDifferentSearch')
|
||||
if (isLegacyManagerSearch.value) {
|
||||
@@ -433,7 +448,7 @@ const emptyStateMessage = computed(() => {
|
||||
return baseMessage
|
||||
}
|
||||
|
||||
const tabId = selectedTab.value?.id as ManagerTab | undefined
|
||||
const tabId = selectedTab.value?.id
|
||||
const emptyStateKey = tabId ? tabEmptyStateKeys[tabId] : undefined
|
||||
|
||||
return emptyStateKey
|
||||
|
||||
Reference in New Issue
Block a user