-
Notifications
You must be signed in to change notification settings - Fork 435
Fix skeleton loaders for Image/Video Previews #7094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…l content is ready and preventing flicker
📝 WalkthroughWalkthroughVideoPreview.vue and ImagePreview.vue updated loading/error rendering and state handling: skeletons render only when loading and no error; media elements render only when no error and are hidden while loading via a Changes
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/02/2025, 07:14:44 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 12/02/2025, 07:24:05 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.19 MB (baseline 3.19 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 929 kB (baseline 928 kB) • 🔴 +671 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 169 kB (baseline 169 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 BBundles that do not match a named category
Status: 17 added / 17 removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/renderer/extensions/vueNodes/components/ImagePreview.vue (1)
132-132: Verify the tailwindUtil module exists.ESLint cannot resolve
@/utils/tailwindUtil. Confirm the file exists at this path.This is a duplicate concern flagged in VideoPreview.vue. The verification script there will check both files.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/renderer/extensions/vueNodes/VideoPreview.vue(3 hunks)src/renderer/extensions/vueNodes/components/ImagePreview.vue(4 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.vue
📄 CodeRabbit inference engine (.cursorrules)
**/*.vue: Use setup() function for component logic in Vue 3 Composition API
Utilize ref and reactive for reactive state in Vue 3
Implement computed properties with computed() function
Use watch and watchEffect for side effects in Vue 3
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection in Vue 3
Use Vue 3.5 style of default prop declaration with defineProps()
Organize Vue components in <script> <style> order
Use Tailwind CSS for styling Vue components
Implement responsive design with Tailwind CSS
Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components in Vue 3
Follow Vue 3 style guide and naming conventions
Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)Never use
:class="[]"to merge class names - always useimport { cn } from '@/utils/tailwindUtil'for class merging in Vue templates
**/*.vue: Use TypeScript with Vue 3 Single File Components (.vuefiles)
Name Vue components in PascalCase (e.g.,MenuHamburger.vue)Files:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vue**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vue**/*.{ts,tsx,js,vue}
📄 CodeRabbit inference engine (.cursorrules)
Implement proper error handling in components and services
**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in.prettierrc
Organize imports by sorting and grouping by plugin, and runpnpm formatbefore committingFiles:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/*.vue
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventionsFiles:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vue**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vue**/*.{vue,html}
📄 CodeRabbit inference engine (CLAUDE.md)
Never use
dark:ordark-theme:Tailwind variants - instead use semantic values fromstyle.csstheme, e.g.bg-node-component-surfaceFiles:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vue**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,vue}: Useconst settingStore = useSettingStore()andsettingStore.get('Comfy.SomeSetting')to retrieve settings in TypeScript/Vue files
Useawait settingStore.set('Comfy.SomeSetting', newValue)to update settings in TypeScript/Vue files
Check server capabilities usingapi.serverSupportsFeature('feature_name')before using enhanced features
Useapi.getServerFeature('config_name', defaultValue)to retrieve server feature configurationEnforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Files:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebaseFiles:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vue🧠 Learnings (2)
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.vue : Use Teleport/Suspense when needed for component renderingApplied to files:
src/renderer/extensions/vueNodes/VideoPreview.vuesrc/renderer/extensions/vueNodes/components/ImagePreview.vue📚 Learning: 2025-11-24T19:47:14.779Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:14.779Z Learning: Applies to **/*.vue : Never use `:class="[]"` to merge class names - always use `import { cn } from '@/utils/tailwindUtil'` for class merging in Vue templatesApplied to files:
src/renderer/extensions/vueNodes/VideoPreview.vue🪛 ESLint
src/renderer/extensions/vueNodes/VideoPreview.vue
[error] 115-115: Unable to resolve path to module '@/utils/tailwindUtil'.
(import-x/no-unresolved)
src/renderer/extensions/vueNodes/components/ImagePreview.vue
[error] 132-132: Unable to resolve path to module '@/utils/tailwindUtil'.
(import-x/no-unresolved)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: deploy-and-comment
- GitHub Check: lint-and-format
- GitHub Check: test
- GitHub Check: collect
- GitHub Check: setup
🔇 Additional comments (6)
src/renderer/extensions/vueNodes/VideoPreview.vue (3)
38-47: Verify cn utility is correctly handling conditional visibility.The changes correctly:
- Conditionally render the video only when there's no error
- Use the
cnutility for class merging per coding guidelines- Apply
invisibleclass during loading to prevent display glitches
141-155: Loading state initialization looks correct.The change to initialize
isLoading.value = newUrls.length > 0ensures that the loading state is set appropriately when new URLs are provided, which aligns with the PR objectives.
115-115: The import path is correctly configured and the file exists at the expected location. The@/alias is properly defined intsconfig.jsonto resolve to./src/*, making@/utils/tailwindUtilcorrectly resolve tosrc/utils/tailwindUtil.ts. No action required.src/renderer/extensions/vueNodes/components/ImagePreview.vue (3)
38-51: LGTM on conditional rendering and cn utility usage.The implementation correctly:
- Conditionally renders only when no error exists
- Uses
cn()for class composition per guidelines- Hides the image with
invisibleduring loading
165-179: Loading state initialization is correct.Setting
isLoading.value = newUrls.length > 0when URLs change ensures proper loading feedback.
232-239: Setting isLoading when navigating between images is appropriate.When the user navigates to a different image via
setCurrentIndex, settingisLoading.value = trueensures the skeleton displays until the new image loads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
src/renderer/extensions/vueNodes/VideoPreview.vue (1)
29-35: Align skeleton sizing with container; drop fixed width/height.
class="absolute inset-0 size-full"already makes the skeleton fill the container; thewidth="16rem"/height="16rem"props override that with fixed dimensions and can cause mismatch with the video area. Recommend removing the fixed size props and relying on the container sizing.<Skeleton v-if="isLoading && !videoError" class="absolute inset-0 size-full" border-radius="5px" - width="16rem" - height="16rem" />src/renderer/extensions/vueNodes/components/ImagePreview.vue (1)
29-35: Skeleton still uses fixed 16rem dimensions; let it fully follow the container.You’ve fixed positioning with
absolute inset-0, butwidth="16rem"/height="16rem"will overridesize-full(inline style beats Tailwind), so the skeleton won’t truly match dynamic container size.Consider dropping the fixed dimensions and relying on full‑size classes:
<Skeleton v-if="isLoading && !imageError" class="absolute inset-0 size-full" border-radius="5px" - width="16rem" - height="16rem" />
🧹 Nitpick comments (2)
src/renderer/extensions/vueNodes/VideoPreview.vue (1)
141-153: Consider initializingisLoadingfor initial non-empty URLs.
isLoadingis updated tonewUrls.length > 0whenimageUrlschanges, but the watcher is notimmediate, so if the component ever mounts with a non-emptyimageUrlsarray that doesn’t change afterward, the initial load won’t show the skeleton. If that scenario is possible, consider either:
- Setting
isLoading’s initial value fromprops.imageUrls.length > 0, or- Adding
immediate: trueto this watcher and handling the initial run accordingly.src/renderer/extensions/vueNodes/components/ImagePreview.vue (1)
164-179: Loading state tied to URL array length may get “stuck” in edge cases.
isLoadingis set fromnewUrls.length > 0in theimageUrlswatcher (Line 176) and also forced totrueinsetCurrentIndex(Line 236). This works when the displayed image URL actually changes, but there’s a potential edge case:
- If
imageUrlsis mutated (e.g., new images appended) without changingcurrentIndexor the URL at that index, the<img>srcmay not change, noloadevent fires, andisLoadingcan remaintrueindefinitely while the visible image never reloads.If the store always replaces the entire array and/or the current index image always changes when outputs update, you’re safe; otherwise you may want to derive loading from the displayed URL instead of just array length.
One way to tighten this:
-// Watch for URL changes and reset state -watch( - () => props.imageUrls, - (newUrls) => { - // Reset current index if it's out of bounds - if (currentIndex.value >= newUrls.length) { - currentIndex.value = 0 - } - - // Reset loading and error states when URLs change - actualDimensions.value = null - imageError.value = false - isLoading.value = newUrls.length > 0 - }, - { deep: true } -) +// Keep current index in bounds when the URLs array changes +watch( + () => props.imageUrls, + (newUrls) => { + if (currentIndex.value >= newUrls.length) { + currentIndex.value = 0 + } + }, + { deep: true } +) + +// Reset loading/error when the displayed image URL changes +watch( + () => currentImageUrl.value, + (url) => { + actualDimensions.value = null + imageError.value = false + isLoading.value = !!url + }, + { immediate: true } +)This keeps the “set
isLoadingto true on index change” behavior you added while avoiding spurious loading states when only other entries in the array change.Also applies to: 232-238
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/renderer/extensions/vueNodes/VideoPreview.vue(3 hunks)src/renderer/extensions/vueNodes/components/ImagePreview.vue(4 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.vue
📄 CodeRabbit inference engine (.cursorrules)
**/*.vue: Use setup() function for component logic in Vue 3 Composition API
Utilize ref and reactive for reactive state in Vue 3
Implement computed properties with computed() function
Use watch and watchEffect for side effects in Vue 3
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection in Vue 3
Use Vue 3.5 style of default prop declaration with defineProps()
Organize Vue components in <script> <style> order
Use Tailwind CSS for styling Vue components
Implement responsive design with Tailwind CSS
Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components in Vue 3
Follow Vue 3 style guide and naming conventions
Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)Never use
:class="[]"to merge class names - always useimport { cn } from '@/utils/tailwindUtil'for class merging in Vue templates
**/*.vue: Use TypeScript with Vue 3 Single File Components (.vuefiles)
Name Vue components in PascalCase (e.g.,MenuHamburger.vue)Files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vue**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vue**/*.{ts,tsx,js,vue}
📄 CodeRabbit inference engine (.cursorrules)
Implement proper error handling in components and services
**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in.prettierrc
Organize imports by sorting and grouping by plugin, and runpnpm formatbefore committingFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vuesrc/**/*.vue
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventionsFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vuesrc/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vue**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vue**/*.{vue,html}
📄 CodeRabbit inference engine (CLAUDE.md)
Never use
dark:ordark-theme:Tailwind variants - instead use semantic values fromstyle.csstheme, e.g.bg-node-component-surfaceFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vue**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,vue}: Useconst settingStore = useSettingStore()andsettingStore.get('Comfy.SomeSetting')to retrieve settings in TypeScript/Vue files
Useawait settingStore.set('Comfy.SomeSetting', newValue)to update settings in TypeScript/Vue files
Check server capabilities usingapi.serverSupportsFeature('feature_name')before using enhanced features
Useapi.getServerFeature('config_name', defaultValue)to retrieve server feature configurationEnforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vuesrc/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebaseFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vuesrc/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vuesrc/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/components/ImagePreview.vue🧠 Learnings (6)
📓 Common learnings
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.vue : Use Teleport/Suspense when needed for component renderingLearnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .cursorrules:0-0 Timestamp: 2025-11-24T19:46:52.279Z Learning: Applies to **/*.vue : Implement lifecycle hooks with onMounted, onUpdated, etc.Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-11-24T19:47:02.860Z Learning: Applies to src/**/*.vue : Implement lifecycle hooks with onMounted, onUpdated, etc.Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-11-24T19:47:02.860Z Learning: Applies to src/**/*.vue : Use Suspense for async componentsLearnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .cursorrules:0-0 Timestamp: 2025-11-24T19:46:52.279Z Learning: Applies to **/*.vue : Use Suspense for async components in Vue 3Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-11-24T19:47:02.860Z Learning: Applies to src/**/*.vue : Utilize ref and reactive for reactive state📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.vue : Use Teleport/Suspense when needed for component renderingApplied to files:
src/renderer/extensions/vueNodes/components/ImagePreview.vuesrc/renderer/extensions/vueNodes/VideoPreview.vue📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-11-24T19:47:02.860Z Learning: Applies to src/**/*.{vue,ts} : Leverage VueUse functions for performance-enhancing stylesApplied to files:
src/renderer/extensions/vueNodes/components/ImagePreview.vue📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .cursorrules:0-0 Timestamp: 2025-11-24T19:46:52.279Z Learning: Applies to **/*.{vue,ts,tsx} : Leverage VueUse functions for performance-enhancing utilitiesApplied to files:
src/renderer/extensions/vueNodes/components/ImagePreview.vue📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.{vue,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listenersApplied to files:
src/renderer/extensions/vueNodes/components/ImagePreview.vue📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .cursorrules:0-0 Timestamp: 2025-11-24T19:46:52.279Z Learning: Applies to **/*.vue : Use watch and watchEffect for side effects in Vue 3Applied to files:
src/renderer/extensions/vueNodes/VideoPreview.vue🪛 ESLint
src/renderer/extensions/vueNodes/components/ImagePreview.vue
[error] 132-132: Unable to resolve path to module '@/utils/tailwindUtil'.
(import-x/no-unresolved)
src/renderer/extensions/vueNodes/VideoPreview.vue
[error] 115-115: Unable to resolve path to module '@/utils/tailwindUtil'.
(import-x/no-unresolved)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: setup
- GitHub Check: test
- GitHub Check: lint-and-format
- GitHub Check: collect
🔇 Additional comments (4)
src/renderer/extensions/vueNodes/VideoPreview.vue (2)
39-41: Video visibility logic during loading looks correct.Gating the video on
!videoErrorand toggling visibility withcn('block size-full object-contain', isLoading && 'invisible')cleanly separates error vs loading states and avoids flicker while the skeleton is shown.
115-115: Good adoption of sharedcnutility.Importing
cnfrom@/utils/tailwindUtiland using it in the template aligns with the guideline to avoid:class="[]"and centralizes class merging.src/renderer/extensions/vueNodes/components/ImagePreview.vue (2)
39-48: cn-based image classes + loading invisibility look good.Using
cnto compose base classes with aninvisiblestate whenisLoadingis true matches the Tailwind + class-merging guidelines and keeps the image in DOM while hiding it during skeleton display.
132-132: The import path@/utils/tailwindUtilis correctly configured and resolves successfully. The module exists, thecnfunction is properly exported, and this identical import is used across 50+ components in the codebase without issues, including multiple files in the same directory as ImagePreview.vue.Likely an incorrect or invalid review comment.
|
Check out the rabbit comments again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comprehensive PR Review
This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.
Review Summary
PR: Fix skeleton loaders for Image/Video Previews (#7094)
Impact: 28 additions, 9 deletions across 2 files
Issue Distribution
- Critical: 0
- High: 0
- Medium: 0
- Low: 0
Category Breakdown
- Architecture: 0 issues
- Security: 0 issues
- Performance: 0 issues
- Code Quality: 0 issues
Key Findings
Architecture & Design
The changes maintain the existing Vue 3 Composition API architecture and follow established component patterns. The modifications are focused on visual presentation improvements without altering the component's core functionality or API. The use of PrimeVue's Skeleton component aligns with the project's preference for established UI libraries over custom implementations.
Security Considerations
No security implications identified. The changes are purely presentational and do not introduce any input validation, XSS, or other security concerns.
Performance Impact
The changes have minimal performance impact. Adding CSS classes does not affect rendering performance, bundle size, or component reactivity. The skeleton loaders continue to conditionally render based on loading states as before.
Integration Points
The changes maintain backward compatibility and do not affect:
- Component props or interfaces
- Event handling
- State management
- Extension compatibility
Positive Observations
✅ Consistent Implementation: Both VideoPreview.vue and ImagePreview.vue receive identical fixes, ensuring visual consistency across media preview components.
✅ Proper CSS Utilities: The changes use Tailwind's utility classes (absolute, inset-0, size-full) correctly to achieve proper positioning and sizing.
✅ Follows Project Guidelines: The implementation adheres to CLAUDE.md guidelines by using established utility classes rather than custom CSS.
✅ Focused Scope: The changes are minimal and surgical, addressing only the specific skeleton loader positioning issue without unnecessary modifications.
✅ Maintains Accessibility: The existing aria-labels and semantic structure remain unchanged, preserving accessibility features.
Technical Analysis
The core change transforms class="inset-0" into class="absolute inset-0 size-full". This fix addresses a CSS positioning issue where inset-0 requires a positioned element (absolute, relative, or fixed) to take effect. The addition of absolute positioning ensures the skeleton properly overlays the media content, while size-full explicitly sets both width and height to 100%.
Next Steps
- ✅ Changes are ready for merge - no blocking issues identified
- Consider adding automated visual regression tests for skeleton loading states in future iterations
- Monitor user feedback for skeleton loader visibility and timing
This is a comprehensive automated review. The changes are well-implemented and follow established patterns. No human review required for merge.
This pull request refines the loading and error handling logic for both the `VideoPreview.vue` and `ImagePreview.vue` components. The main improvements include making the loading skeleton more accurate and visually consistent, updating how loading and error states are managed when URLs change, and ensuring that the main media elements are hidden while loading. These changes enhance the user experience by providing clearer feedback during media load operations. **Loading and error state improvements:** * The loading skeleton in both `VideoPreview.vue` and `ImagePreview.vue` now only appears when loading and no error is present, with updated styling and fixed dimensions for better consistency. (`VideoPreview.vue` [[1]](diffhunk://#diff-17b5c19b4628f22e45570b66a85ed1fc16e931dd368fe420584d487e522ab8aaL29-R41) `ImagePreview.vue` [[2]](diffhunk://#diff-0c0b17c5c68464e0284398ad42b823509d414c9cf297f3bc2aa2b00e0f9c2015L29-R48) * The main video and image elements are now hidden (using the `invisible` class) while loading, preventing display glitches before the media is ready. (`VideoPreview.vue` [[1]](diffhunk://#diff-17b5c19b4628f22e45570b66a85ed1fc16e931dd368fe420584d487e522ab8aaL29-R41) `ImagePreview.vue` [[2]](diffhunk://#diff-0c0b17c5c68464e0284398ad42b823509d414c9cf297f3bc2aa2b00e0f9c2015L29-R48) * The loading state (`isLoading`) is now set to `true` whenever new URLs are provided, and reset appropriately when navigating between media items, ensuring accurate feedback to the user. (`VideoPreview.vue` [[1]](diffhunk://#diff-17b5c19b4628f22e45570b66a85ed1fc16e931dd368fe420584d487e522ab8aaL145-R152) `ImagePreview.vue` [[2]](diffhunk://#diff-0c0b17c5c68464e0284398ad42b823509d414c9cf297f3bc2aa2b00e0f9c2015L164-R176) [[3]](diffhunk://#diff-0c0b17c5c68464e0284398ad42b823509d414c9cf297f3bc2aa2b00e0f9c2015L224-R236) **Code consistency and maintainability:** * Both components now import and use the shared `cn` utility for conditional class names, improving code consistency and maintainability. (`VideoPreview.vue` [[1]](diffhunk://#diff-17b5c19b4628f22e45570b66a85ed1fc16e931dd368fe420584d487e522ab8aaR115) `ImagePreview.vue` [[2]](diffhunk://#diff-0c0b17c5c68464e0284398ad42b823509d414c9cf297f3bc2aa2b00e0f9c2015R132) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7094-Fix-skeleton-loaders-for-Image-Video-Previews-2bd6d73d3650817989e1f4d597094016) by [Unito](https://www.unito.io)
…7248) Backport of #7094 to `core/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7248-backport-core-1-33-Fix-skeleton-loaders-for-Image-Video-Previews-2c36d73d3650814c9187f6321af27b96) by [Unito](https://www.unito.io) Co-authored-by: Johnpaul Chiwetelu <[email protected]>
This pull request refines the loading and error handling logic for both the
VideoPreview.vueandImagePreview.vuecomponents. The main improvements include making the loading skeleton more accurate and visually consistent, updating how loading and error states are managed when URLs change, and ensuring that the main media elements are hidden while loading. These changes enhance the user experience by providing clearer feedback during media load operations.Loading and error state improvements:
VideoPreview.vueandImagePreview.vuenow only appears when loading and no error is present, with updated styling and fixed dimensions for better consistency. (VideoPreview.vue[1]ImagePreview.vue[2]invisibleclass) while loading, preventing display glitches before the media is ready. (VideoPreview.vue[1]ImagePreview.vue[2]isLoading) is now set totruewhenever new URLs are provided, and reset appropriately when navigating between media items, ensuring accurate feedback to the user. (VideoPreview.vue[1]ImagePreview.vue[2] [3]Code consistency and maintainability:
cnutility for conditional class names, improving code consistency and maintainability. (VideoPreview.vue[1]ImagePreview.vue[2]┆Issue is synchronized with this Notion page by Unito