[nit] Add title to show full text in workflow template dialog (#3058)

This commit is contained in:
Chenlei Hu
2025-03-14 16:23:25 -04:00
committed by GitHub
parent 866d03b9c4
commit e1179aace0

View File

@@ -54,11 +54,15 @@
<div class="flex-1">
<h3
class="line-clamp-1 text-lg font-normal text-surface-900 dark:text-surface-100"
:title="title"
>
{{ title }}
</h3>
<p class="line-clamp-2 text-sm text-surface-600 dark:text text-muted">
{{ template.description.replace(/[-_]/g, ' ') }}
<p
class="line-clamp-2 text-sm text-surface-600 dark:text text-muted"
:title="description"
>
{{ description }}
</p>
</div>
<div
@@ -82,6 +86,7 @@ import AudioThumbnail from '@/components/templates/thumbnails/AudioThumbnail.vue
import CompareSliderThumbnail from '@/components/templates/thumbnails/CompareSliderThumbnail.vue'
import DefaultThumbnail from '@/components/templates/thumbnails/DefaultThumbnail.vue'
import HoverDissolveThumbnail from '@/components/templates/thumbnails/HoverDissolveThumbnail.vue'
import { st } from '@/i18n'
import { api } from '@/scripts/api'
import { TemplateInfo } from '@/types/workflowTemplateTypes'
import { normalizeI18nKey } from '@/utils/formatUtil'
@@ -122,12 +127,15 @@ const overlayThumbnailSrc = computed(() =>
const title = computed(() => {
return sourceModule === 'default'
? t(
`templateWorkflows.template.${normalizeI18nKey(categoryTitle)}.${normalizeI18nKey(template.name)}`
? st(
`templateWorkflows.template.${normalizeI18nKey(categoryTitle)}.${normalizeI18nKey(template.name)}`,
template.name
)
: template.name ?? `${sourceModule} Template`
})
const description = computed(() => template.description.replace(/[-_]/g, ' '))
defineEmits<{
loadWorkflow: [name: string]
}>()