From e8dae57a6afcb72478507af027e2db4e3b95e69c Mon Sep 17 00:00:00 2001 From: bymyself Date: Thu, 4 Sep 2025 18:54:23 -0700 Subject: [PATCH] remove debug logging and setting --- src/components/graph/TransformPane.spec.ts | 71 +------------------ src/composables/graph/useSpatialIndex.ts | 14 ---- src/composables/useCoreCommands.ts | 15 ---- src/composables/useVueFeatureFlags.ts | 19 +---- src/constants/coreSettings.ts | 10 +-- src/lib/litegraph/src/LGraphCanvas.ts | 4 -- src/schemas/apiSchema.ts | 1 - src/stores/managerStateStore.ts | 8 --- .../composables/graph/useSpatialIndex.test.ts | 18 ----- 9 files changed, 5 insertions(+), 155 deletions(-) diff --git a/src/components/graph/TransformPane.spec.ts b/src/components/graph/TransformPane.spec.ts index ca4aab9db..79c494a38 100644 --- a/src/components/graph/TransformPane.spec.ts +++ b/src/components/graph/TransformPane.spec.ts @@ -105,62 +105,6 @@ describe('TransformPane', () => { }) }) - describe('debug overlay', () => { - it('should not show debug overlay by default', () => { - wrapper = mount(TransformPane, { - props: { - canvas: mockCanvas - } - }) - - expect(wrapper.find('.viewport-debug-overlay').exists()).toBe(false) - }) - - it('should show debug overlay when enabled', () => { - wrapper = mount(TransformPane, { - props: { - canvas: mockCanvas, - viewport: { width: 1920, height: 1080 }, - showDebugOverlay: true - } - }) - - expect(wrapper.find('.viewport-debug-overlay').exists()).toBe(true) - }) - - it('should display viewport dimensions in debug overlay', () => { - wrapper = mount(TransformPane, { - props: { - canvas: mockCanvas, - viewport: { width: 1280, height: 720 }, - showDebugOverlay: true - } - }) - - const debugOverlay = wrapper.find('.viewport-debug-overlay') - expect(debugOverlay.text()).toContain('Viewport: 1280x720') - }) - - it('should include device pixel ratio in debug overlay', () => { - // Mock device pixel ratio - Object.defineProperty(window, 'devicePixelRatio', { - writable: true, - value: 2 - }) - - wrapper = mount(TransformPane, { - props: { - canvas: mockCanvas, - viewport: { width: 1920, height: 1080 }, - showDebugOverlay: true - } - }) - - const debugOverlay = wrapper.find('.viewport-debug-overlay') - expect(debugOverlay.text()).toContain('DPR: 2') - }) - }) - describe('RAF synchronization', () => { it('should start RAF sync on mount', async () => { wrapper = mount(TransformPane, { @@ -405,26 +349,15 @@ describe('TransformPane', () => { }) describe('viewport prop handling', () => { - it('should handle missing viewport prop', () => { + it('should handle missing viewport prop', async () => { wrapper = mount(TransformPane, { props: { - canvas: mockCanvas, - showDebugOverlay: true + canvas: mockCanvas } }) // Should not crash when viewport is undefined expect(wrapper.exists()).toBe(true) - }) - - it('should update debug overlay when viewport changes', async () => { - wrapper = mount(TransformPane, { - props: { - canvas: mockCanvas, - viewport: { width: 800, height: 600 }, - showDebugOverlay: true - } - }) expect(wrapper.text()).toContain('800x600') diff --git a/src/composables/graph/useSpatialIndex.ts b/src/composables/graph/useSpatialIndex.ts index 95cd309d8..997e331f7 100644 --- a/src/composables/graph/useSpatialIndex.ts +++ b/src/composables/graph/useSpatialIndex.ts @@ -11,7 +11,6 @@ export interface SpatialIndexOptions { worldBounds?: Bounds maxDepth?: number maxItemsPerNode?: number - enableDebugVisualization?: boolean updateDebounceMs?: number } @@ -44,9 +43,6 @@ export const useSpatialIndex = (options: SpatialIndexOptions = {}) => { rebuildCount: 0 }) - // Debug visualization data (unused for now but may be used in future) - // const debugBounds = ref([]) - // Initialize QuadTree const initialize = (bounds: Bounds = defaultBounds) => { quadTree.value = new QuadTree(bounds, { @@ -173,13 +169,6 @@ export const useSpatialIndex = (options: SpatialIndexOptions = {}) => { batchUpdate(updates) } - // Get debug visualization data - const getDebugVisualization = () => { - if (!quadTree.value || !options.enableDebugVisualization) return null - - return quadTree.value.getDebugInfo() - } - // Debounced update for performance const debouncedUpdateNode = useDebounceFn( updateNode, @@ -203,9 +192,6 @@ export const useSpatialIndex = (options: SpatialIndexOptions = {}) => { // Metrics metrics: computed(() => metrics), - // Debug - getDebugVisualization, - // Direct access to QuadTree (for advanced usage) quadTree: computed(() => quadTree.value) } diff --git a/src/composables/useCoreCommands.ts b/src/composables/useCoreCommands.ts index 14ca35bc4..61ed889bb 100644 --- a/src/composables/useCoreCommands.ts +++ b/src/composables/useCoreCommands.ts @@ -294,21 +294,6 @@ export function useCoreCommands(): ComfyCommand[] { await settingStore.set('Comfy.VueNodes.Enabled', !current) } }, - { - id: 'Experimental.ToggleVueNodeDebugPanel', - label: () => - `Experimental: ${ - useSettingStore().get('Comfy.VueNodes.DebugPanel.Visible') - ? 'Hide' - : 'Show' - } Vue Node Debug Panel`, - function: async () => { - const settingStore = useSettingStore() - const current = - settingStore.get('Comfy.VueNodes.DebugPanel.Visible') ?? false - await settingStore.set('Comfy.VueNodes.DebugPanel.Visible', !current) - } - }, { id: 'Comfy.Canvas.FitView', icon: 'pi pi-expand', diff --git a/src/composables/useVueFeatureFlags.ts b/src/composables/useVueFeatureFlags.ts index 74d89ddf1..8816555d1 100644 --- a/src/composables/useVueFeatureFlags.ts +++ b/src/composables/useVueFeatureFlags.ts @@ -11,7 +11,6 @@ import { LiteGraph } from '../lib/litegraph/src/litegraph' export const useVueFeatureFlags = () => { const settingStore = useSettingStore() - // Enable Vue-based node rendering (off by default unless explicitly enabled) const isVueNodesEnabled = computed(() => { try { return settingStore.get('Comfy.VueNodes.Enabled') ?? false @@ -20,27 +19,12 @@ export const useVueFeatureFlags = () => { } }) - // Development mode features (debug panel, etc.) - const isDevModeEnabled = computed(() => { - try { - return ( - (settingStore.get('Comfy.DevMode' as any) as boolean | undefined) ?? - process.env.NODE_ENV === 'development' - ) - } catch { - return process.env.NODE_ENV === 'development' - } - }) - // Whether Vue nodes should render - const shouldRenderVueNodes = computed( - () => isVueNodesEnabled.value && true // hook for additional safety checks - ) + const shouldRenderVueNodes = computed(() => isVueNodesEnabled.value) // Sync the Vue nodes flag with LiteGraph global settings const syncVueNodesFlag = () => { LiteGraph.vueNodesMode = isVueNodesEnabled.value - console.log('Vue nodes mode:', LiteGraph.vueNodesMode) } // Watch for changes and update LiteGraph immediately @@ -48,7 +32,6 @@ export const useVueFeatureFlags = () => { return { isVueNodesEnabled, - isDevModeEnabled, shouldRenderVueNodes, syncVueNodesFlag } diff --git a/src/constants/coreSettings.ts b/src/constants/coreSettings.ts index 84ade2ef6..9b6a2a02c 100644 --- a/src/constants/coreSettings.ts +++ b/src/constants/coreSettings.ts @@ -964,13 +964,7 @@ export const CORE_SETTINGS: SettingParams[] = [ tooltip: 'Render nodes as Vue components instead of canvas. Hidden; toggle via Experimental keybinding.', defaultValue: false, - experimental: true - }, - { - id: 'Comfy.VueNodes.DebugPanel.Visible', - name: 'Vue Nodes Debug Panel Visible (hidden)', - type: 'hidden', - defaultValue: false, - experimental: true + experimental: true, + versionAdded: '1.27.1' } ] diff --git a/src/lib/litegraph/src/LGraphCanvas.ts b/src/lib/litegraph/src/LGraphCanvas.ts index 8ad10a41d..eb38a02e0 100644 --- a/src/lib/litegraph/src/LGraphCanvas.ts +++ b/src/lib/litegraph/src/LGraphCanvas.ts @@ -8248,12 +8248,8 @@ export class LGraphCanvas let reroute: Reroute | undefined if (rerouteLayout) { - console.debug('✅ Using LayoutStore for reroute query', { - rerouteLayout - }) reroute = this.graph.getReroute(rerouteLayout.id) } else { - console.debug('⚠️ Falling back to old reroute query method') reroute = this.graph.getRerouteOnPos( event.canvasX, event.canvasY, diff --git a/src/schemas/apiSchema.ts b/src/schemas/apiSchema.ts index 75b3282e1..874449665 100644 --- a/src/schemas/apiSchema.ts +++ b/src/schemas/apiSchema.ts @@ -479,7 +479,6 @@ const zSettings = z.object({ 'Comfy.Minimap.RenderErrorState': z.boolean(), 'Comfy.Canvas.NavigationMode': z.string(), 'Comfy.VueNodes.Enabled': z.boolean(), - 'Comfy.VueNodes.DebugPanel.Visible': z.boolean(), 'Comfy-Desktop.AutoUpdate': z.boolean(), 'Comfy-Desktop.SendStatistics': z.boolean(), 'Comfy-Desktop.WindowStyle': z.string(), diff --git a/src/stores/managerStateStore.ts b/src/stores/managerStateStore.ts index 2dece29a7..6ba37e80d 100644 --- a/src/stores/managerStateStore.ts +++ b/src/stores/managerStateStore.ts @@ -28,14 +28,6 @@ export const useManagerStateStore = defineStore('managerState', () => { 'extension.manager.supports_v4' ) - console.log('[Manager State Debug]', { - systemStats: systemStats?.system?.argv, - clientSupportsV4, - serverSupportsV4, - hasLegacyManager, - extensions: extensionStore.extensions.map((e) => e.name) - }) - // Check command line args first if (systemStats?.system?.argv?.includes('--disable-manager')) { return ManagerUIState.DISABLED // comfyui_manager package not installed diff --git a/tests-ui/tests/composables/graph/useSpatialIndex.test.ts b/tests-ui/tests/composables/graph/useSpatialIndex.test.ts index c8dee40df..4e34c0f04 100644 --- a/tests-ui/tests/composables/graph/useSpatialIndex.test.ts +++ b/tests-ui/tests/composables/graph/useSpatialIndex.test.ts @@ -427,24 +427,6 @@ describe('useSpatialIndex', () => { }) }) - describe('getDebugVisualization', () => { - it('should return null when debug is disabled', () => { - const { getDebugVisualization } = spatialIndex - - expect(getDebugVisualization()).toBeNull() - }) - - it('should return debug info when enabled', () => { - const debugIndex = useSpatialIndex({ enableDebugVisualization: true }) - debugIndex.initialize() - - const debug = debugIndex.getDebugVisualization() - expect(debug).not.toBeNull() - expect(debug).toHaveProperty('size') - expect(debug).toHaveProperty('tree') - }) - }) - describe('metrics', () => { it('should track performance metrics', () => { const { metrics, updateNode, queryViewport } = spatialIndex