mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 08:00:21 +00:00
## Summary Additional updates for app mode ## Changes - **What**: - Reposition toolbar button in app mode so it doesnt jump between modes - Move node name to under title on input/output selection - Change delete asset button text - Change exit builder button icon ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9530-feat-fix-App-mode-QA-fixes-31c6d73d365081738b5cc5beaf2cbd41) by [Unito](https://www.unito.io)
73 lines
1.9 KiB
Vue
73 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
import { computed, ref } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import Popover from '@/components/ui/Popover.vue'
|
|
import Button from '@/components/ui/button/Button.vue'
|
|
|
|
const { t } = useI18n()
|
|
|
|
const titleTooltip = ref<string | null>(null)
|
|
const subTitleTooltip = ref<string | null>(null)
|
|
|
|
function isTruncated(e: MouseEvent): boolean {
|
|
const el = e.currentTarget as HTMLElement
|
|
return el.scrollWidth > el.clientWidth
|
|
}
|
|
const { rename, remove } = defineProps<{
|
|
title: string
|
|
subTitle?: string
|
|
rename?: () => void
|
|
remove?: () => void
|
|
}>()
|
|
|
|
const entries = computed(() => {
|
|
const items = []
|
|
if (rename)
|
|
items.push({
|
|
label: t('g.rename'),
|
|
command: rename,
|
|
icon: 'icon-[lucide--pencil]'
|
|
})
|
|
if (remove)
|
|
items.push({
|
|
label: t('g.delete'),
|
|
command: remove,
|
|
icon: 'icon-[lucide--trash-2]'
|
|
})
|
|
return items
|
|
})
|
|
</script>
|
|
<template>
|
|
<div
|
|
class="my-2 flex items-center-safe gap-2 rounded-lg p-2"
|
|
data-testid="builder-io-item"
|
|
>
|
|
<div class="drag-handle mr-auto flex min-w-0 flex-col gap-1">
|
|
<div
|
|
v-tooltip.left="{ value: titleTooltip, showDelay: 300 }"
|
|
class="drag-handle truncate text-sm"
|
|
data-testid="builder-io-item-title"
|
|
@mouseenter="titleTooltip = isTruncated($event) ? title : null"
|
|
v-text="title"
|
|
/>
|
|
<div
|
|
v-tooltip.left="{ value: subTitleTooltip, showDelay: 300 }"
|
|
class="drag-handle truncate text-xs text-muted-foreground"
|
|
data-testid="builder-io-item-subtitle"
|
|
@mouseenter="
|
|
subTitleTooltip = isTruncated($event) ? (subTitle ?? null) : null
|
|
"
|
|
v-text="subTitle"
|
|
/>
|
|
</div>
|
|
<Popover :entries>
|
|
<template #button>
|
|
<Button variant="muted-textonly">
|
|
<i class="icon-[lucide--ellipsis]" />
|
|
</Button>
|
|
</template>
|
|
</Popover>
|
|
</div>
|
|
</template>
|