Compare commits

...

4 Commits

Author SHA1 Message Date
bymyself
c30e1faa22 refactor 2025-11-13 10:05:29 -08:00
bymyself
8bb1d5724b move data model to workfbench 2025-11-11 11:34:37 -08:00
Christian Byrne
6c9743c1a6 fix(vite): use dynamic base URL based on cloud distribution (#6562)
## Summary
- Replace hardcoded `<base href="/">` in index.html with dynamic vite
base config
- Set `base: DISTRIBUTION === 'cloud' ? '/' : ''` in vite.config.mts
- Ensures proper asset loading across different deployment contexts

## Test plan
- [ ] Verify cloud distribution builds work correctly
- [ ] Verify localhost/desktop distributions work correctly
- [ ] Test asset loading in both contexts

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6562-fix-vite-use-dynamic-base-URL-based-on-cloud-distribution-2a06d73d365081c8b5d2e58870ebd14d)
by [Unito](https://www.unito.io)
2025-11-04 13:34:41 -07:00
Christian Byrne
4ab1e824b7 hide minimap on mobile by default (#6579)
If below large breakpoint, hide the minimap by default. If the user has
set the setting before (or closed minimap), their preference will
override this.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6579-hide-minimap-on-mobile-by-default-2a16d73d365081db9c66d209ee046097)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-11-04 13:11:58 -07:00
14 changed files with 73 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -13,5 +13,5 @@
<script setup lang="ts">
import Button from 'primevue/button'
import { showSubgraphNodeDialog } from '@/core/graph/subgraph/useSubgraphNodeDialog'
import { showSubgraphNodeDialog } from '@/workbench/graph/subgraph/useSubgraphNodeDialog'
</script>

View File

@@ -5,8 +5,7 @@ import {
DEFAULT_DARK_COLOR_PALETTE,
DEFAULT_LIGHT_COLOR_PALETTE
} from '@/constants/coreColorPalettes'
import { tryToggleWidgetPromotion } from '@/core/graph/subgraph/proxyWidgetUtils'
import { showSubgraphNodeDialog } from '@/core/graph/subgraph/useSubgraphNodeDialog'
import { showSubgraphNodeDialog } from '@/workbench/graph/subgraph/useSubgraphNodeDialog'
import { t } from '@/i18n'
import {
LGraphEventMode,
@@ -37,6 +36,7 @@ import { api } from '@/scripts/api'
import { app } from '@/scripts/app'
import { useDialogService } from '@/services/dialogService'
import { useLitegraphService } from '@/services/litegraphService'
import { invokeToggleWidgetPromotion } from '@/services/widgetPromotionHandlers'
import type { ComfyCommand } from '@/stores/commandStore'
import { useExecutionStore } from '@/stores/executionStore'
import { useHelpCenterStore } from '@/stores/helpCenterStore'
@@ -1027,7 +1027,7 @@ export function useCoreCommands(): ComfyCommand[] {
icon: 'icon-[lucide--arrow-left-right]',
label: 'Toggle promotion of hovered widget',
versionAdded: '1.30.1',
function: tryToggleWidgetPromotion
function: () => invokeToggleWidgetPromotion()
},
{
id: 'Comfy.OpenManagerDialog',

View File

@@ -6,6 +6,7 @@ import type { ColorPalettes } from '@/schemas/colorPaletteSchema'
import type { Keybinding } from '@/schemas/keyBindingSchema'
import { NodeBadgeMode } from '@/types/nodeSource'
import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'
import { breakpointsTailwind } from '@vueuse/core'
/**
* Core settings are essential configuration parameters required for ComfyUI's basic functionality.
@@ -951,7 +952,7 @@ export const CORE_SETTINGS: SettingParams[] = [
id: 'Comfy.Minimap.Visible',
name: 'Display minimap on canvas',
type: 'hidden',
defaultValue: true,
defaultValue: window.innerWidth >= breakpointsTailwind.lg,
versionAdded: '1.25.0'
},
{

View File

@@ -1,7 +1,7 @@
import {
demoteWidget,
promoteRecommendedWidgets
} from '@/core/graph/subgraph/proxyWidgetUtils'
} from '@/renderer/graph/subgraph/proxyWidgetUtils'
import { parseProxyWidgets } from '@/core/schemas/proxyWidget'
import type { NodeProperty } from '@/lib/litegraph/src/LGraphNode'
import type {

View File

@@ -3,7 +3,7 @@ import type { ProxyWidgetsProperty } from '@/core/schemas/proxyWidget'
import {
isProxyWidget,
isDisconnectedWidget
} from '@/core/graph/subgraph/proxyWidget'
} from '@/renderer/graph/subgraph/proxyWidget'
import { t } from '@/i18n'
import type {
IContextMenuValue,
@@ -14,6 +14,7 @@ import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets.ts'
import { useToastStore } from '@/platform/updates/common/toastStore'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import { useLitegraphService } from '@/services/litegraphService'
import { registerWidgetPromotionHandlers } from '@/services/widgetPromotionHandlers'
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
type PartialNode = Pick<LGraphNode, 'title' | 'id' | 'type'>
@@ -86,7 +87,7 @@ function getParentNodes(): SubgraphNode[] {
)
}
export function addWidgetPromotionOptions(
function addWidgetPromotionOptions(
options: (IContextMenuValue<unknown> | null)[],
widget: IBaseWidget,
node: LGraphNode
@@ -111,7 +112,7 @@ export function addWidgetPromotionOptions(
})
}
}
export function tryToggleWidgetPromotion() {
function tryToggleWidgetPromotion() {
const canvas = useCanvasStore().getCanvas()
const [x, y] = canvas.graph_mouse
const node = canvas.graph?.getNodeOnPos(x, y, canvas.visible_nodes)
@@ -174,3 +175,8 @@ export function pruneDisconnected(subgraphNode: SubgraphNode) {
.filter((w) => !isDisconnectedWidget(w))
.map((w) => [w._overlay.nodeId, w._overlay.widgetName])
}
registerWidgetPromotionHandlers({
addWidgetPromotionOptions,
tryToggleWidgetPromotion
})

View File

@@ -5,7 +5,7 @@ import { reactive, unref } from 'vue'
import { shallowRef } from 'vue'
import { useCanvasPositionConversion } from '@/composables/element/useCanvasPositionConversion'
import { registerProxyWidgets } from '@/core/graph/subgraph/proxyWidget'
import { registerProxyWidgets } from '@/renderer/graph/subgraph/proxyWidget'
import { st, t } from '@/i18n'
import type { IContextMenuValue } from '@/lib/litegraph/src/interfaces'
import {

View File

@@ -5,8 +5,7 @@ import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteG
import { useNodeAnimatedImage } from '@/composables/node/useNodeAnimatedImage'
import { useNodeCanvasImagePreview } from '@/composables/node/useNodeCanvasImagePreview'
import { useNodeImage, useNodeVideo } from '@/composables/node/useNodeImage'
import { addWidgetPromotionOptions } from '@/core/graph/subgraph/proxyWidgetUtils'
import { showSubgraphNodeDialog } from '@/core/graph/subgraph/useSubgraphNodeDialog'
import { showSubgraphNodeDialog } from '@/workbench/graph/subgraph/useSubgraphNodeDialog'
import { st, t } from '@/i18n'
import {
LGraphCanvas,
@@ -58,6 +57,7 @@ import {
import { getOrderedInputSpecs } from '@/utils/nodeDefOrderingUtil'
import { useExtensionService } from './extensionService'
import { addWidgetPromotionOptions as invokeAddWidgetPromotionOptions } from './widgetPromotionHandlers'
export const CONFIG = Symbol()
export const GET_CONFIG = Symbol()
@@ -826,7 +826,7 @@ export const useLitegraphService = () => {
const [x, y] = canvas.graph_mouse
const overWidget = this.getWidgetOnPos(x, y, true)
if (overWidget) {
addWidgetPromotionOptions(options, overWidget, this)
invokeAddWidgetPromotionOptions(options, overWidget, this)
}
}

View File

@@ -0,0 +1,41 @@
import { shallowRef } from 'vue'
import type {
IContextMenuValue,
LGraphNode
} from '@/lib/litegraph/src/litegraph'
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
type WidgetPromotionHandlers = {
addWidgetPromotionOptions?: (
options: (IContextMenuValue<unknown> | null)[],
widget: IBaseWidget,
node: LGraphNode
) => void
tryToggleWidgetPromotion?: () => void
}
const handlersRef = shallowRef<WidgetPromotionHandlers>({})
export const registerWidgetPromotionHandlers = (
handlers: WidgetPromotionHandlers
) => {
handlersRef.value = handlers
return () => {
if (handlersRef.value === handlers) {
handlersRef.value = {}
}
}
}
export const invokeToggleWidgetPromotion = () => {
handlersRef.value.tryToggleWidgetPromotion?.()
}
export const addWidgetPromotionOptions = (
options: (IContextMenuValue<unknown> | null)[],
widget: IBaseWidget,
node: LGraphNode
) => {
handlersRef.value.addWidgetPromotionOptions?.(options, widget, node)
}

View File

@@ -10,7 +10,12 @@ import {
} from 'vue'
import SearchBox from '@/components/common/SearchBox.vue'
import SubgraphNodeWidget from '@/core/graph/subgraph/SubgraphNodeWidget.vue'
import { parseProxyWidgets } from '@/core/schemas/proxyWidget'
import type { ProxyWidgetsProperty } from '@/core/schemas/proxyWidget'
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
import { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import {
demoteWidget,
isRecommendedWidget,
@@ -19,17 +24,12 @@ import {
promoteWidget,
pruneDisconnected,
widgetItemToProperty
} from '@/core/graph/subgraph/proxyWidgetUtils'
import type { WidgetItem } from '@/core/graph/subgraph/proxyWidgetUtils'
import { parseProxyWidgets } from '@/core/schemas/proxyWidget'
import type { ProxyWidgetsProperty } from '@/core/schemas/proxyWidget'
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
import { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
} from '@/renderer/graph/subgraph/proxyWidgetUtils'
import type { WidgetItem } from '@/renderer/graph/subgraph/proxyWidgetUtils'
import { DraggableList } from '@/scripts/ui/draggableList'
import { useLitegraphService } from '@/services/litegraphService'
import { useDialogStore } from '@/stores/dialogStore'
import SubgraphNodeWidget from '@/workbench/graph/subgraph/SubgraphNodeWidget.vue'
const canvasStore = useCanvasStore()

View File

@@ -1,4 +1,4 @@
import SubgraphNode from '@/core/graph/subgraph/SubgraphNode.vue'
import SubgraphNode from '@/workbench/graph/subgraph/SubgraphNode.vue'
import { useDialogStore } from '@/stores/dialogStore'
import type { DialogComponentProps } from '@/stores/dialogStore'

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from 'vitest'
import { registerProxyWidgets } from '@/core/graph/subgraph/proxyWidget'
import { registerProxyWidgets } from '@/renderer/graph/subgraph/proxyWidget'
import { parseProxyWidgets } from '@/core/schemas/proxyWidget'
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
import type { LGraphCanvas, SubgraphNode } from '@/lib/litegraph/src/litegraph'

View File

@@ -131,7 +131,7 @@ const gcsRedirectProxyConfig: ProxyOptions = {
}
export default defineConfig({
base: '',
base: DISTRIBUTION === 'cloud' ? '/' : '',
server: {
host: VITE_REMOTE_DEV ? '0.0.0.0' : undefined,
watch: {