Skip to content

Commit a1ab06a

Browse files
committed
[feat] Enhance workflow template card UI
- Move tutorial button to overlay on template image to avoid ceontent shift on hover - Increase description text display from 2 to 5 lines for more context - increase title size for readability - Improve card layout: larger image, cleaner borders and padding - Update SquareChip background for visual consistency (bg-black/20)
1 parent 75d31f9 commit a1ab06a

File tree

3 files changed

+24
-33
lines changed

3 files changed

+24
-33
lines changed

src/components/card/CardContainer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const containerClasses = computed(() => {
1818
'cursor-pointer flex flex-col bg-white dark-theme:bg-zinc-800 rounded-lg shadow-sm border border-zinc-200 dark-theme:border-zinc-700 overflow-hidden'
1919
2020
if (type === 'workflow-template-card') {
21-
return `cursor-pointer p-2 flex flex-col hover:bg-white dark-theme:hover:bg-zinc-800 rounded-lg transition-background duration-200 ease-in-out`
21+
return `cursor-pointer flex flex-col bg-white dark-theme:bg-zinc-900 rounded-lg shadow-sm border border-zinc-200 dark-theme:border-zinc-700 overflow-hidden hover:bg-white dark-theme:hover:bg-zinc-800 transition-background duration-200 ease-in-out`
2222
}
2323
2424
const ratioClasses = {

src/components/chip/SquareChip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="inline-flex justify-center items-center gap-1 shrink-0 py-1 px-2 text-xs bg-[#D9D9D966]/40 rounded font-bold text-white/90"
3+
class="inline-flex justify-center items-center gap-1 shrink-0 py-1 px-2 text-xs bg-black/20 rounded font-bold text-white/90"
44
>
55
<slot name="icon" class="text-xs text-white/90"></slot>
66
<span>{{ label }}</span>

src/components/custom/widget/WorkflowTemplateSelectorDialog.vue

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@
184184
<CardTop ratio="square">
185185
<template #default>
186186
<!-- Template Thumbnail -->
187-
<div
188-
class="w-full h-full relative rounded-lg overflow-hidden"
189-
>
187+
<div class="w-full h-full relative overflow-hidden">
190188
<template v-if="template.mediaType === 'audio'">
191189
<AudioThumbnail :src="getBaseThumbnailSrc(template)" />
192190
</template>
@@ -251,6 +249,19 @@
251249
v-if="loadingTemplate === template.name"
252250
class="absolute inset-0 z-10 w-12 h-12 m-auto"
253251
/>
252+
<button
253+
v-if="template.tutorialUrl"
254+
v-tooltip.bottom="{
255+
value: $t('g.seeTutorial'),
256+
pt: {
257+
text: { class: 'text-sm' }
258+
}
259+
}"
260+
class="absolute top-2 right-2 z-20 inline-flex items-center justify-center rounded-lg bg-black/20 w-8 h-8 cursor-pointer border-0"
261+
@click.stop="openTutorial(template)"
262+
>
263+
<i class="pi pi-question-circle text-white/80 text-lg" />
264+
</button>
254265
</div>
255266
</template>
256267
<template #bottom-right>
@@ -266,9 +277,9 @@
266277
</template>
267278
<template #bottom>
268279
<CardBottom>
269-
<div class="flex flex-col gap-2 pt-3">
280+
<div class="flex flex-col gap-2 p-4">
270281
<h3
271-
class="line-clamp-1 text-sm m-0"
282+
class="line-clamp-2 text-lg font-medium m-0"
272283
:title="
273284
getTemplateTitle(
274285
template,
@@ -283,31 +294,12 @@
283294
)
284295
}}
285296
</h3>
286-
<div class="flex justify-between gap-2">
287-
<div class="flex-1">
288-
<p
289-
class="line-clamp-2 text-sm text-muted m-0"
290-
:title="getTemplateDescription(template)"
291-
>
292-
{{ getTemplateDescription(template) }}
293-
</p>
294-
</div>
295-
<div
296-
v-if="template.tutorialUrl"
297-
class="flex flex-col-reverse justify-center"
298-
>
299-
<IconButton
300-
v-if="hoveredTemplate === template.name"
301-
v-tooltip.bottom="$t('g.seeTutorial')"
302-
v-bind="$attrs"
303-
type="primary"
304-
size="sm"
305-
@click.stop="openTutorial(template)"
306-
>
307-
<i class="icon-[lucide--info] size-4" />
308-
</IconButton>
309-
</div>
310-
</div>
297+
<p
298+
class="line-clamp-5 text-sm text-muted m-0"
299+
:title="getTemplateDescription(template)"
300+
>
301+
{{ getTemplateDescription(template) }}
302+
</p>
311303
</div>
312304
</CardBottom>
313305
</template>
@@ -378,7 +370,6 @@ import ProgressSpinner from 'primevue/progressspinner'
378370
import { computed, onBeforeUnmount, provide, ref, watch } from 'vue'
379371
import { useI18n } from 'vue-i18n'
380372
381-
import IconButton from '@/components/button/IconButton.vue'
382373
import IconTextButton from '@/components/button/IconTextButton.vue'
383374
import CardBottom from '@/components/card/CardBottom.vue'
384375
import CardContainer from '@/components/card/CardContainer.vue'

0 commit comments

Comments
 (0)