[backport core/1.41] fix: show correct empty state on Missing tab instead of misleading registry error (#10076)

Backport of #9640 to `core/1.41`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-10076-backport-core-1-41-fix-show-correct-empty-state-on-Missing-tab-instead-of-misleading--3256d73d3650817aa2e4fbfbd536e9b0)
by [Unito](https://www.unito.io)

Co-authored-by: Jin Yi <jin12cc@gmail.com>
This commit is contained in:
Comfy Org PR Bot
2026-03-16 22:10:06 +09:00
committed by GitHub
parent 2825cb28ed
commit 45be7830a6

View File

@@ -430,7 +430,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',
@@ -438,12 +438,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
@@ -452,7 +467,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) {
@@ -461,7 +476,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