diff --git a/src/components/breadcrumb/SubgraphBreadcrumbItem.vue b/src/components/breadcrumb/SubgraphBreadcrumbItem.vue index ffadd86f82..4a325314fc 100644 --- a/src/components/breadcrumb/SubgraphBreadcrumbItem.vue +++ b/src/components/breadcrumb/SubgraphBreadcrumbItem.vue @@ -10,7 +10,8 @@ :class="{ 'flex items-center gap-1': isActive, 'p-breadcrumb-item-link-menu-visible': menu?.overlayVisible, - 'p-breadcrumb-item-link-icon-visible': isActive + 'p-breadcrumb-item-link-icon-visible': isActive, + 'active-breadcrumb-item': isActive }" @click="handleClick" > @@ -111,21 +112,7 @@ const menuItems = computed(() => { { label: t('g.rename'), icon: 'pi pi-pencil', - command: async () => { - let initialName = - workflowStore.activeSubgraph?.name ?? - workflowStore.activeWorkflow?.filename - - if (!initialName) return - - const newName = await dialogService.prompt({ - title: t('g.rename'), - message: t('breadcrumbsMenu.enterNewName'), - defaultValue: initialName - }) - - await rename(newName, initialName) - } + command: startRename }, { label: t('breadcrumbsMenu.duplicate'), @@ -175,20 +162,24 @@ const handleClick = (event: MouseEvent) => { menu.value?.hide() event.stopPropagation() event.preventDefault() - isEditing.value = true - itemLabel.value = props.item.label as string - void nextTick(() => { - if (itemInputRef.value?.$el) { - itemInputRef.value.$el.focus() - itemInputRef.value.$el.select() - if (wrapperRef.value) { - itemInputRef.value.$el.style.width = `${Math.max(200, wrapperRef.value.offsetWidth)}px` - } - } - }) + startRename() } } +const startRename = () => { + isEditing.value = true + itemLabel.value = props.item.label as string + void nextTick(() => { + if (itemInputRef.value?.$el) { + itemInputRef.value.$el.focus() + itemInputRef.value.$el.select() + if (wrapperRef.value) { + itemInputRef.value.$el.style.width = `${Math.max(200, wrapperRef.value.offsetWidth)}px` + } + } + }) +} + const inputBlur = async (doRename: boolean) => { if (doRename) { await rename(itemLabel.value, props.item.label as string) @@ -212,4 +203,8 @@ const inputBlur = async (doRename: boolean) => { .p-breadcrumb-item-label { @apply whitespace-nowrap text-ellipsis overflow-hidden; } + +.active-breadcrumb-item { + color: var(--text-primary); +}