diff --git a/browser_tests/interaction.spec.ts-snapshots/panned-touch-mobile-chrome-linux.png b/browser_tests/interaction.spec.ts-snapshots/panned-touch-mobile-chrome-linux.png
index ce20e7f1cc..35d3db2b65 100644
Binary files a/browser_tests/interaction.spec.ts-snapshots/panned-touch-mobile-chrome-linux.png and b/browser_tests/interaction.spec.ts-snapshots/panned-touch-mobile-chrome-linux.png differ
diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-2x-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-2x-linux.png
index 9ff50ec423..1c526b2ee6 100644
Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-2x-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-2x-linux.png differ
diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-linux.png
index 62a1bd24ec..2df854a13c 100644
Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/ksampler-resized-min-width-chromium-linux.png differ
diff --git a/src/assets/css/style.css b/src/assets/css/style.css
index 1e9596df41..cf150e4019 100644
--- a/src/assets/css/style.css
+++ b/src/assets/css/style.css
@@ -181,25 +181,6 @@ body {
margin: 3px 3px 3px 4px;
}
-.comfy-menu-hamburger {
- position: fixed;
- top: 10px;
- z-index: 9999;
- right: 10px;
- width: 30px;
- display: none;
- gap: 8px;
- flex-direction: column;
- cursor: pointer;
-}
-
-.comfy-menu-hamburger div {
- height: 3px;
- width: 100%;
- border-radius: 20px;
- background-color: white;
-}
-
.comfy-menu {
font-size: 15px;
position: absolute;
diff --git a/src/components/MenuHamburger.vue b/src/components/MenuHamburger.vue
new file mode 100644
index 0000000000..0fd68f9dd1
--- /dev/null
+++ b/src/components/MenuHamburger.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
diff --git a/src/components/graph/GraphCanvas.vue b/src/components/graph/GraphCanvas.vue
index c4c84d3419..bedb76826b 100644
--- a/src/components/graph/GraphCanvas.vue
+++ b/src/components/graph/GraphCanvas.vue
@@ -62,7 +62,9 @@ const workspaceStore = useWorkspaceStore()
const canvasStore = useCanvasStore()
const modelToNodeStore = useModelToNodeStore()
const betaMenuEnabled = computed(
- () => settingStore.get('Comfy.UseNewMenu') !== 'Disabled'
+ () =>
+ settingStore.get('Comfy.UseNewMenu') !== 'Disabled' &&
+ !workspaceStore.focusMode
)
const canvasMenuEnabled = computed(() =>
settingStore.get('Comfy.Graph.CanvasMenu')
diff --git a/src/components/topbar/TopMenubar.vue b/src/components/topbar/TopMenubar.vue
index 1766d94f89..aad9160e7e 100644
--- a/src/components/topbar/TopMenubar.vue
+++ b/src/components/topbar/TopMenubar.vue
@@ -29,13 +29,17 @@ import { computed, onMounted, provide, ref } from 'vue'
import { useSettingStore } from '@/stores/settingStore'
import { app } from '@/scripts/app'
import { useEventBus } from '@vueuse/core'
+import { useWorkspaceStore } from '@/stores/workspaceStateStore'
+const workspaceState = useWorkspaceStore()
const settingStore = useSettingStore()
const workflowTabsPosition = computed(() =>
settingStore.get('Comfy.Workflow.WorkflowTabsPosition')
)
const betaMenuEnabled = computed(
- () => settingStore.get('Comfy.UseNewMenu') !== 'Disabled'
+ () =>
+ settingStore.get('Comfy.UseNewMenu') !== 'Disabled' &&
+ !workspaceState.focusMode
)
const teleportTarget = computed(() =>
settingStore.get('Comfy.UseNewMenu') === 'Top'
diff --git a/src/scripts/ui.ts b/src/scripts/ui.ts
index 8695030ab8..c42c21dd78 100644
--- a/src/scripts/ui.ts
+++ b/src/scripts/ui.ts
@@ -8,6 +8,7 @@ import { TaskItem } from '@/types/apiTypes'
import { showSettingsDialog } from '@/services/dialogService'
import { useSettingStore } from '@/stores/settingStore'
import { useCommandStore } from '@/stores/commandStore'
+import { useWorkspaceStore } from '@/stores/workspaceStateStore'
export const ComfyDialog = _ComfyDialog
@@ -350,7 +351,6 @@ export class ComfyUI {
autoQueueMode: string
graphHasChanged: boolean
autoQueueEnabled: boolean
- menuHamburger: HTMLDivElement
menuContainer: HTMLDivElement
queueSize: Element
restoreMenuPosition: () => void
@@ -421,18 +421,6 @@ export class ComfyUI {
}
})
- this.menuHamburger = $el(
- 'div.comfy-menu-hamburger',
- {
- parent: containerElement,
- onclick: () => {
- this.menuContainer.style.display = 'block'
- this.menuHamburger.style.display = 'none'
- }
- },
- [$el('div'), $el('div'), $el('div')]
- ) as HTMLDivElement
-
this.menuContainer = $el('div.comfy-menu', { parent: containerElement }, [
$el(
'div.drag-handle.comfy-menu-header',
@@ -455,8 +443,7 @@ export class ComfyUI {
$el('button.comfy-close-menu-btn', {
textContent: '\u00d7',
onclick: () => {
- this.menuContainer.style.display = 'none'
- this.menuHamburger.style.display = 'flex'
+ useWorkspaceStore().focusMode = true
}
})
])
diff --git a/src/stores/commandStore.ts b/src/stores/commandStore.ts
index d1ec6400a2..78f9f579e8 100644
--- a/src/stores/commandStore.ts
+++ b/src/stores/commandStore.ts
@@ -19,6 +19,7 @@ import { useWorkflowStore } from './workflowStore'
import { type KeybindingImpl, useKeybindingStore } from './keybindingStore'
import { useBottomPanelStore } from './workspace/bottomPanelStore'
import { LGraphNode } from '@comfyorg/litegraph'
+import { useWorkspaceStore } from './workspaceStateStore'
export interface ComfyCommand {
id: string
@@ -467,6 +468,15 @@ export const useCommandStore = defineStore('command', () => {
function: () => {
useBottomPanelStore().toggleBottomPanel()
}
+ },
+ {
+ id: 'Workspace.ToggleFocusMode',
+ icon: 'pi pi-eye',
+ label: 'Toggle Focus Mode',
+ versionAdded: '1.3.27',
+ function: () => {
+ useWorkspaceStore().toggleFocusMode()
+ }
}
]
diff --git a/src/stores/coreKeybindings.ts b/src/stores/coreKeybindings.ts
index 77dd4db778..30dc01fea1 100644
--- a/src/stores/coreKeybindings.ts
+++ b/src/stores/coreKeybindings.ts
@@ -167,5 +167,11 @@ export const CORE_KEYBINDINGS: Keybinding[] = [
ctrl: true
},
commandId: 'Workspace.ToggleBottomPanelTab.integrated-terminal'
+ },
+ {
+ combo: {
+ key: 'f'
+ },
+ commandId: 'Workspace.ToggleFocusMode'
}
]
diff --git a/src/stores/workspaceStateStore.ts b/src/stores/workspaceStateStore.ts
index 25bbbc0ff9..d3bb2bb498 100644
--- a/src/stores/workspaceStateStore.ts
+++ b/src/stores/workspaceStateStore.ts
@@ -10,6 +10,11 @@ import { useSettingStore } from './settingStore'
export const useWorkspaceStore = defineStore('workspace', () => {
const spinner = ref(false)
const shiftDown = ref(false)
+ /**
+ * Whether the workspace is in focus mode.
+ * When in focus mode, only the graph editor is visible.
+ */
+ const focusMode = ref(false)
const toast = computed(() => useToastStore())
const queueSettings = computed(() => useQueueSettingsStore())
@@ -52,6 +57,10 @@ export const useWorkspaceStore = defineStore('workspace', () => {
return {
spinner,
shiftDown,
+ focusMode,
+ toggleFocusMode: () => {
+ focusMode.value = !focusMode.value
+ },
toast,
queueSettings,
command,
diff --git a/src/views/GraphView.vue b/src/views/GraphView.vue
index 054dd439da..7b5c0b1574 100644
--- a/src/views/GraphView.vue
+++ b/src/views/GraphView.vue
@@ -6,11 +6,12 @@
+