From ada0993572bbc8585f3dc6525910935a9c645514 Mon Sep 17 00:00:00 2001 From: Jin Yi Date: Thu, 20 Nov 2025 04:13:03 +0900 Subject: [PATCH] feat: Improve MediaAssetCard design and add responsive sidebar footer (#6749) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Implements design feedback for the asset panel, improving visual hierarchy, contrast, and responsiveness based on design tokens update. ## Changes ### 🎨 Design System Updates (style.css) - **New tokens for MediaAssetCard states:** - `--modal-card-background-hovered`: Hover state background - `--modal-card-border-highlighted`: Selected state border color - **Updated tag contrast:** - Light mode: `smoke-200` β†’ `smoke-400` - Dark mode: `charcoal-200` β†’ `ash-800` - **Registered tokens in Tailwind** via `@theme inline` for proper class generation ### πŸ–ΌοΈ MediaAssetCard Improvements - **Added tooltips** to all interactive buttons: - Zoom button: "Inspect" - More button: "More options" - Output count button: "See more outputs" - **Fixed tooltip event conflicts** by wrapping buttons in tooltip divs - **Updated hover/selected states:** - Hover: Uses `--modal-card-background-hovered` for subtle highlight - Selected: Uses `--modal-card-border-highlighted` for border only (no background) - **Updated placeholder background** to use `--modal-card-placeholder-background` - **Tag styling:** Changed from `variant="light"` to `variant="gray"` for better contrast ### πŸ“¦ SquareChip Component - **Added `gray` variant** that uses `--modal-card-tag-background` token - Maintains consistency with design system tokens ### πŸ“± AssetsSidebarTab Responsive Footer - **Responsive button display:** - Width > 350px: Shows icon + text buttons - Width ≀ 350px: Shows icon-only buttons - **Text alignment:** Left-aligns selection count text in compact mode - **Uses `useResizeObserver`** for automatic width detection ### 🌐 Internationalization - Added new i18n keys for tooltips: - `mediaAsset.actions.inspect` - `mediaAsset.actions.more` - `mediaAsset.actions.seeMoreOutputs` ### πŸ”§ Minor Fixes - **Media3DTop:** Improved text size and icon color for better visual hierarchy ## Visual Changes - **Increased contrast** for asset card tags (more visible in both themes) - **Hover state** now provides clear visual feedback - **Selected state** uses border highlight instead of background fill - **Sidebar footer** gracefully adapts to narrow widths ## Related - Addresses feedback from: https://www.notion.so/comfy-org/Asset-panel-feedback-2aa6d73d3650800baacaf739a49360b3 - Design token updates by @Alex Tov ## Test Plan - [ ] Verify asset card hover states in both light and dark themes - [ ] Verify asset card selected states show highlighted border - [ ] Test tooltips on all MediaAssetCard buttons - [ ] Resize sidebar to < 350px and verify footer shows icon-only buttons - [ ] Resize sidebar to > 350px and verify footer shows icon + text buttons - [ ] Verify tag contrast improvement in both themes - [ ] Test 3D asset placeholder appearance ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6749-feat-Improve-MediaAssetCard-design-and-add-responsive-sidebar-footer-2b06d73d365081019b90e110df2f1ae8) by [Unito](https://www.unito.io) --- packages/design-system/src/css/style.css | 13 ++- src/components/chip/SquareChip.vue | 7 +- .../sidebar/tabs/AssetsSidebarTab.vue | 100 ++++++++++++------ src/locales/en/main.json | 5 + src/platform/assets/components/Media3DTop.vue | 4 +- .../assets/components/MediaAssetCard.vue | 65 +++++++----- 6 files changed, 125 insertions(+), 69 deletions(-) diff --git a/packages/design-system/src/css/style.css b/packages/design-system/src/css/style.css index 2afc56af1..9c75987f6 100644 --- a/packages/design-system/src/css/style.css +++ b/packages/design-system/src/css/style.css @@ -268,12 +268,13 @@ --palette-interface-button-hover-surface: color-mix(in srgb, var(--interface-panel-surface) 82%, var(--contrast-mix-color)); --modal-card-background: var(--secondary-background); + --modal-card-background-hovered: var(--secondary-background-hover); + --modal-card-border-highlighted: var(--secondary-background-selected); --modal-card-button-surface: var(--color-smoke-300); --modal-card-placeholder-background: var(--color-smoke-600); - --modal-card-tag-background: var(--color-smoke-200); + --modal-card-tag-background: var(--color-smoke-400); --modal-card-tag-foreground: var(--base-foreground); --modal-panel-background: var(--color-white); - } .dark-theme { @@ -377,9 +378,11 @@ --component-node-widget-background-highlighted: var(--color-graphite-400); --modal-card-background: var(--secondary-background); + --modal-card-background-hovered: var(--secondary-background-hover); + --modal-card-border-highlighted: var(--color-ash-400); --modal-card-button-surface: var(--color-charcoal-300); --modal-card-placeholder-background: var(--secondary-background); - --modal-card-tag-background: var(--color-charcoal-200); + --modal-card-tag-background: var(--color-ash-800); --modal-card-tag-foreground: var(--base-foreground); --modal-panel-background: var(--color-charcoal-600); @@ -395,12 +398,14 @@ --color-subscription-button-gradient: var(--subscription-button-gradient); --color-modal-card-background: var(--modal-card-background); + --color-modal-card-background-hovered: var(--modal-card-background-hovered); + --color-modal-card-border-highlighted: var(--modal-card-border-highlighted); --color-modal-card-button-surface: var(--modal-card-button-surface); --color-modal-card-placeholder-background: var(--modal-card-placeholder-background); --color-modal-card-tag-background: var(--modal-card-tag-background); --color-modal-card-tag-foreground: var(--modal-card-tag-foreground); --color-modal-panel-background: var(--modal-panel-background); - + --color-dialog-surface: var(--dialog-surface); --color-interface-menu-component-surface-hovered: var( --interface-menu-component-surface-hovered diff --git a/src/components/chip/SquareChip.vue b/src/components/chip/SquareChip.vue index 08f2fff38..b31e283db 100644 --- a/src/components/chip/SquareChip.vue +++ b/src/components/chip/SquareChip.vue @@ -11,7 +11,7 @@ import { cn } from '@/utils/tailwindUtil' const { label, variant = 'dark' } = defineProps<{ label: string - variant?: 'dark' | 'light' + variant?: 'dark' | 'light' | 'gray' }>() const baseClasses = @@ -19,7 +19,10 @@ const baseClasses = const variantStyles = { dark: 'bg-zinc-500/40 text-white/90', - light: cn('backdrop-blur-[2px] bg-base-background/50 text-base-foreground') + light: cn('backdrop-blur-[2px] bg-base-background/50 text-base-foreground'), + gray: cn( + 'backdrop-blur-[2px] bg-modal-card-tag-background text-base-foreground' + ) } const chipClasses = computed(() => { diff --git a/src/components/sidebar/tabs/AssetsSidebarTab.vue b/src/components/sidebar/tabs/AssetsSidebarTab.vue index ec473ca4d..7543216bd 100644 --- a/src/components/sidebar/tabs/AssetsSidebarTab.vue +++ b/src/components/sidebar/tabs/AssetsSidebarTab.vue @@ -97,43 +97,62 @@ @@ -145,11 +164,12 @@