-
Notifications
You must be signed in to change notification settings - Fork 461
Feat: Double Click on Image Assets to open the lightbox #6955
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
📝 WalkthroughWalkthroughThe changes simplify hover state management in MediaAssetCard by removing overlay hover tracking and refactoring button components, while adding a double-click "view" event emission to MediaImageTop. Changes
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
🎭 Playwright Test Results⏰ Completed at: 11/26/2025, 09:27:49 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 11/26/2025, 09:18:38 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.18 MB (baseline 3.18 MB) • 🟢 -907 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 946 kB (baseline 946 kB) • ⚪ 0 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 — 139 kB (baseline 139 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) • 🔴 +68 BBundles that do not match a named category
Status: 19 added / 19 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: 0
🧹 Nitpick comments (1)
src/platform/assets/components/MediaAssetCard.vue (1)
62-84: Actions overlay wiring looks solid and integrates well with the newviewflowThe refactored
IconGroupwithIconButton(inspect) andMoreButton(more actions) is clean, and all zoom entry points now consistently go throughhandleZoomClick:
- Direct inspect click (
@click.stop="handleZoomClick").- Context menu
@inspect="handleZoomClick".- Child media components emitting
view, which MediaAssetCard maps tohandleZoomClick.This keeps the zoom/lightbox behavior centralized and aligns nicely with the new double‑click path from
MediaImageTop.vue. Tooltips use existing i18n keys, so no new strings are introduced.From a UX angle, this means users can:
- single‑click the card to select (as before),
- use the inspect icon for a clear, discoverable zoom affordance, and
- double‑click the image area as a shortcut.
That combination feels reasonable; I wouldn’t gate selection on Shift/Ctrl unless you’ve seen concrete issues with accidental selection, since that would make selection less discoverable for new users.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/platform/assets/components/MediaAssetCard.vue(2 hunks)src/platform/assets/components/MediaImageTop.vue(2 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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.vue**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
src/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.vuesrc/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.vuesrc/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.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/platform/assets/components/MediaImageTop.vuesrc/platform/assets/components/MediaAssetCard.vue🧠 Learnings (8)
📓 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,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners📚 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 : Define proper props and emits definitions in Vue componentsApplied to files:
src/platform/assets/components/MediaImageTop.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 : Prefer emit/event-name for state changes over other communication patternsApplied to files:
src/platform/assets/components/MediaImageTop.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 : Implement proper props and emits definitionsApplied to files:
src/platform/assets/components/MediaImageTop.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 : Implement proper props and emits definitions in Vue componentsApplied to files:
src/platform/assets/components/MediaImageTop.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 : Replace PrimeVue OverlayPanel component with PopoverApplied to files:
src/platform/assets/components/MediaAssetCard.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 : Replace PrimeVue InputSwitch component with ToggleSwitchApplied to files:
src/platform/assets/components/MediaAssetCard.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 : Extract complex conditionals to computed propertiesApplied to files:
src/platform/assets/components/MediaAssetCard.vue⏰ 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 (2)
src/platform/assets/components/MediaImageTop.vue (1)
4-4: Double‑click →viewemit wiring looks correct; please verify selection behaviorThe new
@dblclick="emit('view')"on the root container and the addedview: []emit definition are consistent and type‑safe, and they give MediaAssetCard a clean hook to trigger the lightbox without changing the existing API.One thing to double‑check in the browser: a double‑click will still fire the underlying click handlers twice on ancestors in addition to the dblclick. Given the current selection model, please confirm that:
- a single click still selects the asset as before, and
- a double‑click both keeps the asset selected and opens the lightbox, without accidentally toggling selection off or causing a second, redundant zoom.
If this behaves as intended in the asset browser, the implementation here is good to go.
Also applies to: 30-33
src/platform/assets/components/MediaAssetCard.vue (1)
293-312: Hover/menu state consolidation viaisCardOrOverlayHoveredis a nice simplificationThe new
isCardOrOverlayHoveredcomputed that folds together card hover and menu‑open state:const isCardOrOverlayHovered = computed( () => isHovered.value || isMenuOpen.value )and its use in
showStaticChips/showActionsOverlaygives you:
- static chips only when not loading, asset is present, not hovered, not playing
- actions overlay whenever the card is hovered, the menu is open, or video is playing
This removes the need for a separate overlay‑hover flag while still keeping the overlay visible when the actions menu is open. The logic reads clearly and matches the intended behavior of “chips when idle, controls on interaction/playing”.
No changes needed from my side here.
## Summary Make it easier to open the lightbox preview. ## Review Focus The first click still selects the image. I liked the suggestion to require shift or ctrl to initiate selection and have click go back to the previous behavior. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6955-Feat-Double-Click-on-Image-Assets-to-open-the-lightbox-2b76d73d365081f0bf0de847add5c820) by [Unito](https://www.unito.io)
…ightbox (#7239) Backport of #6955 to `core/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7239-backport-core-1-33-Feat-Double-Click-on-Image-Assets-to-open-the-lightbox-2c36d73d36508107a168c49a5dad0bf7) by [Unito](https://www.unito.io) Co-authored-by: Alexander Brown <[email protected]>
Summary
Make it easier to open the lightbox preview.
Review Focus
The first click still selects the image. I liked the suggestion to require shift or ctrl to initiate selection and have click go back to the previous behavior.
┆Issue is synchronized with this Notion page by Unito