Compare commits

...

2 Commits

Author SHA1 Message Date
Simula_r
5e1018aecf fix: lod wrapper and some style stuff 2025-10-03 13:37:02 -07:00
Rizumu Ayaka
661885f5e5 feat(widgets): lazy load images in FormDropdown (#5904)
some users may have a very large number of files, so we only need to
request/render the ones that are visible.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5904-feat-widgets-lazy-load-images-in-FormDropdown-2816d73d36508195b283ff469061f3f3)
by [Unito](https://www.unito.io)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-03 13:03:36 -07:00
3 changed files with 8 additions and 4 deletions

View File

@@ -89,7 +89,9 @@
<div class="relative">
<!-- Video Dimensions -->
<div class="text-white text-xs text-center mt-2">
<div
class="text-stone-700 dark-theme:text-white text-xs text-center mt-2 lod-toggle"
>
<span v-if="videoError" class="text-red-400">
{{ $t('g.errorLoadingVideo') }}
</span>

View File

@@ -4,7 +4,7 @@
</div>
<div
v-else
class="lg-node-header p-4 rounded-t-2xl cursor-move w-full"
class="lg-node-header p-4 rounded-t-2xl cursor-move"
:style="headerStyle"
:data-testid="`node-header-${nodeData?.id || ''}`"
@dblclick="handleDoubleClick"

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed, inject, ref } from 'vue'
import LazyImage from '@/components/common/LazyImage.vue'
import { cn } from '@/utils/tailwindUtil'
import { AssetKindKey, type LayoutMode } from './types'
@@ -102,10 +103,11 @@ function handleVideoLoad(event: Event) {
muted
@loadeddata="handleVideoLoad"
/>
<img
<LazyImage
v-else-if="mediaSrc"
:src="mediaSrc"
class="size-full object-cover"
:alt="name"
image-class="size-full object-cover"
@load="handleImageLoad"
/>
<div