style: Apply linter fixes to layout system

This commit is contained in:
bymyself
2025-08-13 00:28:25 -07:00
parent 43d9678e68
commit a8dbe05749
2 changed files with 8 additions and 8 deletions

View File

@@ -131,7 +131,7 @@ import type {
NodeState,
VueNodeData
} from '@/composables/graph/useGraphNodeManager'
import { useLayoutSync } from '@/composables/graph/useLayout'
import { useLayout, useLayoutSync } from '@/composables/graph/useLayout'
import { useNodeBadge } from '@/composables/node/useNodeBadge'
import { useCanvasDrop } from '@/composables/useCanvasDrop'
import { useContextMenuTranslation } from '@/composables/useContextMenuTranslation'
@@ -174,6 +174,7 @@ const workspaceStore = useWorkspaceStore()
const canvasStore = useCanvasStore()
const executionStore = useExecutionStore()
const toastStore = useToastStore()
const { mutations: layoutMutations } = useLayout()
const betaMenuEnabled = computed(
() => settingStore.get('Comfy.UseNewMenu') !== 'Disabled'
)
@@ -479,13 +480,12 @@ const handleNodeSelect = (event: PointerEvent, nodeData: VueNodeData) => {
}
canvasStore.canvas.selectNode(node)
// Bring node to front when clicked (similar to LiteGraph behavior)
// Skip if node is pinned
if (!node.flags?.pinned) {
const { mutations } = useLayout()
mutations.setSource('vue')
mutations.bringNodeToFront(nodeData.id)
layoutMutations.setSource('vue')
layoutMutations.bringNodeToFront(nodeData.id)
}
node.selected = true

View File

@@ -134,13 +134,13 @@ class LayoutMutationsImpl implements LayoutMutations {
// Get all nodes to find the highest z-index
const allNodes = layoutStore.getAllNodes().value
let maxZIndex = 0
for (const [_, layout] of allNodes) {
for (const [, layout] of allNodes) {
if (layout.zIndex > maxZIndex) {
maxZIndex = layout.zIndex
}
}
// Set this node's z-index to be one higher than the current max
this.setNodeZIndex(nodeId, maxZIndex + 1)
}