Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
4 changes: 4 additions & 0 deletions src/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
pointer-events: auto;
}

.node-selection-active .p-toast {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — This hides the entire toast layer, but GlobalToast only defers messages published after the mode becomes active, so a toast already on screen keeps running its PrimeVue life timer while invisible and expires unseen. Sticky (life-less) errors survive the hide, so the gap is limited to timed messages raised just before entry — worth a moment's thought about whether any of those matter. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).

visibility: hidden;
}

/* Use 0.001ms instead of 0s so transitionend/animationend events still fire
and JS listeners aren't broken. */
.disable-animations *,
Expand Down
59 changes: 44 additions & 15 deletions src/components/graph/GraphCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
<div
v-if="workflowTabsPosition === 'Topbar'"
data-testid="topbar-workflow-tabs"
class="workflow-tabs-container pointer-events-auto relative h-(--workflow-tabs-height) w-full"
:inert="agentNodeSelectionStore.isActionBarsHidden"
:class="
cn(
'workflow-tabs-container pointer-events-auto relative h-(--workflow-tabs-height) w-full transition-opacity duration-300',
agentNodeSelectionStore.isActionBarsHidden && 'opacity-0'
)
"
>
<div
class="flex h-full items-center border-b border-interface-stroke bg-comfy-menu-bg shadow-interface"
Expand All @@ -19,24 +25,43 @@
</div>
</template>
<template #side-toolbar>
<SideToolbar v-if="showUI && !isBuilderMode && !linearMode" />
<SideToolbar
v-if="
showUI &&
!isBuilderMode &&
!linearMode &&
!agentNodeSelectionStore.isActionBarsHidden
"
/>
</template>
<template v-if="showUI" #side-bar-panel>
<div
:inert="agentNodeSelectionStore.isActive"
class="sidebar-content-container size-full overflow-x-hidden overflow-y-auto transition-opacity duration-200 ease-in-out"
:class="{ 'opacity-0': agentNodeSelectionStore.isActive }"
:class="
cn(
'sidebar-content-container size-full overflow-x-hidden overflow-y-auto transition-opacity duration-200',
agentNodeSelectionStore.isActive && 'opacity-0'
)
"
>
<ExtensionSlot v-if="activeSidebarTab" :extension="activeSidebarTab" />
</div>
</template>
<template v-if="showUI && !isBuilderMode" #topmenu>
<template
v-if="
showUI && !isBuilderMode && !agentNodeSelectionStore.isActionBarsHidden
"
#topmenu
>
<TopMenuSection />
</template>
<template v-if="showUI" #bottom-panel>
<template v-if="showUI && !agentNodeSelectionStore.isActive" #bottom-panel>
<BottomPanel />
</template>
<template v-if="showUI" #right-side-panel>
<template
v-if="showUI && !agentNodeSelectionStore.isActive"
#right-side-panel
>
<AppBuilder v-if="isBuilderMode" />
<NodePropertiesPanel v-else />
</template>
Expand All @@ -49,13 +74,13 @@
class="pointer-events-none absolute inset-0"
/>
<GraphCanvasMenu
v-if="canvasMenuEnabled && !isBuilderMode"
v-if="
canvasMenuEnabled &&
!isBuilderMode &&
!agentNodeSelectionStore.isActive
"
class="pointer-events-auto"
/>
<!-- No node-selection condition here on purpose: entering the mode turns
the minimap setting off, so this reacts the same way it does to the
user's own toggle - and leaves them free to switch it back on while
they pick. -->
<MiniMap
v-if="
comfyAppReady && minimapEnabled && betaMenuEnabled && !isBuilderMode
Expand Down Expand Up @@ -104,10 +129,13 @@
:panel-el="canvasPanelBoundsRef ?? undefined"
/>

<NodeTooltip v-if="tooltipEnabled" />
<NodeSearchboxPopover ref="nodeSearchboxPopoverRef" />
<NodeTooltip v-if="tooltipEnabled && !agentNodeSelectionStore.isActive" />
<NodeSearchboxPopover
v-if="!agentNodeSelectionStore.isActive"
ref="nodeSearchboxPopoverRef"
/>
<NodeDragPreview />
<VueNodeSwitchPopup />
<VueNodeSwitchPopup v-if="!agentNodeSelectionStore.isActive" />

<!-- Initialize components after comfyApp is ready. useAbsolutePosition requires
canvasStore.canvas to be initialized. -->
Expand All @@ -121,6 +149,7 @@
</template>

