Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions src/renderer/src/components/settings/ComfyUISettingsContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import {
EyeOff,
Settings2,
Repeat2,
Server
Server,
Ellipsis
} from 'lucide-vue-next'
import type { Component } from 'vue'
import { useComfyUISettings } from '../../composables/useComfyUISettings'
Expand Down Expand Up @@ -557,9 +558,15 @@ function actionIcon(id: string): Component {
}
}

const pinBottomMenuActions = computed<MenuAction[]>(() =>
pinBottomActions.value.map((action) => ({ ...action, icon: actionIcon(action.id) }))
)
const pinBottomMenuActions = computed<MenuAction[]>(() => {
const firstDanger = pinBottomActions.value.findIndex((action) => action.style === 'danger')
return pinBottomActions.value.map((action, index) => ({
...action,
icon: actionIcon(action.id),
style: action.id === 'untrack' || action.id === 'remove' ? undefined : action.style,
separator: index === firstDanger
}))
})

function handlePrimaryAction(): void {
const selectedInstall = installation.value
Expand Down Expand Up @@ -771,7 +778,10 @@ defineExpose({
:data-testid="TID.settingsTab(tab.key)"
@click="selectTab(tab.key)"
>
<span class="settings-v2-tab-icon-wrap relative inline-flex shrink-0 items-center">
<span
v-if="!isPage || (tab.key === 'update' && showUpdateBadge)"
class="settings-v2-tab-icon-wrap relative inline-flex shrink-0 items-center"
>
<component
:is="tab.icon"
v-if="!isPage"
Expand Down Expand Up @@ -1176,7 +1186,7 @@ defineExpose({
<div class="settings-v2-more-wrap relative inline-flex">
<Button
variant="secondary"
size="md"
:size="isPage ? 'icon' : 'md'"
type="button"
class="settings-v2-more"
data-more-trigger
Expand All @@ -1190,8 +1200,11 @@ defineExpose({
:data-testid="TID.pickerMoreTrigger"
@click="toggleMoreMenu"
>
{{ t('comfyUISettings.more') }}
<component :is="menuChevron" :size="14" />
<Ellipsis v-if="isPage" :size="16" aria-hidden="true" />
<template v-else>
{{ t('comfyUISettings.more') }}
<component :is="menuChevron" :size="14" />
</template>
</Button>
<MoreMenu
:open="moreMenuOpen"
Expand Down
48 changes: 25 additions & 23 deletions src/renderer/src/views/comfyUISettings/MoreMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import { computed, onBeforeUnmount, onMounted, ref, watch, type Component } from 'vue'
import Menu from '@comfyorg/design-system/menu/Menu'
import MenuItem from '@comfyorg/design-system/menu/MenuItem'
import MenuSeparator from '@comfyorg/design-system/menu/MenuSeparator'
import { TID } from '../../../../shared/testIds'
import type { ActionDef } from '../../types/ipc'

export type MenuAction = ActionDef & { icon?: Component }
export type MenuAction = ActionDef & { icon?: Component; separator?: boolean }
const props = defineProps<{
open: boolean
actions: MenuAction[]
Expand Down Expand Up @@ -68,28 +69,29 @@ onBeforeUnmount(() => window.removeEventListener('blur', onWindowBlur))
@close-auto-focus="onCloseAutoFocus"
>
<template #trigger><span hidden aria-hidden="true" /></template>
<MenuItem
v-for="action in actions"
:key="action.id"
as="button"
type="button"
:disabled="action.enabled === false"
class="more-menu-item w-full justify-start text-left"
:class="{
'is-danger text-destructive': action.style === 'danger',
'is-disabled': action.enabled === false
}"
:data-testid="TID.pinBottomAction(action.id)"
@select="handlePick(action)"
>
<span
v-if="hasIcons"
class="more-menu-item-icon inline-flex size-4 shrink-0 items-center justify-center"
aria-hidden="true"
<template v-for="(action, index) in actions" :key="action.id">
<MenuSeparator v-if="action.separator && index > 0" />
<MenuItem
as="button"
type="button"
:disabled="action.enabled === false"
class="more-menu-item w-full justify-start text-left"
:class="{
'is-danger text-destructive': action.style === 'danger',
'is-disabled': action.enabled === false
}"
:data-testid="TID.pinBottomAction(action.id)"
@select="handlePick(action)"
>
<component :is="action.icon" v-if="action.icon" :size="15" />
</span>
<span class="more-menu-item-label flex-auto">{{ action.label }}</span>
</MenuItem>
<span
v-if="hasIcons"
class="more-menu-item-icon inline-flex size-4 shrink-0 items-center justify-center"
aria-hidden="true"
>
<component :is="action.icon" v-if="action.icon" :size="15" />
</span>
<span class="more-menu-item-label flex-auto">{{ action.label }}</span>
</MenuItem>
</template>
</Menu>
</template>
Loading