mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-12 00:20:15 +00:00
## Summary Add SVG-based brand loading indicators (LogoCFillLoader, LogoComfyWaveLoader) and use the wave loader as the app loading screen. ## Changes - **What**: New `LogoCFillLoader` (bottom-to-top fill, plays once) and `LogoComfyWaveLoader` (wave water-fill animation) components with `size`, `color`, `bordered`, and `disableAnimation` props. Move all loaders from `components/common/` to `components/loader/`. Use `LogoComfyWaveLoader` in `App.vue` and `WorkspaceAuthGate.vue`. Render loader above BlockUI overlay (z-1200) to prevent dim wash-out. - **Dependencies**: None ## Review Focus - SVG mask-based animation approach using `currentColor` for flexible theming - z-index layering: loader at z-1200 renders above PrimeVue BlockUI's z-1100 modal overlay - `disableAnimation` prop used in WorkspaceAuthGate to show static logo outline during auth loading ## Screenshots (if applicable) [loading_record.webm](https://github.com/user-attachments/assets/b34f7296-9904-4a42-9273-a7d5fda49d15) Storybook stories added for both components under `Components/Loader/`. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9433-feat-add-Logo-C-fill-and-Comfy-wave-loading-indicator-components-31a6d73d3650811cacfdcf867b1f835f) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
70 lines
2.2 KiB
Vue
70 lines
2.2 KiB
Vue
<template>
|
|
<router-view />
|
|
<GlobalDialog />
|
|
<BlockUI full-screen :blocked="isLoading" />
|
|
<div
|
|
v-if="isLoading"
|
|
class="pointer-events-none fixed inset-0 z-1200 flex items-center justify-center"
|
|
>
|
|
<LogoComfyWaveLoader size="xl" color="yellow" />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { captureException } from '@sentry/vue'
|
|
import BlockUI from 'primevue/blockui'
|
|
import { computed, onMounted } from 'vue'
|
|
|
|
import LogoComfyWaveLoader from '@/components/loader/LogoComfyWaveLoader.vue'
|
|
import GlobalDialog from '@/components/dialog/GlobalDialog.vue'
|
|
import config from '@/config'
|
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
|
import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection'
|
|
|
|
import { electronAPI } from '@/utils/envUtil'
|
|
import { isDesktop } from '@/platform/distribution/types'
|
|
import { app } from '@/scripts/app'
|
|
|
|
const workspaceStore = useWorkspaceStore()
|
|
app.extensionManager = useWorkspaceStore()
|
|
|
|
const conflictDetection = useConflictDetection()
|
|
const isLoading = computed<boolean>(() => workspaceStore.spinner)
|
|
|
|
const showContextMenu = (event: MouseEvent) => {
|
|
const { target } = event
|
|
switch (true) {
|
|
case target instanceof HTMLTextAreaElement:
|
|
case target instanceof HTMLInputElement && target.type === 'text':
|
|
// TODO: Context input menu explicitly for text input
|
|
electronAPI()?.showContextMenu({ type: 'text' })
|
|
return
|
|
}
|
|
}
|
|
|
|
onMounted(() => {
|
|
window['__COMFYUI_FRONTEND_VERSION__'] = config.app_version
|
|
|
|
if (isDesktop) {
|
|
document.addEventListener('contextmenu', showContextMenu)
|
|
}
|
|
|
|
// Handle preload errors that occur during dynamic imports (e.g., stale chunks after deployment)
|
|
// See: https://vite.dev/guide/build#load-error-handling
|
|
window.addEventListener('vite:preloadError', (event) => {
|
|
event.preventDefault()
|
|
if (__DISTRIBUTION__ === 'cloud') {
|
|
captureException(event.payload, {
|
|
tags: { error_type: 'vite_preload_error' }
|
|
})
|
|
} else {
|
|
console.error('[vite:preloadError]', event.payload)
|
|
}
|
|
})
|
|
|
|
// Initialize conflict detection in background
|
|
// This runs async and doesn't block UI setup
|
|
void conflictDetection.initializeConflictDetection()
|
|
})
|
|
</script>
|