<script setup lang="ts">
import { cn } from '@comfyorg/tailwind-utils'
import { until, useEventListener } from '@vueuse/core'
import {
computed,
Expand Down
3 changes: 1 addition & 2 deletions src/components/graph/NodeSelectionModeBanner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vi.mock('@/renderer/core/canvas/useCanvasInteractions', () => ({
}))

describe('NodeSelectionModeBanner', () => {
it('shows the selection instructions and exits from the CTA', async () => {
it('shows guidance and exits selection mode', async () => {
const pinia = createPinia()
setActivePinia(pinia)
const store = useAgentNodeSelectionStore()
Expand All @@ -30,7 +30,6 @@ describe('NodeSelectionModeBanner', () => {
).toBeVisible()

await userEvent.click(screen.getByRole('button', { name: 'Exit mode' }))

expect(store.isActive).toBe(false)
})
})
23 changes: 4 additions & 19 deletions src/components/toast/GlobalToast.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<Toast
position="bottom-right"
class="graph-toast top-[calc(anchor(--graph-canvas-panel_top,1rem)+0.25rem)] left-[calc(anchor(--graph-canvas-panel_right,anchor(--docked-agent-panel_left,calc(100vw-0.75rem)))-25.5rem)] z-10000 h-fit w-100 [&_.p-toast-close-button]:size-7 [&_.p-toast-close-icon]:size-4 [&_.p-toast-close-icon]:text-base [&_.p-toast-detail]:text-sm [&_.p-toast-message]:mb-4 [&_.p-toast-message]:min-h-[73px] [&_.p-toast-message-content]:gap-2 [&_.p-toast-message-content]:p-3 [&_.p-toast-message-icon]:size-4.5 [&_.p-toast-message-icon]:text-lg [&_.p-toast-message-text]:gap-2 [&_.p-toast-summary]:text-base"
class="graph-toast top-[calc(anchor(--graph-canvas-panel_top,1rem)+0.25rem)] left-[calc(anchor(--graph-canvas-panel_right,calc(100vw-var(--workspace-inset-right,0px)-0.75rem))-25.5rem)] z-10000 h-fit w-100 [&_.p-toast-close-button]:size-7 [&_.p-toast-close-icon]:size-4 [&_.p-toast-close-icon]:text-base [&_.p-toast-detail]:text-sm [&_.p-toast-message]:mb-4 [&_.p-toast-message]:min-h-[73px] [&_.p-toast-message-content]:gap-2 [&_.p-toast-message-content]:p-3 [&_.p-toast-message-icon]:size-4.5 [&_.p-toast-message-icon]:text-lg [&_.p-toast-message-text]:gap-2 [&_.p-toast-summary]:text-base"
/>
<Toast group="billing-operation" position="top-right">
<template #message="slotProps">
Expand Down Expand Up @@ -36,14 +36,6 @@ import { useAgentNodeSelectionStore } from '@/stores/agentNodeSelectionStore'
const toast = useToast()
const toastStore = useToastStore()
const agentNodeSelectionStore = useAgentNodeSelectionStore()

/**
* Messages raised while node selection mode is active. The mode hides the whole
* toast layer, and adding to a hidden layer would let anything carrying a `life`
* expire unseen - so they are held here and replayed on exit. Messages without a
* `life` are sticky in PrimeVue, so errors already on screen survive the hide
* untouched. Deliberately a plain array: nothing renders it.
*/
let deferredMessages: ToastMessageOptions[] = []

watch(
Expand All @@ -54,11 +46,8 @@ watch(
}

newMessages.forEach((message) => {
if (agentNodeSelectionStore.isActive) {
deferredMessages.push(message)
} else {
toast.add(message)
}
if (agentNodeSelectionStore.isActive) deferredMessages.push(message)
else toast.add(message)
})
toastStore.messagesToAdd = []
},
Expand All @@ -69,9 +58,7 @@ watch(
() => agentNodeSelectionStore.isActive,
(active) => {
if (active) return
deferredMessages.splice(0).forEach((message) => {
toast.add(message)
})
deferredMessages.splice(0).forEach((message) => toast.add(message))
}
)

Expand All @@ -95,8 +82,6 @@ watch(
(requested) => {
if (requested) {
toast.removeAllGroups()
// Held messages were cleared too - replaying them on exit would resurrect
// exactly what the caller just dismissed.
deferredMessages = []
toastStore.removeAllRequested = false
}
Expand Down
5 changes: 2 additions & 3 deletions src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5153,8 +5153,7 @@
"nodeSelection": {
"bannerTitle": "Add nodes from graph",
"bannerSubtitle": "Select one or many nodes to add as reference",
"exit": "Exit mode",
"selectNode": "Select node"
"exit": "Exit mode"
},
"addFromAssets": "Add from assets panel",
"assetNotAttachable": "Images, video, audio, 3D models, and text files can be attached",
Expand All @@ -5165,7 +5164,7 @@
"chatOptions": "Chat options",
"chooseWorkflow": "Choose a workflow",
"chooseWorkflowForChat": "Choose a workflow for this chat",
"dontWorkInWorkflow": "Don't work in a workflow",
"dontWorkInWorkflow": "Don’t work in a workflow",
"searchWorkflows": "Search workflows",
"selectWorkflowToGenerate": "Select a workflow to generate in",
"switchWorkflow": "Switch workflow",
Expand Down
Loading
Loading