diff --git a/.agents/checks/pattern-compliance.md b/.agents/checks/pattern-compliance.md index 2b181ec1649..b05aa4591c0 100644 --- a/.agents/checks/pattern-compliance.md +++ b/.agents/checks/pattern-compliance.md @@ -22,6 +22,7 @@ Steps: - Explicit return types on exported functions - Use `es-toolkit` for utility functions, NOT lodash. Flag any new `import ... from 'lodash'` or `import ... from 'lodash/*'` - Never use `z.any()` in Zod schemas — use `z.unknown()` and narrow +- Never hand-declare or duplicate server/API response types locally — flag any local interface/type that reimplements a type already generated from an OpenAPI spec (e.g. `@comfyorg/ingest-types`, `@comfyorg/registry-types` in `packages/`) instead of importing it. This caused real bugs in PR #14771 (see `docs/guidance/typescript.md`) ### Vue (if applicable) diff --git a/.agents/setup b/.agents/setup index c3c6d02e7e7..67f3fa889c7 100755 --- a/.agents/setup +++ b/.agents/setup @@ -3,6 +3,11 @@ set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$repo_root" + +if [[ "${AMP_ORB:-}" == 1 ]]; then + gh auth setup-git +fi + node_major="$(tr -d '[:space:]' < "$repo_root/.nvmrc")" node_home="$HOME/.local/share/comfyui-frontend-node-v$node_major" @@ -56,16 +61,10 @@ if [[ ! -x "$node_home/bin/pnpm" ]] || npm install --global --prefix "$node_home" "pnpm@$pnpm_version" fi -profile_marker="# ComfyUI Frontend orb toolchain" -if ! grep -Fqx "$profile_marker" "$HOME/.bash_profile" 2>/dev/null; then - cat >> "$HOME/.bash_profile" <apps/website/src/components/ui/button-mask/index.ts", + "browser_tests/fixtures/ComfyPage.ts->browser_tests/fixtures/components/QueuePanel.ts", + "browser_tests/fixtures/ComfyPage.ts->browser_tests/fixtures/components/SubgraphEditor.ts->browser_tests/fixtures/helpers/SubgraphHelper.ts", + "src/components/dialog/content/setting/keybinding/EditKeybindingFooter.vue->src/composables/useEditKeybindingDialog.ts", + "src/composables/graph/useMoreOptionsMenu.ts->src/composables/graph/useSelectionMenuOptions.ts", + "src/composables/maskeditor/useCanvasHistory.ts->src/stores/maskEditorStore.ts", + "src/composables/node/usePriceBadge.ts->src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts", + "src/composables/sidebarTabs/useJobHistorySidebarTab.ts->src/stores/workspace/sidebarTabStore.ts", + "src/composables/useLoad3d.ts->src/services/load3dService.ts", + "src/composables/useLoad3dViewer.ts->src/services/load3dService.ts", + "src/composables/usePaste.ts->src/scripts/app.ts", + "src/core/graph/subgraph/promotionUtils.ts->src/renderer/core/canvas/canvasStore.ts", + "src/core/graph/subgraph/promotionUtils.ts->src/services/litegraphService.ts", + "src/core/graph/widgets/dynamicWidgets.ts->src/services/litegraphService.ts", + "src/extensions/core/load3d/Load3dUtils.ts->src/scripts/app.ts", + "src/lib/litegraph/src/ContextMenu.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/ContextMenu.ts->src/lib/litegraph/src/LiteGraphGlobal.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/DragAndScale.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/DragAndScale.ts->src/lib/litegraph/src/LGraphCanvas.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/DragAndScale.ts->src/lib/litegraph/src/LiteGraphGlobal.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/LGraph.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/LGraphCanvas.ts->src/lib/litegraph/src/LGraphGroup.ts", + "src/lib/litegraph/src/LGraphCanvas.ts->src/lib/litegraph/src/LGraphNode.ts", + "src/lib/litegraph/src/LGraphCanvas.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/LGraphGroup.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/LGraphNode.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/LGraphNode.ts->src/lib/litegraph/src/utils/collections.ts", + "src/lib/litegraph/src/Reroute.ts->src/lib/litegraph/src/litegraph.ts", + "src/lib/litegraph/src/litegraph.ts->src/lib/litegraph/src/node/NodeInputSlot.ts", + "src/lib/litegraph/src/litegraph.ts->src/lib/litegraph/src/node/NodeOutputSlot.ts", + "src/lib/litegraph/src/litegraph.ts->src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts", + "src/lib/litegraph/src/litegraph.ts->src/lib/litegraph/src/subgraph/SubgraphNode.ts", + "src/lib/litegraph/src/litegraph.ts->src/lib/litegraph/src/subgraph/subgraphUtils.ts", + "src/lib/litegraph/src/litegraph.ts->src/lib/litegraph/src/widgets/LegacyWidget.ts", + "src/lib/litegraph/src/node/NodeInputSlot.ts->src/lib/litegraph/src/node/NodeSlot.ts", + "src/platform/cloud/subscription/composables/useSubscriptionDialog.ts->src/services/dialogService.ts", + "src/platform/missingMedia/missingMediaStore.ts->src/scripts/app.ts", + "src/platform/missingModel/missingModelStore.ts->src/scripts/app.ts", + "src/platform/settings/settingStore.ts->src/scripts/app.ts", + "src/platform/telemetry/utils/getExecutionContext.ts->src/scripts/app.ts", + "src/platform/workflow/core/services/workflowService.ts->src/scripts/app.ts", + "src/platform/workflow/core/services/workflowService.ts->src/stores/subgraphNavigationStore.ts", + "src/platform/workflow/management/stores/workflowStore.ts->src/scripts/app.ts", + "src/platform/workspace/stores/teamWorkspaceStore.ts->src/platform/workspace/stores/workspaceAuthStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue->src/workbench/extensions/manager/composables/nodePack/usePackInstall.ts->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue->src/workbench/extensions/manager/composables/nodePack/usePackInstall.ts->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue->src/workbench/extensions/manager/composables/nodePack/usePackInstall.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/button/PackUpdateButton.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/PackVersionBadge.vue->src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/PackVersionBadge.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/button/PackEnableToggle.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/packCard/PackCard.vue->src/workbench/extensions/manager/components/manager/packCard/PackCardFooter.vue->src/workbench/extensions/manager/composables/useConflictDetection.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/components/manager/packCard/PackCard.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/composables/nodePack/useMissingNodes.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/composables/nodePack/useUpdateAvailableNodes.ts->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerDisplayPacks.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue->src/workbench/extensions/manager/composables/useManagerDialog.ts->src/workbench/extensions/manager/composables/useManagerState.ts->src/workbench/extensions/manager/services/comfyManagerService.ts->src/workbench/extensions/manager/stores/comfyManagerStore.ts" + ], + "re_export_cycles": [], + "unused_optional_dependencies": [], + "unused_enum_members": [ + "packages/object-info-parser/src/classifiers/nodeSource.ts:NodeBadgeMode.None", + "packages/object-info-parser/src/classifiers/nodeSource.ts:NodeBadgeMode.ShowAll", + "packages/object-info-parser/src/classifiers/nodeSource.ts:NodeBadgeMode.HideBuiltIn", + "src/lib/litegraph/src/draw.ts:SlotShape.Circle", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.None", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.TopLeft", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.TopCentre", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.TopRight", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.MidCentre", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.BottomLeft", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.BottomCentre", + "src/lib/litegraph/src/types/globalEnums.ts:Alignment.BottomRight" + ], + "unused_class_members": [ + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.recordingButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.stopRecordingButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.downloadRecordingMenuItem", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.startNewRecordingMenuItem", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.deleteRecordingMenuItem", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.gridToggleButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.uploadBackgroundImageButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.removeBackgroundImageButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.panoramaModeButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.exportButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.openViewerButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.gizmoToggleButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.gizmoTranslateButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.gizmoRotateButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.gizmoScaleButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.gizmoResetButton", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.openRecordingMenu", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.openGizmoCategory", + "browser_tests/tests/load3d/Load3DHelper.ts:Load3DHelper.setBackgroundColor", + "browser_tests/tests/load3d/Load3DViewerHelper.ts:Load3DViewerHelper.canvas", + "browser_tests/tests/load3d/Load3DViewerHelper.ts:Load3DViewerHelper.sidebar", + "browser_tests/tests/load3d/Load3DViewerHelper.ts:Load3DViewerHelper.cancelButton", + "browser_tests/tests/load3d/Load3DViewerHelper.ts:Load3DViewerHelper.waitForOpen", + "browser_tests/tests/load3d/Load3DViewerHelper.ts:Load3DViewerHelper.waitForClosed", + "browser_tests/tests/propertiesPanel/PropertiesPanelHelper.ts:PropertiesPanelHelper.tabs", + "browser_tests/tests/propertiesPanel/PropertiesPanelHelper.ts:PropertiesPanelHelper.subgraphEditButton", + "browser_tests/tests/propertiesPanel/PropertiesPanelHelper.ts:PropertiesPanelHelper.collapseToggleButton", + "src/extensions/core/load3d/AnimationManager.ts:AnimationManager.reset", + "src/extensions/core/load3d/ControlsManager.ts:ControlsManager.handleResize", + "src/extensions/core/load3d/GizmoManager.ts:GizmoManager.getInitialTransform", + "src/extensions/core/load3d/LightingManager.ts:LightingManager.reset", + "src/extensions/core/load3d/SceneManager.ts:SceneManager.awaitNextSparkDirty", + "src/extensions/core/load3d/SceneManager.ts:SceneManager.reset", + "src/extensions/core/load3d/SceneModelManager.ts:SceneModelManager.init", + "src/extensions/core/load3d/SplatModelAdapter.ts:SplatModelAdapter.matches", + "src/extensions/core/load3d/ViewHelperManager.ts:ViewHelperManager.handleResize", + "src/extensions/core/load3d/ViewHelperManager.ts:ViewHelperManager.reset", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.start", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getEventManager", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getSceneManager", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getCameraManager", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getControlsManager", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getLightingManager", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getViewHelperManager", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getTargetSize", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.setExternalActiveCamera", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.setOverlay", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.removeOverlay", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getOverlay", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.clientPointToNdc", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.updateStatusMouseOnNode", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.updateStatusMouseOnScene", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.updateStatusMouseOnViewer", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.toggleCamera", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getCurrentCameraType", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.setCameraState", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.getCameraState", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.setTargetSize", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.addEventListener", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.removeEventListener", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.refreshViewport", + "src/extensions/core/load3d/Viewport3d.ts:Viewport3d.remove", + "src/lib/litegraph/src/ContextMenu.ts:ContextMenu.getTopMenu", + "src/lib/litegraph/src/ContextMenu.ts:ContextMenu.getTopMenu", + "src/lib/litegraph/src/CurveEditor.ts:CurveEditor.sampleCurve", + "src/lib/litegraph/src/CurveEditor.ts:CurveEditor.draw", + "src/lib/litegraph/src/CurveEditor.ts:CurveEditor.onMouseDown", + "src/lib/litegraph/src/CurveEditor.ts:CurveEditor.onMouseMove", + "src/lib/litegraph/src/CurveEditor.ts:CurveEditor.onMouseUp", + "src/lib/litegraph/src/DragAndScale.ts:DragAndScale.dragging", + "src/lib/litegraph/src/DragAndScale.ts:DragAndScale.mouseDrag", + "src/lib/litegraph/src/DragAndScale.ts:DragAndScale.changeDeltaScale", + "src/lib/litegraph/src/DragAndScale.ts:DragAndScale.fitToBounds", + "src/lib/litegraph/src/DragAndScale.ts:DragAndScale.reset", + "src/lib/litegraph/src/LGraph.ts:LGraph.version", + "src/lib/litegraph/src/LGraph.ts:LGraph.last_link_id", + "src/lib/litegraph/src/LGraph.ts:LGraph.last_link_id", + "src/lib/litegraph/src/LGraph.ts:LGraph.detachCanvas", + "src/lib/litegraph/src/LGraph.ts:LGraph.start", + "src/lib/litegraph/src/LGraph.ts:LGraph.getTime", + "src/lib/litegraph/src/LGraph.ts:LGraph.getFixedTime", + "src/lib/litegraph/src/LGraph.ts:LGraph.getElapsedTime", + "src/lib/litegraph/src/LGraph.ts:LGraph.sendActionToCanvas", + "src/lib/litegraph/src/LGraph.ts:LGraph.findNodesByClass", + "src/lib/litegraph/src/LGraph.ts:LGraph.findNodesByType", + "src/lib/litegraph/src/LGraph.ts:LGraph.findNodeByTitle", + "src/lib/litegraph/src/LGraph.ts:LGraph.checkNodeTypes", + "src/lib/litegraph/src/LGraph.ts:LGraph.triggerInput", + "src/lib/litegraph/src/LGraph.ts:LGraph.setCallback", + "src/lib/litegraph/src/LGraph.ts:LGraph.clearTriggeredSlots", + "src/lib/litegraph/src/LGraph.ts:LGraph.convertToSubgraph", + "src/lib/litegraph/src/LGraph.ts:LGraph.resolveSubgraphIdPath", + "src/lib/litegraph/src/LGraph.ts:LGraph.load", + "src/lib/litegraph/src/LGraph.ts:Subgraph.renameInput", + "src/lib/litegraph/src/LGraph.ts:Subgraph.renameOutput", + "src/lib/litegraph/src/LGraph.ts:Subgraph.removeOutput", + "src/lib/litegraph/src/LGraphBadge.ts:LGraphBadge.boundingRect", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.padding", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.defaultColour", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.font", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.font_size", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.getColorOption", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.getBounding", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.snapToGrid", + "src/lib/litegraph/src/LGraphGroup.ts:LGraphGroup.addNodes", + "src/lib/litegraph/src/LGraphNodeProperties.ts:LGraphNodeProperties.getTrackedProperties", + "src/lib/litegraph/src/LGraphNodeProperties.ts:LGraphNodeProperties.toJSON", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.SlotShape", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.SlotDirection", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.SlotType", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.LabelPosition", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.NODE_MIN_WIDTH", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.NODE_COLLAPSED_RADIUS", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.NODE_OPACITY", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.WIDGET_TEXT_COLOR", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.WIDGET_SECONDARY_TEXT_COLOR", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.WIDGET_DISABLED_TEXT_COLOR", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.CIRCLE_SHAPE", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.ARROW_SHAPE", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.ALWAYS", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.ON_EVENT", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.NEVER", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.ON_TRIGGER", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.UP", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.DOWN", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.LEFT", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.RIGHT", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.CENTER", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.LINK_RENDER_MODES", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.TRANSPARENT_TITLE", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.AUTOHIDE_TITLE", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.proxy", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.allow_scripts", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.Globals", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.snapToGrid", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.truncateWidgetTextEvenly", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.truncateWidgetValuesFirst", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.LLink", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.LGraphNode", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.DragAndScale", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.CurveEditor", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.Classes", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.clearRegisteredTypes", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.getNodeType", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.reloadNodes", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.uuidv4", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.getParameterNames", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.pointerListenerRemove", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.distance", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.colorToString", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.growBounding", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.overlapBounding", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.isInsideBounding", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.hex2num", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.num2hex", + "src/lib/litegraph/src/LiteGraphGlobal.ts:LiteGraphGlobal.extendClass", + "src/lib/litegraph/src/MapProxyHandler.ts:MapProxyHandler.getOwnPropertyDescriptor", + "src/lib/litegraph/src/MapProxyHandler.ts:MapProxyHandler.has", + "src/lib/litegraph/src/MapProxyHandler.ts:MapProxyHandler.ownKeys", + "src/lib/litegraph/src/MapProxyHandler.ts:MapProxyHandler.set", + "src/lib/litegraph/src/MapProxyHandler.ts:MapProxyHandler.deleteProperty", + "src/lib/litegraph/src/Reroute.ts:Reroute.parent", + "src/lib/litegraph/src/Reroute.ts:Reroute.path", + "src/lib/litegraph/src/Reroute.ts:Reroute._centreAngle", + "src/lib/litegraph/src/Reroute.ts:Reroute.findNextReroute", + "src/lib/litegraph/src/Reroute.ts:Reroute.drawHighlight", + "src/lib/litegraph/src/canvas/FloatingRenderLink.ts:FloatingRenderLink.canConnectToReroute", + "src/lib/litegraph/src/canvas/FloatingRenderLink.ts:FloatingRenderLink.connectToRerouteInput", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.radius", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.startAngle", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.endAngle", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.inactiveColour", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.colour1", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.colour2", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.colour3", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.fontString", + "src/lib/litegraph/src/canvas/InputIndicators.ts:InputIndicators.enabled", + "src/lib/litegraph/src/canvas/LinkConnector.ts:LinkConnector.overWidgetType", + "src/lib/litegraph/src/canvas/LinkConnector.ts:LinkConnector.overReroute", + "src/lib/litegraph/src/canvas/LinkConnector.ts:LinkConnector.draggingExistingLinks", + "src/lib/litegraph/src/canvas/LinkConnector.ts:LinkConnector.dragFromRerouteToOutput", + "src/lib/litegraph/src/canvas/LinkConnector.ts:LinkConnector.dragFromLinkSegment", + "src/lib/litegraph/src/canvas/LinkConnector.ts:LinkConnector.isNodeValidDrop", + "src/lib/litegraph/src/canvas/MovingInputLink.ts:MovingInputLink.canConnectToReroute", + "src/lib/litegraph/src/canvas/MovingInputLink.ts:MovingInputLink.connectToRerouteInput", + "src/lib/litegraph/src/canvas/MovingLinkBase.ts:MovingLinkBase.connectToRerouteInput", + "src/lib/litegraph/src/canvas/MovingOutputLink.ts:MovingOutputLink.canConnectToReroute", + "src/lib/litegraph/src/canvas/MovingOutputLink.ts:MovingOutputLink.connectToRerouteInput", + "src/lib/litegraph/src/canvas/ToInputFromIoNodeLink.ts:ToInputFromIoNodeLink.fromDirection", + "src/lib/litegraph/src/canvas/ToInputFromIoNodeLink.ts:ToInputFromIoNodeLink.connectToRerouteInput", + "src/lib/litegraph/src/canvas/ToInputRenderLink.ts:ToInputRenderLink.fromDirection", + "src/lib/litegraph/src/canvas/ToInputRenderLink.ts:ToInputRenderLink.connectToRerouteInput", + "src/lib/litegraph/src/canvas/ToOutputFromIoNodeLink.ts:ToOutputFromIoNodeLink.fromDirection", + "src/lib/litegraph/src/canvas/ToOutputFromIoNodeLink.ts:ToOutputFromIoNodeLink.canConnectToReroute", + "src/lib/litegraph/src/canvas/ToOutputFromIoNodeLink.ts:ToOutputFromIoNodeLink.connectToRerouteInput", + "src/lib/litegraph/src/canvas/ToOutputFromRerouteLink.ts:ToOutputFromRerouteLink.canConnectToReroute", + "src/lib/litegraph/src/canvas/ToOutputRenderLink.ts:ToOutputRenderLink.fromDirection", + "src/lib/litegraph/src/canvas/ToOutputRenderLink.ts:ToOutputRenderLink.canConnectToReroute", + "src/lib/litegraph/src/canvas/ToOutputRenderLink.ts:ToOutputRenderLink.connectToRerouteInput", + "src/lib/litegraph/src/infrastructure/ConstrainedSize.ts:ConstrainedSize.width", + "src/lib/litegraph/src/infrastructure/ConstrainedSize.ts:ConstrainedSize.height", + "src/lib/litegraph/src/infrastructure/ConstrainedSize.ts:ConstrainedSize.fromSize", + "src/lib/litegraph/src/infrastructure/ConstrainedSize.ts:ConstrainedSize.fromRect", + "src/lib/litegraph/src/infrastructure/ConstrainedSize.ts:ConstrainedSize.setSize", + "src/lib/litegraph/src/infrastructure/CustomEventTarget.ts:CustomEventTarget.dispatchEvent", + "src/lib/litegraph/src/node/NodeOutputSlot.ts:NodeOutputSlot.isValidTarget", + "src/lib/litegraph/src/node/SlotBase.ts:SlotBase.removable", + "src/lib/litegraph/src/node/SlotBase.ts:SlotBase.locked", + "src/lib/litegraph/src/node/SlotBase.ts:SlotBase.nameLocked", + "src/lib/litegraph/src/subgraph/EmptySubgraphInput.ts:EmptySubgraphInput.labelPos", + "src/lib/litegraph/src/subgraph/EmptySubgraphOutput.ts:EmptySubgraphOutput.labelPos", + "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts:ExecutableNodeDTO.comfyClass", + "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts:ExecutableNodeDTO.widgets", + "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts:ExecutableNodeDTO.subgraphId", + "src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts:SubgraphIONodeBase.margin", + "src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts:SubgraphIONodeBase.minWidth", + "src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts:SubgraphIONodeBase.size", + "src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts:SubgraphIONodeBase.size", + "src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts:SubgraphIONodeBase.snapToGrid", + "src/lib/litegraph/src/subgraph/SubgraphInput.ts:SubgraphInput.getConnectedWidgets", + "src/lib/litegraph/src/subgraph/SubgraphInput.ts:SubgraphInput.arrange", + "src/lib/litegraph/src/subgraph/SubgraphInputNode.ts:SubgraphInputNode.canConnectTo", + "src/lib/litegraph/src/subgraph/SubgraphInputNode.ts:SubgraphInputNode.connectSlots", + "src/lib/litegraph/src/subgraph/SubgraphInputNode.ts:SubgraphInputNode.connectByType", + "src/lib/litegraph/src/subgraph/SubgraphInputNode.ts:SubgraphInputNode.findOutputByType", + "src/lib/litegraph/src/subgraph/SubgraphNode.ts:SubgraphNode.rebuildInputWidgetBindings", + "src/lib/litegraph/src/subgraph/SubgraphOutput.ts:SubgraphOutput.arrange", + "src/lib/litegraph/src/subgraph/SubgraphOutputNode.ts:SubgraphOutputNode.canConnectTo", + "src/lib/litegraph/src/subgraph/SubgraphOutputNode.ts:SubgraphOutputNode.connectByTypeOutput", + "src/lib/litegraph/src/subgraph/SubgraphOutputNode.ts:SubgraphOutputNode.findInputByType", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.containsPoint", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.onPointerMove", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.decrementSlots", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.measure", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.arrange", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.draw", + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts:SubgraphSlot.asSerialisable", + "src/lib/litegraph/src/widgets/AssetWidget.ts:AssetWidget._displayValue", + "src/lib/litegraph/src/widgets/AssetWidget.ts:AssetWidget.drawWidget", + "src/lib/litegraph/src/widgets/AssetWidget.ts:AssetWidget.onClick", + "src/lib/litegraph/src/widgets/BaseSteppedWidget.ts:BaseSteppedWidget.drawWidget", + "src/lib/litegraph/src/widgets/BaseWidget.ts:BaseWidget.disabledTextColor", + "src/lib/litegraph/src/widgets/BaseWidget.ts:BaseWidget._displayValue", + "src/lib/litegraph/src/widgets/BaseWidget.ts:BaseWidget.onDrag", + "src/lib/litegraph/src/widgets/BaseWidget.ts:BaseWidget.createCopyForNode", + "src/lib/litegraph/src/widgets/BooleanWidget.ts:BooleanWidget.drawWidget", + "src/lib/litegraph/src/widgets/BooleanWidget.ts:BooleanWidget.onClick", + "src/lib/litegraph/src/widgets/BoundingBoxWidget.ts:BoundingBoxWidget.drawWidget", + "src/lib/litegraph/src/widgets/BoundingBoxWidget.ts:BoundingBoxWidget.onClick", + "src/lib/litegraph/src/widgets/ButtonWidget.ts:ButtonWidget.drawWidget", + "src/lib/litegraph/src/widgets/ButtonWidget.ts:ButtonWidget.onClick", + "src/lib/litegraph/src/widgets/ChartWidget.ts:ChartWidget.drawWidget", + "src/lib/litegraph/src/widgets/ChartWidget.ts:ChartWidget.onClick", + "src/lib/litegraph/src/widgets/ColorWidget.ts:ColorWidget.drawWidget", + "src/lib/litegraph/src/widgets/CurveWidget.ts:CurveWidget.drawWidget", + "src/lib/litegraph/src/widgets/CurveWidget.ts:CurveWidget.onClick", + "src/lib/litegraph/src/widgets/FileUploadWidget.ts:FileUploadWidget.drawWidget", + "src/lib/litegraph/src/widgets/FileUploadWidget.ts:FileUploadWidget.onClick", + "src/lib/litegraph/src/widgets/GalleriaWidget.ts:GalleriaWidget.drawWidget", + "src/lib/litegraph/src/widgets/GalleriaWidget.ts:GalleriaWidget.onClick", + "src/lib/litegraph/src/widgets/GradientSliderWidget.ts:GradientSliderWidget.drawWidget", + "src/lib/litegraph/src/widgets/GradientSliderWidget.ts:GradientSliderWidget.onClick", + "src/lib/litegraph/src/widgets/GradientSliderWidget.ts:GradientSliderWidget.onDrag", + "src/lib/litegraph/src/widgets/ImageCompareWidget.ts:ImageCompareWidget.drawWidget", + "src/lib/litegraph/src/widgets/ImageCompareWidget.ts:ImageCompareWidget.onClick", + "src/lib/litegraph/src/widgets/ImageCropWidget.ts:ImageCropWidget.drawWidget", + "src/lib/litegraph/src/widgets/ImageCropWidget.ts:ImageCropWidget.onClick", + "src/lib/litegraph/src/widgets/KnobWidget.ts:KnobWidget.drawWidget", + "src/lib/litegraph/src/widgets/KnobWidget.ts:KnobWidget.onClick", + "src/lib/litegraph/src/widgets/KnobWidget.ts:KnobWidget.onDrag", + "src/lib/litegraph/src/widgets/LegacyWidget.ts:LegacyWidget.drawWidget", + "src/lib/litegraph/src/widgets/LegacyWidget.ts:LegacyWidget.onClick", + "src/lib/litegraph/src/widgets/MarkdownWidget.ts:MarkdownWidget.drawWidget", + "src/lib/litegraph/src/widgets/MarkdownWidget.ts:MarkdownWidget.onClick", + "src/lib/litegraph/src/widgets/MultiSelectWidget.ts:MultiSelectWidget.drawWidget", + "src/lib/litegraph/src/widgets/MultiSelectWidget.ts:MultiSelectWidget.onClick", + "src/lib/litegraph/src/widgets/NumberWidget.ts:NumberWidget._displayValue", + "src/lib/litegraph/src/widgets/NumberWidget.ts:NumberWidget.incrementValue", + "src/lib/litegraph/src/widgets/NumberWidget.ts:NumberWidget.decrementValue", + "src/lib/litegraph/src/widgets/NumberWidget.ts:NumberWidget.onClick", + "src/lib/litegraph/src/widgets/NumberWidget.ts:NumberWidget.onDrag", + "src/lib/litegraph/src/widgets/PainterWidget.ts:PainterWidget.drawWidget", + "src/lib/litegraph/src/widgets/PainterWidget.ts:PainterWidget.onClick", + "src/lib/litegraph/src/widgets/RangeWidget.ts:RangeWidget.drawWidget", + "src/lib/litegraph/src/widgets/RangeWidget.ts:RangeWidget.onClick", + "src/lib/litegraph/src/widgets/SelectButtonWidget.ts:SelectButtonWidget.drawWidget", + "src/lib/litegraph/src/widgets/SelectButtonWidget.ts:SelectButtonWidget.onClick", + "src/lib/litegraph/src/widgets/SliderWidget.ts:SliderWidget.drawWidget", + "src/lib/litegraph/src/widgets/SliderWidget.ts:SliderWidget.onClick", + "src/lib/litegraph/src/widgets/SliderWidget.ts:SliderWidget.onDrag", + "src/lib/litegraph/src/widgets/TextWidget.ts:TextWidget.drawWidget", + "src/lib/litegraph/src/widgets/TextWidget.ts:TextWidget.onClick", + "src/lib/litegraph/src/widgets/TextareaWidget.ts:TextareaWidget.drawWidget", + "src/lib/litegraph/src/widgets/TextareaWidget.ts:TextareaWidget.onClick", + "src/lib/litegraph/src/widgets/TreeSelectWidget.ts:TreeSelectWidget.drawWidget", + "src/lib/litegraph/src/widgets/TreeSelectWidget.ts:TreeSelectWidget.onClick", + "src/lib/litegraph/src/widgets/VideoEditWidget.ts:VideoEditWidget.drawWidget", + "src/lib/litegraph/src/widgets/VideoEditWidget.ts:VideoEditWidget.onClick", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackSignupOpened", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackAuth", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackUserLoggedIn", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackSubscription", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackMonthlySubscriptionSucceeded", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackMonthlySubscriptionCancelled", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackApiCreditTopupButtonPurchaseClicked", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackApiCreditTopupSucceeded", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackWorkspaceInviteSent", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackRunButton", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.startTopupTracking", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.checkForCompletedTopup", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.clearTopupTracking", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackSurvey", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackOnboardingTour", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackOnboardingTour", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackOnboardingTour", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackEmailVerification", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackTemplate", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackTemplateLibraryOpened", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackTemplateLibraryClosed", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackWorkflowImported", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackWorkflowOpened", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackWorkflowSaved", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackDefaultViewSet", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackEnterLinear", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackShareFlow", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackShareLinkOpened", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackPageVisibilityChanged", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackTabCount", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackShellLayout", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackNodeSearch", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackNodeSearchResultSelected", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackNodeAdded", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackTemplateFilterChanged", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackHelpCenterOpened", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackHelpResourceClicked", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackHelpCenterClosed", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackWorkflowCreated", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackWorkflowExecution", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackExecutionOutcome", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackExecutionError", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackExecutionSuccess", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackSharedWorkflowRun", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackSettingChanged", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackUiButtonClicked", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackNamedValuesShadowDiffMismatch", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackNamedValuesShadowDiffSummary", + "src/platform/telemetry/TelemetryRegistry.ts:TelemetryRegistry.trackPageView", + "src/platform/workflow/management/stores/comfyWorkflow.ts:ComfyWorkflow.tintCanvasBg", + "src/renderer/core/canvas/links/linkConnectorAdapter.ts:LinkConnectorAdapter.isNodeValidDrop", + "src/renderer/core/canvas/links/linkConnectorAdapter.ts:LinkConnectorAdapter.isRerouteValidDrop", + "src/renderer/core/canvas/links/linkConnectorAdapter.ts:LinkConnectorAdapter.disconnectMovingLinks", + "src/renderer/core/spatial/SpatialIndex.ts:SpatialIndexManager.size", + "src/renderer/core/spatial/SpatialIndex.ts:SpatialIndexManager.getDebugInfo", + "src/renderer/extensions/minimap/data/AbstractMinimapDataSource.ts:AbstractMinimapDataSource.getBounds", + "src/scripts/api.ts:PromptExecutionError.toString", + "src/scripts/api.ts:ComfyApi.dispatchEvent", + "src/scripts/api.ts:ComfyApi.dispatchEvent", + "src/scripts/api.ts:ComfyApi.getItems", + "src/scripts/api.ts:ComfyApi.getItems", + "src/scripts/api.ts:ComfyApi.getSetting", + "src/scripts/api.ts:ComfyApi.getSetting", + "src/scripts/api.ts:ComfyApi.getServerFeatures", + "src/scripts/api.ts:ComfyApi.getServerFeatures", + "src/scripts/app.ts:ComfyApp.maskeditor_is_opended", + "src/scripts/app.ts:ComfyApp.lastNodeErrors", + "src/scripts/app.ts:ComfyApp.runningNodeId", + "src/scripts/app.ts:ComfyApp.shiftDown", + "src/scripts/app.ts:ComfyApp.storageLocation", + "src/scripts/app.ts:ComfyApp.isNewUserSession", + "src/scripts/app.ts:ComfyApp.extensions", + "src/scripts/app.ts:ComfyApp.progress", + "src/scripts/app.ts:ComfyApp.isImageNode", + "src/scripts/app.ts:ComfyApp.resetView", + "src/scripts/app.ts:ComfyApp.onClipspaceEditorSave", + "src/scripts/app.ts:ComfyApp.onClipspaceEditorClosed", + "src/scripts/app.ts:ComfyApp.clientPosToCanvasPos", + "src/scripts/app.ts:ComfyApp.canvasPosToClientPos", + "src/scripts/changeTracker.ts:ChangeTracker.restore", + "src/scripts/changeTracker.ts:ChangeTracker.undoRedo", + "src/scripts/domWidget.ts:DOMWidgetImpl.createCopyForNode", + "src/scripts/domWidget.ts:DOMWidgetImpl.computeLayoutSize", + "src/scripts/domWidget.ts:ComponentWidgetImpl.computeLayoutSize", + "src/scripts/domWidget.ts:ComponentWidgetImpl.serializeValue", + "src/scripts/ui/components/buttonGroup.ts:ComfyButtonGroup.insert", + "src/scripts/ui/components/buttonGroup.ts:ComfyButtonGroup.append", + "src/scripts/ui/components/buttonGroup.ts:ComfyButtonGroup.remove", + "src/scripts/ui/draggableList.ts:DraggableList.dispose", + "src/scripts/ui/settings.ts:ComfySettingsDialog.dispatchChange", + "src/scripts/ui/settings.ts:ComfySettingsDialog.settingsValues", + "src/scripts/ui/settings.ts:ComfySettingsDialog.settingsLookup", + "src/scripts/ui/settings.ts:ComfySettingsDialog.settingsParamLookup", + "src/scripts/ui/settings.ts:ComfySettingsDialog.getSettingDefaultValue", + "src/scripts/ui/settings.ts:ComfySettingsDialog.setSettingValueAsync", + "src/scripts/ui/settings.ts:ComfySettingsDialog.setSettingValue", + "src/scripts/ui/settings.ts:ComfySettingsDialog.addSetting", + "src/services/nodeSearchService.ts:NodeSearchService.nodeFilters", + "src/stores/modelStore.ts:ComfyModelDef.load", + "src/stores/nodeDefStore.ts:ComfyNodeDefImpl.search_aliases", + "src/stores/queueStore.ts:ResultItemImpl.vhsAdvancedPreviewUrl", + "src/stores/queueStore.ts:ResultItemImpl.urlWithTimestamp", + "src/stores/queueStore.ts:ResultItemImpl.htmlVideoType", + "src/stores/queueStore.ts:ResultItemImpl.htmlAudioType", + "src/stores/queueStore.ts:ResultItemImpl.supportsPreview", + "src/stores/queueStore.ts:TaskItemImpl.key", + "src/stores/queueStore.ts:TaskItemImpl.status", + "src/stores/queueStore.ts:TaskItemImpl.interrupted", + "src/stores/queueStore.ts:TaskItemImpl.isRunning" + ], + "unused_store_members": [ + "src/platform/missingMedia/missingMediaStore.ts:useMissingMediaStore.isContainerWithMissingMedia", + "src/platform/settings/settingStore.ts:useSettingStore.isLoading", + "src/platform/settings/settingStore.ts:useSettingStore.exists", + "src/platform/updates/common/toastStore.ts:useToastStore.removeAll", + "src/platform/updates/common/versionCompatibilityStore.ts:useVersionCompatibilityStore.frontendVersion", + "src/platform/updates/common/versionCompatibilityStore.ts:useVersionCompatibilityStore.backendVersion", + "src/platform/updates/common/versionCompatibilityStore.ts:useVersionCompatibilityStore.requiredFrontendVersion", + "src/platform/workflow/management/stores/workflowStore.ts:useWorkflowBookmarkStore.saveBookmarks", + "src/platform/workspace/stores/partnerNodeGovernanceStore.ts:usePartnerNodeGovernanceStore.error", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.error", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.isCreating", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.isDeleting", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.isSwitching", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.personalWorkspace", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.ownedWorkspacesCount", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.subscriptionPlan", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.destroy", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.refreshWorkspaces", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.renameWorkspace", + "src/platform/workspace/stores/teamWorkspaceStore.ts:useTeamWorkspaceStore.subscribeWorkspace", + "src/platform/workspace/stores/workspaceAuthStore.ts:useWorkspaceAuthStore.init", + "src/renderer/core/canvas/canvasStore.ts:useCanvasStore.nodeSelected", + "src/renderer/core/canvas/canvasStore.ts:useCanvasStore.groupSelected", + "src/renderer/core/canvas/canvasStore.ts:useCanvasStore.rerouteSelected", + "src/renderer/extensions/vueNodes/stores/nodeSlotRegistryStore.ts:useNodeSlotRegistryStore.clear", + "src/stores/assetExportStore.ts:useAssetExportStore.activeExports", + "src/stores/assetsStore.ts:useAssetsStore.deletingAssetIds", + "src/stores/assetsStore.ts:useAssetsStore.inputAssetsByFilename", + "src/stores/assetsStore.ts:useAssetsStore.hasMore", + "src/stores/comfyRegistryStore.ts:useComfyRegistryStore.cancelRequests", + "src/stores/comfyRegistryStore.ts:useComfyRegistryStore.isLoading", + "src/stores/comfyRegistryStore.ts:useComfyRegistryStore.error", + "src/stores/domWidgetStore.ts:useDomWidgetStore.setWidget", + "src/stores/electronDownloadStore.ts:useElectronDownloadStore.downloads", + "src/stores/electronDownloadStore.ts:useElectronDownloadStore.findByUrl", + "src/stores/electronDownloadStore.ts:useElectronDownloadStore.initialize", + "src/stores/executionErrorStore.ts:useExecutionErrorStore.hasExecutionError", + "src/stores/executionStore.ts:useExecutionStore.totalNodesToExecute", + "src/stores/executionStore.ts:useExecutionStore.nodesExecuted", + "src/stores/executionStore.ts:useExecutionStore.runningJobIds", + "src/stores/executionStore.ts:useExecutionStore.runningWorkflowCount", + "src/stores/executionStore.ts:useExecutionStore.uniqueExecutingNodeIdStrings", + "src/stores/helpCenterStore.ts:useHelpCenterStore.show", + "src/stores/menuItemStore.ts:useMenuItemStore.registerMenuGroup", + "src/stores/nodeBookmarkStore.ts:useNodeBookmarkStore.deleteBookmarkCustomization", + "src/stores/nodeBookmarkStore.ts:useNodeBookmarkStore.renameBookmarkCustomization", + "src/stores/nodeDefStore.ts:useNodeDefStore.nodeDefsByDisplayName", + "src/stores/nodeDefStore.ts:useNodeDefStore.showDevOnly", + "src/stores/nodeDefStore.ts:useNodeDefStore.nodeTree", + "src/stores/nodeDefStore.ts:useNodeFrequencyStore.nodeNamesByFrequency", + "src/stores/nodeOutputStore.ts:useNodeOutputStore.revokeAllPreviews", + "src/stores/nodeOutputStore.ts:useNodeOutputStore.latestPreview", + "src/stores/subgraphNavigationStore.ts:useSubgraphNavigationStore.activeSubgraph", + "src/stores/userFileStore.ts:useUserFileStore.fileTree", + "src/stores/workspace/bottomPanelStore.ts:useBottomPanelStore.setActiveTab", + "src/stores/workspace/favoritedWidgetsStore.ts:useFavoritedWidgetsStore.favoritedWidgets", + "src/stores/workspace/favoritedWidgetsStore.ts:useFavoritedWidgetsStore.addFavorite", + "src/stores/workspace/favoritedWidgetsStore.ts:useFavoritedWidgetsStore.removeFavorite", + "src/stores/workspace/favoritedWidgetsStore.ts:useFavoritedWidgetsStore.clearFavorites", + "src/stores/workspace/favoritedWidgetsStore.ts:useFavoritedWidgetsStore.pruneInvalidFavorites", + "src/stores/workspace/sidebarTabStore.ts:useSidebarTabStore.registerSidebarTab", + "src/stores/workspace/sidebarTabStore.ts:useSidebarTabStore.unregisterSidebarTab", + "src/workbench/extensions/manager/stores/comfyManagerStore.ts:useComfyManagerStore.isLoading", + "src/workbench/extensions/manager/stores/comfyManagerStore.ts:useComfyManagerStore.clearLogs", + "src/workbench/extensions/manager/stores/comfyManagerStore.ts:useComfyManagerStore.managerQueue", + "src/workbench/extensions/manager/stores/comfyManagerStore.ts:useComfyManagerStore.updateAllPacks" + ], + "unprovided_injects": [], + "unrendered_components": [], + "unused_component_props": [], + "unused_component_emits": [], + "unused_component_inputs": [], + "unused_component_outputs": [], + "unused_svelte_events": [], + "unused_server_actions": [], + "unused_load_data_keys": [], + "unresolved_imports": [ + "index.html:./materialdesignicons.min.css", + "packages/comfyui-desktop-bridge-types/index.d.ts:./comfyDesktopBridge.js" + ], + "unlisted_dependencies": [], + "duplicate_exports": [ + "Bounds|src/renderer/core/layout/types.ts|src/renderer/core/spatial/QuadTree.ts", + "ComfyDialog|src/scripts/ui.ts|src/scripts/ui/dialog.ts", + "Direction|src/lib/litegraph/src/interfaces.ts|src/renderer/core/canvas/pathRenderer.ts", + "JobListItem|src/composables/queue/useJobList.ts|src/platform/remote/comfyui/jobs/jobTypes.ts", + "ModelFile|src/platform/assets/schemas/assetSchema.ts|src/platform/workflow/validation/schemas/workflowSchema.ts", + "PendingInvite|src/platform/workspace/api/workspaceApi.ts|src/platform/workspace/stores/teamWorkspaceStore.ts", + "Point|src/lib/litegraph/src/interfaces.ts|src/renderer/core/canvas/pathRenderer.ts|src/renderer/core/layout/types.ts", + "Size|src/lib/litegraph/src/interfaces.ts|src/renderer/core/layout/types.ts", + "User|src/schemas/apiSchema.ts|src/stores/userStore.ts", + "WidgetValue|src/types/simplifiedWidget.ts|src/utils/widgetUtil.ts", + "WorkspaceWithRole|src/platform/workspace/api/workspaceApi.ts|src/platform/workspace/workspaceTypes.ts", + "_for_testing|src/renderer/extensions/vueNodes/widgets/composables/useFloatWidget.ts|src/renderer/extensions/vueNodes/widgets/composables/useIntWidget.ts", + "groupCandidatesByName|src/platform/missingMedia/missingMediaScan.ts|src/platform/missingModel/missingModelScan.ts" + ], + "type_only_dependencies": [], + "test_only_dependencies": [], + "boundary_violations": [], + "boundary_coverage_violations": [], + "boundary_call_violations": [], + "policy_violations": [], + "stale_suppressions": [], + "unused_catalog_entries": [], + "empty_catalog_groups": [], + "unresolved_catalog_references": [], + "unused_dependency_overrides": ["pnpm-workspace.yaml:lodash"], + "misconfigured_dependency_overrides": [], + "invalid_client_exports": [], + "mixed_client_server_barrels": [], + "misplaced_directives": [], + "route_collisions": [], + "dynamic_segment_name_conflicts": [] +} diff --git a/.fallow-baselines/dupes.json b/.fallow-baselines/dupes.json new file mode 100644 index 00000000000..a345ca4a695 --- /dev/null +++ b/.fallow-baselines/dupes.json @@ -0,0 +1,28 @@ +{ + "clone_groups": [ + "apps/desktop-ui/src/components/install/InstallLocationPicker.stories.ts:115-148|apps/desktop-ui/src/components/install/InstallLocationPicker.stories.ts:53-81|apps/desktop-ui/src/components/install/InstallLocationPicker.stories.ts:84-112", + "apps/desktop-ui/src/views/InstallView.stories.ts:112-135|apps/desktop-ui/src/views/InstallView.stories.ts:146-169|apps/desktop-ui/src/views/InstallView.stories.ts:191-214", + "apps/website/src/pages/zh-CN/cloud/pricing.astro:25-32|apps/website/src/pages/zh-CN/cloud/supported-nodes.astro:37-44|apps/website/src/pages/zh-CN/cloud/supported-nodes/[pack].astro:65-73", + "browser_tests/fixtures/utils/litegraphUtils.ts:113-117|browser_tests/fixtures/utils/litegraphUtils.ts:146-149|browser_tests/fixtures/utils/litegraphUtils.ts:159-162", + "scripts/cicd/extract-playwright-counts.ts:168-177|scripts/cicd/extract-playwright-counts.ts:206-215|scripts/cicd/extract-playwright-counts.ts:233-242", + "src/components/actionbar/ComfyActionbar.vue:419-424|src/components/queue/QueueProgressOverlay.vue:270-277|src/components/sidebar/tabs/JobHistorySidebarTab.vue:165-170", + "src/components/queue/job/useQueueEstimates.ts:112-116|src/components/queue/job/useQueueEstimates.ts:64-68|src/components/queue/job/useQueueEstimates.ts:97-101", + "src/composables/boundingBoxes/useBoundingBoxes.ts:651-656|src/composables/useLoad3d.ts:195-204|src/extensions/core/load3d.ts:818-831|src/extensions/core/load3dPreviewExtensions.ts:157-171", + "src/composables/queue/useJobMenu.ts:163-169|src/platform/assets/composables/useMediaAssetActions.ts:381-388|src/platform/assets/composables/useMediaAssetActions.ts:507-514", + "src/composables/useCoreCommands.ts:504-514|src/composables/useCoreCommands.ts:527-537|src/composables/useCoreCommands.ts:549-559", + "src/extensions/core/groupOptions.ts:162-177|src/extensions/core/groupOptions.ts:181-196|src/extensions/core/groupOptions.ts:209-224", + "src/extensions/core/load3d/Load3dUtils.ts:20-32|src/extensions/core/webcamCapture.ts:137-147|src/services/audioService.ts:58-70", + "src/extensions/core/load3d.ts:366-377|src/extensions/core/load3d.ts:757-768|src/extensions/core/load3dPreviewExtensions.ts:109-120|src/extensions/core/saveMesh.ts:124-135", + "src/lib/litegraph/src/LGraph.ts:2240-2247|src/lib/litegraph/src/LGraph.ts:2260-2267|src/lib/litegraph/src/LGraph.ts:2280-2287", + "src/lib/litegraph/src/LGraphCanvas.ts:1611-1625|src/lib/litegraph/src/LGraphCanvas.ts:1640-1654|src/lib/litegraph/src/LGraphCanvas.ts:1676-1695", + "src/lib/litegraph/src/__fixtures__/duplicateSubgraphNodeIds.ts:21-45|src/lib/litegraph/src/__fixtures__/nestedSubgraphProxyWidgets.ts:25-49|src/lib/litegraph/src/__fixtures__/nodeIdSpaceExhausted.ts:21-45", + "src/lib/litegraph/src/__fixtures__/duplicateSubgraphNodeIds.ts:44-65|src/lib/litegraph/src/__fixtures__/nestedSubgraphProxyWidgets.ts:48-69|src/lib/litegraph/src/__fixtures__/uniqueSubgraphNodeIds.ts:44-65", + "src/lib/litegraph/src/__fixtures__/duplicateSubgraphNodeIds.ts:85-167|src/lib/litegraph/src/__fixtures__/nestedSubgraphProxyWidgets.ts:98-181|src/lib/litegraph/src/__fixtures__/nodeIdSpaceExhausted.ts:94-176", + "src/lib/litegraph/src/__fixtures__/duplicateSubgraphNodeIds.ts:101-123|src/lib/litegraph/src/__fixtures__/nestedSubgraphProxyWidgets.ts:115-137|src/lib/litegraph/src/__fixtures__/nodeIdSpaceExhausted.ts:110-132|src/lib/litegraph/src/__fixtures__/uniqueSubgraphNodeIds.ts:101-123", + "src/lib/litegraph/src/widgets/BaseWidget.ts:312-323|src/lib/litegraph/src/widgets/ChartWidget.ts:21-32|src/lib/litegraph/src/widgets/FileUploadWidget.ts:21-32|src/lib/litegraph/src/widgets/GalleriaWidget.ts:21-32|src/lib/litegraph/src/widgets/ImageCompareWidget.ts:21-32|src/lib/litegraph/src/widgets/MarkdownWidget.ts:21-32|src/lib/litegraph/src/widgets/MultiSelectWidget.ts:21-32|src/lib/litegraph/src/widgets/SelectButtonWidget.ts:21-32", + "src/lib/litegraph/src/widgets/ChartWidget.ts:15-46|src/lib/litegraph/src/widgets/FileUploadWidget.ts:15-46|src/lib/litegraph/src/widgets/GalleriaWidget.ts:15-46|src/lib/litegraph/src/widgets/ImageCompareWidget.ts:15-46|src/lib/litegraph/src/widgets/MarkdownWidget.ts:15-46|src/lib/litegraph/src/widgets/MultiSelectWidget.ts:15-46|src/lib/litegraph/src/widgets/SelectButtonWidget.ts:15-46", + "src/lib/litegraph/src/widgets/GradientSliderWidget.ts:35-45|src/lib/litegraph/src/widgets/KnobWidget.ts:162-176|src/lib/litegraph/src/widgets/SliderWidget.ts:55-66", + "src/platform/cloud/subscription/components/PricingTable.vue:52-66|src/platform/workspace/components/PricingTableWorkspace.vue:52-66|src/platform/workspace/components/UnifiedPricingTable.vue:101-115", + "src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue:135-150|src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue:186-201|src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue:269-284" + ] +} diff --git a/.fallow-baselines/health.json b/.fallow-baselines/health.json new file mode 100644 index 00000000000..a5961bd9a11 --- /dev/null +++ b/.fallow-baselines/health.json @@ -0,0 +1,3767 @@ +{ + "finding_counts": { + ".storybook/main.ts": { + "crap_moderate": { + "count": 2 + } + }, + "apps/desktop-ui/.storybook/main.ts": { + "crap_moderate": { + "count": 2 + } + }, + "apps/desktop-ui/src/components/bottomPanel/tabs/terminal/BaseTerminal.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/desktop-ui/src/components/install/InstallLocationPicker.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/desktop-ui/src/components/maintenance/TaskListPanel.vue": { + "crap_moderate": { + "count": 3 + } + }, + "apps/desktop-ui/src/views/InstallView.stories.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/desktop-ui/src/views/InstallView.vue": { + "crap_moderate": { + "count": 3 + } + }, + "apps/desktop-ui/src/views/MaintenanceView.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/desktop-ui/src/views/ServerStartView.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/scripts/generate-models.ts": { + "complexity_critical": { + "count": 4 + }, + "crap_critical": { + "count": 4 + }, + "crap_moderate": { + "count": 2 + } + }, + "apps/website/scripts/validate-jsonld.ts": { + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/blocks/CardArticle01.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/blocks/CardArticleGallery01.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/blocks/CardSplitContent01.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/blocks/FAQSplit01.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/blocks/FeatureGrid02.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/blocks/FeatureRows01.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/blocks/FeaturedCarousel01.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "apps/website/src/components/blocks/HeroBackdrop01.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 2 + } + }, + "apps/website/src/components/blocks/HeroLivestream01.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/blocks/HeroSplit01.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/blocks/StepsGrid01.vue": { + "crap_high": { + "count": 3 + } + }, + "apps/website/src/components/blocks/WatchPageLayout.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/blocks/WatchRecommendedCard.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/careers/RolesSection.vue": { + "crap_moderate": { + "count": 2 + } + }, + "apps/website/src/components/cloud-nodes/PackBanner.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/cloud-nodes/PackDetail.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/common/BreadcrumbBar.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/common/ContentSection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/common/FAQSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/common/FooterLinkColumn.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/common/HeaderMain/HeaderMainDesktop.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/common/HeaderMain/HeaderMainMobile.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/common/NodeBadge.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/common/SocialProofBarSection.vue": { + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/common/VideoPlayer.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/common/WireNodeLayout.vue": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/customers/ArticleNav.vue": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/customers/DetailHeroSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/customers/content/AuthorBio.astro": { + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/customers/content/Figure.astro": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/gallery/GalleryDetailModal.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/gallery/GallerySection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/home/GetStartedSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/home/ProductShowcaseSection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/home/UseCaseSection.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/learning/FeaturedTutorialCard.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/learning/LearningCategoryNav.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/learning/LearningWatchPage.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/learning/TutorialRow.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/legal/LegalContentSection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/models/ModelCreationsSection.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/models/ModelHeroSection.vue": { + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/pricing/PricingPlanFeatureList.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/components/pricing/PricingSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/pricing/WhatsIncludedSection.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/product/api/HeroSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/product/enterprise/OrchestrationSection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/product/local/MobileDownloadEmailForm.vue": { + "complexity_moderate": { + "count": 1 + } + }, + "apps/website/src/components/product/shared/FeatureShowcaseSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/product/shared/ReasonSection.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/ui/button/Button.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/components/ui/copyable-field/CopyableField.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/ui/sheet/SheetContent.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/components/ui/slider/Slider.vue": { + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "apps/website/src/components/ui/toggle-group/ToggleGroupItem.vue": { + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/composables/scrollLock.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/composables/useBannerDismissal.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/composables/useFrameScrub.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/composables/useHeroAnimation.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/composables/useHeroLogo.ts": { + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "apps/website/src/composables/useParallax.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/composables/usePinScrub.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/config/banner.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/config/contentSections.ts": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/layouts/BaseLayout.astro": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/scripts/smoothScroll.ts": { + "crap_moderate": { + "count": 2 + } + }, + "apps/website/src/scripts/snakeGame.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 3 + }, + "crap_high": { + "count": 2 + }, + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/brand/BrandBackground.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/templates/brand/BrandColorSection.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/drops/AnnouncementBanner.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/events/EventPage.astro": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/events/EventVideoDialog.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/events/PastEventsSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/templates/events/UpcomingEventsSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/templates/mcp/ComfyMcpDemo.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/templates/mcp/SetupSection.vue": { + "crap_high": { + "count": 1 + } + }, + "apps/website/src/templates/model-launch/ModelLaunchGallerySection.vue": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/model-launch/ModelLaunchHeroSection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "apps/website/src/templates/model-launch/ModelLaunchPage.astro": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/templates/model-launch/modelLaunchPages.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/utils/ashby.ts": { + "crap_moderate": { + "count": 1 + } + }, + "apps/website/src/utils/cloudNodes.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "browser_tests/fixtures/helpers/AssetHelper.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "browser_tests/fixtures/helpers/DragDropHelper.ts": { + "crap_moderate": { + "count": 1 + } + }, + "browser_tests/fixtures/helpers/SubgraphHelper.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "browser_tests/fixtures/utils/promotedWidgets.ts": { + "crap_moderate": { + "count": 1 + } + }, + "browser_tests/tests/containAudit.spec.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "browser_tests/tests/graph.spec.ts": { + "crap_critical": { + "count": 1 + } + }, + "browser_tests/tests/sidebar/workflows.spec.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "browser_tests/tests/workflowPersistence.spec.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "browser_tests/utils/backupUtils.ts": { + "crap_moderate": { + "count": 1 + } + }, + "packages/design-system/src/css/iconifyDynamicPlugin.ts": { + "crap_high": { + "count": 1 + } + }, + "packages/design-system/src/css/lucideStrokePlugin.js": { + "crap_critical": { + "count": 1 + } + }, + "scripts/bundle-categories.js": { + "crap_moderate": { + "count": 1 + } + }, + "scripts/check-unused-i18n-keys.ts": { + "crap_moderate": { + "count": 3 + } + }, + "scripts/cicd/extract-playwright-counts.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "scripts/cicd/resolve-comfyui-release.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "scripts/collect-i18n-node-defs.ts": { + "crap_moderate": { + "count": 1 + } + }, + "scripts/coverage-slack-notify.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 2 + }, + "crap_moderate": { + "count": 1 + } + }, + "scripts/diff-i18n.ts": { + "crap_high": { + "count": 1 + } + }, + "scripts/perf-report.ts": { + "complexity_critical": { + "count": 2 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 2 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "scripts/release-sheriff/release-sheriff.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "scripts/size-collect.js": { + "crap_moderate": { + "count": 1 + } + }, + "scripts/size-report.js": { + "crap_critical": { + "count": 3 + }, + "crap_high": { + "count": 2 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/LiteGraphCanvasSplitterOverlay.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/TopMenuSection.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/actionbar/ComfyActionbar.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/breadcrumb/SubgraphBreadcrumbItem.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/builder/AppBuilder.vue": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/builder/AppModeWidgetList.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/common/DropdownItem.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/common/FormItem.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/common/LazyImage.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/common/TreeExplorerV2.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/common/TreeExplorerV2Node.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/common/WaveAudioPlayer.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/common/WorkflowActionsList.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/curve/curveUtils.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/components/custom/widget/WorkflowTemplateSelectorDialog.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/dialog/GlobalDialog.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/dialog/content/ConfirmationDialogContent.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/dialog/content/SignInContent.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/dialog/content/setting/KeybindingPanel.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/dialog/content/setting/UsageLogsTable.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/dialog/content/signin/SignInForm.vue": { + "crap_high": { + "count": 1 + } + }, + "src/components/error/useErrorOverlayState.ts": { + "crap_critical": { + "count": 1 + } + }, + "src/components/graph/DomWidgets.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/graph/GraphCanvas.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/graph/NodeTooltip.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/graph/SelectionToolbox.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/hdr/HdrViewerContent.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/helpcenter/HelpCenterMenuContent.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/imagecrop/WidgetImageCrop.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/load3d/Load3DControls.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/load3d/Load3DMenuBar.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/load3d/controls/HDRIControls.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/load3d/controls/ModelControls.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/load3d/controls/SceneControls.vue": { + "crap_high": { + "count": 1 + } + }, + "src/components/load3d/menubar/GizmoMenuGroup.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/load3d/menubar/HdriMenuGroup.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/load3d/menubar/ModelMenuGroup.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/load3d/menubar/SceneMenuGroup.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/maskeditor/MaskEditorContent.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/node/NodeHelpContent.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/node/NodePreview.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/node/NodePreviewCard.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/painter/WidgetPainter.vue": { + "crap_high": { + "count": 1 + } + }, + "src/components/queue/job/JobAssetsList.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/queue/job/JobDetailsPopover.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/queue/job/JobFilterActions.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/queue/job/useQueueEstimates.test.ts": { + "crap_high": { + "count": 1 + } + }, + "src/components/range/RangeEditor.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/range/WidgetRange.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/rightSidePanel/RightSidePanel.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/rightSidePanel/errors/ErrorGroupList.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/rightSidePanel/errors/ErrorNodeCard.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/rightSidePanel/errors/MissingNodeCard.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/rightSidePanel/errors/MissingPackGroupRow.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/rightSidePanel/errors/useErrorGroups.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/rightSidePanel/errors/useErrorReport.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/rightSidePanel/parameters/TabNormalInputs.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/rightSidePanel/parameters/WidgetItem.vue": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/rightSidePanel/subgraph/SubgraphEditor.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/searchbox/NodeSearchItem.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/searchbox/v2/NodeSearchCategoryTreeNode.vue": { + "crap_high": { + "count": 1 + } + }, + "src/components/searchbox/v2/NodeSearchContent.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/searchbox/v2/NodeSearchListItem.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/sidebar/ComfyMenuButton.vue": { + "crap_high": { + "count": 1 + } + }, + "src/components/sidebar/SideToolbar.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/sidebar/tabs/AssetsSidebarTab.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/sidebar/tabs/BaseWorkflowsSidebarTab.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/sidebar/tabs/NodeLibrarySidebarTab.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/sidebar/tabs/modelLibrary/DownloadItem.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/sidebar/tabs/nodeLibrary/EssentialNodesPanel.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/components/sidebar/tabs/queue/MediaLightbox.vue": { + "complexity_moderate": { + "count": 1 + } + }, + "src/components/topbar/CurrentUserButton.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/topbar/CurrentUserPopoverLegacy.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/topbar/TopbarBadge.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/components/ui/Popover.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/ui/chart/useChart.ts": { + "crap_high": { + "count": 1 + } + }, + "src/components/ui/multi-select/MultiSelect.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/components/videoEdit/VideoEditPanel.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/videoEdit/VideoFilmstripTrim.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/components/widget/layout/BaseModalLayout.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/auth/useAuthActions.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/composables/bottomPanelTabs/useLogsTerminal.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/boundingBoxes/boundingBoxesUtil.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/boundingBoxes/useBoundingBoxes.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/graph/contextMenuConverter.ts": { + "complexity_high": { + "count": 2 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/composables/graph/useErrorClearingHooks.ts": { + "crap_high": { + "count": 1 + } + }, + "src/composables/graph/useGraphNodeManager.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 3 + } + }, + "src/composables/graph/useGroupMenuOptions.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/graph/useImageMenuOptions.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/graph/useMoreOptionsMenu.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/graph/useNodeErrorFlagSync.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/maskeditor/useBrushDrawing.ts": { + "complexity_high": { + "count": 2 + }, + "crap_high": { + "count": 2 + } + }, + "src/composables/maskeditor/useCanvasHistory.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/maskeditor/useCanvasTools.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/maskeditor/useGPUResources.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/composables/maskeditor/useKeyboard.ts": { + "crap_high": { + "count": 1 + } + }, + "src/composables/maskeditor/useMaskEditorLoader.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/composables/maskeditor/usePanAndZoom.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/maskeditor/useToolManager.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/node/useNodeBadge.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/node/useNodeDragAndDrop.ts": { + "crap_high": { + "count": 1 + } + }, + "src/composables/node/useNodePricing.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_moderate": { + "count": 2 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 4 + } + }, + "src/composables/node/usePriceBadge.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/node/usePromotedPreviews.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/composables/painter/usePainter.ts": { + "crap_high": { + "count": 2 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/palette/usePaletteSwatchRow.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/composables/queue/useJobList.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/queue/useJobMenu.ts": { + "crap_high": { + "count": 1 + } + }, + "src/composables/queue/useQueueNotificationBanners.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/useCanvasDrop.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/composables/useContextMenuTranslation.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/useCoreCommands.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/composables/useImageCrop.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/composables/useLoad3d.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 4 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/composables/useLoad3dViewer.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/usePaste.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/useRangeEditor.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/useWorkflowActionsMenu.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/video/useCropBoxEditor.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/composables/video/useVideoFilmstrip.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/composables/video/useVideoSourceUrl.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/core/graph/subgraph/migration/proxyWidgetMigration.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/core/graph/subgraph/promotionUtils.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/core/graph/subgraph/resolveConcretePromotedWidget.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/core/graph/widgets/dynamicWidgets.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 2 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 2 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/extensions/core/editAttention.ts": { + "complexity_high": { + "count": 2 + }, + "crap_high": { + "count": 1 + } + }, + "src/extensions/core/groupNode.ts": { + "complexity_critical": { + "count": 4 + }, + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 4 + }, + "crap_critical": { + "count": 4 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 4 + } + }, + "src/extensions/core/groupOptions.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/load3d.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/extensions/core/load3d/CameraManager.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/load3d/Load3d.ts": { + "crap_high": { + "count": 1 + } + }, + "src/extensions/core/load3d/LoaderManager.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/load3d/PointCloudModelAdapter.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/load3d/RecordingManager.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/load3d/SceneManager.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/load3d/SceneModelManager.ts": { + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/extensions/core/rerouteNode.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/extensions/core/simpleTouchSupport.ts": { + "crap_high": { + "count": 1 + } + }, + "src/extensions/core/slotDefaults.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/extensions/core/uploadAudio.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/extensions/core/widgetInputs.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/i18n.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/ContextMenu.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 2 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 2 + } + }, + "src/lib/litegraph/src/CurveEditor.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/lib/litegraph/src/LGraph.ts": { + "complexity_critical": { + "count": 6 + }, + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 3 + }, + "crap_critical": { + "count": 6 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 5 + } + }, + "src/lib/litegraph/src/LGraphCanvas.clipboard.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/LGraphCanvas.ts": { + "complexity_critical": { + "count": 21 + }, + "complexity_high": { + "count": 13 + }, + "complexity_moderate": { + "count": 4 + }, + "crap_critical": { + "count": 21 + }, + "crap_high": { + "count": 14 + }, + "crap_moderate": { + "count": 15 + } + }, + "src/lib/litegraph/src/LGraphGroup.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/LGraphNode.ts": { + "complexity_critical": { + "count": 10 + }, + "complexity_high": { + "count": 2 + }, + "crap_critical": { + "count": 10 + }, + "crap_high": { + "count": 6 + }, + "crap_moderate": { + "count": 10 + } + }, + "src/lib/litegraph/src/LLink.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/LiteGraphGlobal.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 5 + } + }, + "src/lib/litegraph/src/Reroute.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/canvas/FloatingRenderLink.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/canvas/InputIndicators.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/canvas/LinkConnector.integration.test.ts": { + "complexity_high": { + "count": 2 + }, + "crap_high": { + "count": 2 + } + }, + "src/lib/litegraph/src/canvas/LinkConnector.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 3 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 3 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/lib/litegraph/src/canvas/ToInputFromIoNodeLink.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/contextMenuCompat.ts": { + "crap_high": { + "count": 1 + } + }, + "src/lib/litegraph/src/draw.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/node/NodeSlot.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/lib/litegraph/src/polyfills.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts": { + "complexity_high": { + "count": 2 + }, + "crap_high": { + "count": 2 + } + }, + "src/lib/litegraph/src/subgraph/SubgraphInput.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/SubgraphInputNode.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/SubgraphOutput.ts": { + "crap_high": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/SubgraphSlotBase.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/__fixtures__/subgraphHelpers.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/subgraphDeduplication.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/subgraph/subgraphUtils.ts": { + "complexity_critical": { + "count": 1 + } + }, + "src/lib/litegraph/src/utils/collections.ts": { + "complexity_high": { + "count": 1 + } + }, + "src/lib/litegraph/src/utils/mathParser.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/lib/litegraph/src/widgets/BaseWidget.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/lib/litegraph/src/widgets/ComboWidget.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/lib/litegraph/src/widgets/KnobWidget.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/lib/litegraph/src/widgets/widgetMap.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/components/ActiveMediaAssetCard.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/AssetCard.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/components/AssetExportProgressDialog.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/components/AssetsListItem.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/components/Media3DTop.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/MediaAssetCard.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/MediaAssetContextMenu.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/MediaAssetFilterMenu.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/MediaAssetSettingsMenu.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/ModelImportProgressDialog.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/components/UploadModelConfirmation.vue": { + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/components/UploadModelFooter.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/components/UploadModelProgress.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/assets/components/modelInfo/ModelInfoPanel.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/assets/composables/useAssetGridSelection.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/composables/useAssetSelection.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/assets/composables/useMediaAssetActions.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/platform/assets/composables/useUploadModelWizard.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/assets/services/assetService.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/platform/cloud/oauth/OAuthConsentView.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/cloud/oauth/oauthApi.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/cloud/onboarding/CloudSubscriptionRedirectView.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/cloud/onboarding/desktopLoginRedemption.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/cloud/onboarding/survey/DynamicSurveyField.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/cloud/onboarding/survey/DynamicSurveyForm.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/cloud/onboarding/survey/surveySchema.ts": { + "complexity_high": { + "count": 1 + } + }, + "src/platform/cloud/subscription/components/CreditsTile.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/cloud/subscription/components/PricingTable.vue": { + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/cloud/subscription/components/SubscriptionPanelContentLegacy.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/cloud/subscription/composables/usePricingTableUrlLoader.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/cloud/subscription/composables/useSubscriptionDialog.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/cloud/subscription/utils/subscriptionCheckoutTracker.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/cloud/subscription/utils/subscriptionCheckoutUtil.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/platform/keybindings/keybindingService.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/keybindings/presetService.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/platform/missingMedia/missingMediaScan.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/platform/missingModel/components/MissingModelRow.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/missingModel/missingModelScan.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/platform/missingModel/missingModelStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/nodeReplacement/components/SwapNodeGroupRow.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/nodeReplacement/missingNodeScan.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/nodeReplacement/useNodeReplacement.ts": { + "complexity_high": { + "count": 3 + }, + "crap_high": { + "count": 3 + } + }, + "src/platform/onboarding/TourSpotlight.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/onboarding/onboardingTourStore.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/onboarding/tourState.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/platform/remoteConfig/refreshRemoteConfig.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/platform/secrets/components/SecretFormDialog.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/settings/components/SettingDialog.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/settings/settingStore.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/telemetry/providers/cloud/DatadogRumTelemetryProvider.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/telemetry/providers/cloud/ImpactTelemetryProvider.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/telemetry/utils/getExecutionContext.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/updates/common/releaseService.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/updates/common/releaseStore.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/platform/updates/common/useFrontendVersionMismatchWarning.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/core/services/workflowService.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 2 + } + }, + "src/platform/workflow/management/stores/comfyWorkflow.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/workflow/persistence/stores/workflowDraftStoreV2.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/sharing/components/OpenSharedWorkflowDialogContent.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/sharing/components/ShareWorkflowDialogContent.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workflow/sharing/components/publish/ComfyHubPublishDialog.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/sharing/components/publish/ComfyHubPublishNav.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/sharing/components/publish/ComfyHubPublishWizardContent.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/sharing/components/publish/ComfyHubThumbnailStep.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workflow/sharing/composables/useComfyHubPublishSubmission.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workflow/sharing/composables/useComfyHubPublishWizard.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workflow/sharing/composables/useSharedWorkflowUrlLoader.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/sharing/services/workflowShareService.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workflow/templates/composables/useTemplateUrlLoader.ts": { + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/auth/WorkspaceAuthGate.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/components/CurrentUserPopoverWorkspace.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workspace/components/InviteMembersForm.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/components/PricingTableWorkspace.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/components/SubscriptionTransitionPreviewWorkspace.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/components/TopUpCreditsDialogContentWorkspace.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workspace/components/UnifiedPricingTable.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/components/WorkspaceSwitcherPopover.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/components/dialogs/TeamWorkspacesDialogContent.vue": { + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/components/dialogs/settings/BillingStatusBanner.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/components/dialogs/settings/MemberListItem.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/components/dialogs/settings/MembersPanelContent.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workspace/components/dialogs/settings/PartnerNodeAccessPanel.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workspace/composables/useDowngradeToPersonal.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/platform/workspace/composables/useMembersPanel.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/composables/useSubscriptionCheckout.ts": { + "complexity_critical": { + "count": 2 + }, + "complexity_high": { + "count": 2 + }, + "crap_critical": { + "count": 2 + }, + "crap_high": { + "count": 3 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/composables/useWorkspaceBilling.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/platform/workspace/composables/useWorkspaceUI.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/stores/billingOperationStore.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/platform/workspace/stores/partnerNodeGovernanceStore.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/platform/workspace/stores/teamWorkspaceStore.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/platform/workspace/stores/workspaceAuthStore.ts": { + "complexity_high": { + "count": 3 + }, + "crap_high": { + "count": 3 + }, + "crap_moderate": { + "count": 3 + } + }, + "src/renderer/core/canvas/links/linkDropOrchestrator.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/renderer/core/canvas/litegraph/litegraphLinkAdapter.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/core/canvas/pathRenderer.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 3 + } + }, + "src/renderer/core/layout/operations/layoutMutations.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/core/layout/store/layoutStore.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/renderer/core/layout/sync/useLayoutSync.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/core/spatial/QuadTree.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/firstRunTour/gettingStarted/GettingStartedScreen.vue": { + "complexity_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/firstRunTour/roles/heuristicRoles.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/firstRunTour/roles/heuristicRoles.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/DropZone.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/LinearControls.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/LinearPreview.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/MobileDisplay.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/OutputHistory.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/linearOutputStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/linearMode/useOutputHistory.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/minimap/composables/useMinimapGraph.ts": { + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/minimap/data/AbstractMinimapDataSource.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/minimap/minimapCanvasRenderer.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/VideoPreview.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/ImagePreview.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/InputSlot.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/LGraphNode.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/LGraphNodePreview.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/NodeBadges.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/NodeContent.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/NodeFooter.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/NodeSlots.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/components/NodeWidgets.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/composables/useNodeEventHandlers.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 2 + } + }, + "src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts": { + "complexity_critical": { + "count": 2 + }, + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_critical": { + "count": 2 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/layout/useNodeDrag.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/DisplayCarousel.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/WidgetGalleria.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/WidgetRecordAudio.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDefault.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/audio/AudioPreviewPlayer.vue": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuActions.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuItem.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/composables/useComboWidget.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/composables/useFloatWidget.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/composables/useImagePreviewWidget.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/composables/useIntWidget.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/extensions/vueNodes/widgets/composables/useWidgetSelectItems.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 3 + } + }, + "src/renderer/glsl/useGLSLPreview.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/renderer/glsl/useGLSLRenderer.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/renderer/glsl/useGLSLUniforms.ts": { + "complexity_moderate": { + "count": 2 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/router.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/scripts/api.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/scripts/app.ts": { + "complexity_critical": { + "count": 5 + }, + "complexity_high": { + "count": 3 + }, + "complexity_moderate": { + "count": 2 + }, + "crap_critical": { + "count": 5 + }, + "crap_high": { + "count": 3 + }, + "crap_moderate": { + "count": 4 + } + }, + "src/scripts/changeTracker.test.ts": { + "crap_high": { + "count": 1 + } + }, + "src/scripts/changeTracker.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 4 + } + }, + "src/scripts/domWidget.ts": { + "crap_high": { + "count": 1 + } + }, + "src/scripts/metadata/avif.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/scripts/metadata/parser.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/scripts/metadata/ply.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/scripts/metadata/png.ts": { + "complexity_critical": { + "count": 1 + } + }, + "src/scripts/pnginfo.ts": { + "complexity_high": { + "count": 2 + }, + "crap_high": { + "count": 1 + } + }, + "src/scripts/ui.ts": { + "complexity_high": { + "count": 1 + } + }, + "src/scripts/valueControl.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/services/comfyRegistryService.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/services/customerEventsService.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/services/litegraphService.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 4 + } + }, + "src/services/load3dService.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/services/mediaCacheService.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/services/providers/algoliaSearchProvider.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/services/providers/registrySearchProvider.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/stores/appModeStore.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/stores/assetDownloadStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/stores/assetExportStore.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/stores/assetsStore.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/stores/assetsStore.ts": { + "complexity_critical": { + "count": 1 + }, + "complexity_high": { + "count": 1 + }, + "crap_critical": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/stores/authStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/stores/executionErrorStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/stores/executionStore.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/stores/modelStore.ts": { + "crap_high": { + "count": 1 + } + }, + "src/stores/nodeDefStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/stores/nodeOutputStore.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/stores/subgraphNavigationStore.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/stores/subgraphStore.ts": { + "crap_moderate": { + "count": 2 + } + }, + "src/stores/systemStatsStore.ts": { + "complexity_moderate": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/stores/workspace/assetsSidebarBadgeStore.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/utils/colorUtil.ts": { + "complexity_high": { + "count": 2 + }, + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/utils/executionUtil.ts": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/utils/linkFixer.ts": { + "complexity_critical": { + "count": 2 + }, + "complexity_moderate": { + "count": 2 + }, + "crap_critical": { + "count": 2 + }, + "crap_moderate": { + "count": 2 + } + }, + "src/utils/litegraphUtil.ts": { + "complexity_high": { + "count": 1 + }, + "complexity_moderate": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/utils/migration/migrateReroute.ts": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/utils/queueDisplay.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/utils/searchAndReplace.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/utils/vintageClipboard.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "src/views/GraphView.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/views/LinearView.vue": { + "complexity_critical": { + "count": 1 + }, + "crap_critical": { + "count": 1 + } + }, + "src/workbench/extensions/manager/components/ManagerProgressToast.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/workbench/extensions/manager/components/manager/NodeConflictDialogContent.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue": { + "complexity_high": { + "count": 1 + }, + "crap_high": { + "count": 1 + } + }, + "src/workbench/extensions/manager/components/manager/infoPanel/MarkdownText.vue": { + "complexity_moderate": { + "count": 1 + } + }, + "src/workbench/extensions/manager/components/manager/infoPanel/tabs/DescriptionTabPanel.vue": { + "crap_moderate": { + "count": 1 + } + }, + "src/workbench/extensions/manager/composables/nodePack/useMissingNodes.test.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/workbench/extensions/manager/composables/useConflictDetection.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/workbench/extensions/manager/composables/useManagerDisplayPacks.ts": { + "crap_high": { + "count": 1 + } + }, + "src/workbench/extensions/manager/composables/useManagerState.ts": { + "crap_high": { + "count": 1 + }, + "crap_moderate": { + "count": 1 + } + }, + "src/workbench/extensions/manager/services/comfyManagerService.ts": { + "crap_moderate": { + "count": 1 + } + }, + "src/workbench/utils/nodeDefOrderingUtil.ts": { + "complexity_moderate": { + "count": 1 + } + }, + "vite.config.mts": { + "crap_moderate": { + "count": 2 + } + } + }, + "runtime_coverage_findings": [], + "target_keys": [ + "src/platform/keybindings/keybindingService.ts:complexity", + "src/platform/telemetry/TelemetryRegistry.ts:high impact", + "src/platform/telemetry/utils/getExecutionContext.ts:circular dependency", + "src/scripts/app.ts:circular dependency", + "src/stores/appModeStore.ts:high impact", + "src/composables/useUpstreamValue.ts:high impact", + "src/renderer/glsl/useGLSLUniforms.ts:high impact", + "src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts:untested risk", + "src/lib/litegraph/src/LGraphCanvas.ts:circular dependency", + "src/composables/useLoad3d.ts:circular dependency", + "src/composables/node/usePriceBadge.ts:circular dependency", + "src/platform/keybindings/keyCombo.ts:high impact", + "src/views/LinearView.vue:complexity", + "src/lib/litegraph/src/LGraphNode.ts:circular dependency", + "src/core/graph/subgraph/promotionUtils.ts:circular dependency", + "src/lib/litegraph/src/LGraph.ts:circular dependency", + "src/composables/useTreeExpansion.ts:high impact", + "src/platform/cloud/subscription/components/CreditsTile.vue:complexity", + "src/platform/assets/composables/useMediaAssetActions.ts:complexity", + "src/platform/workflow/core/services/workflowService.ts:circular dependency", + "src/services/litegraphService.ts:circular dependency", + "src/lib/litegraph/src/subgraph/SubgraphNode.ts:circular dependency", + "src/components/rightSidePanel/errors/MissingPackGroupRow.vue:complexity", + "src/workbench/extensions/manager/composables/nodePack/useMissingNodes.ts:circular dependency", + "browser_tests/fixtures/ComfyPage.ts:circular dependency", + "src/platform/cloud/subscription/composables/useSubscriptionDialog.ts:circular dependency", + "src/components/error/useErrorOverlayState.ts:high impact", + "src/components/dialog/content/setting/keybinding/EditKeybindingFooter.vue:circular dependency", + "src/renderer/extensions/vueNodes/components/ImagePreview.vue:complexity", + "src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts:complexity", + "src/stores/subgraphNavigationStore.ts:circular dependency", + "src/components/builder/AppBuilder.vue:complexity", + "src/composables/node/useNodeDragAndDrop.ts:high impact", + "src/lib/litegraph/src/node/NodeInputSlot.ts:circular dependency", + "src/lib/litegraph/src/utils/type.ts:high impact", + "src/components/graph/SelectionToolbox.vue:complexity", + "src/platform/missingModel/missingModelStore.ts:circular dependency", + "src/platform/workspace/stores/workspaceAuthStore.ts:circular dependency", + "src/platform/workspace/stores/teamWorkspaceStore.ts:circular dependency", + "src/platform/workflow/management/stores/workflowStore.ts:circular dependency", + "src/components/rightSidePanel/RightSidePanel.vue:complexity", + "src/stores/workspace/sidebarTabStore.ts:circular dependency", + "src/components/TopMenuSection.vue:complexity", + "src/composables/video/useVideoSourceUrl.ts:high impact", + "src/platform/cloud/subscription/composables/useFreeTierQuota.ts:high impact", + "src/platform/assets/utils/assetFilterUtils.ts:high impact", + "src/services/dialogService.ts:circular dependency", + "src/scripts/ui.ts:complexity", + "src/composables/usePaste.ts:circular dependency", + "src/workbench/extensions/manager/composables/useConflictDetection.ts:circular dependency", + "src/renderer/core/canvas/canvasStore.ts:circular dependency", + "src/base/webviewDetection.ts:high impact", + "src/components/builder/useResolvedSelectedInputs.ts:high impact", + "src/platform/workspace/composables/useDowngradeToPersonal.ts:complexity", + "src/lib/litegraph/src/Reroute.ts:circular dependency", + "src/platform/workspace/components/CurrentUserPopoverWorkspace.vue:complexity", + "src/composables/useCanvasDrop.ts:complexity", + "src/renderer/extensions/linearMode/LinearControls.vue:complexity", + "src/workbench/extensions/manager/components/manager/button/PackEnableToggle.vue:circular dependency", + "src/composables/graph/useMoreOptionsMenu.ts:circular dependency", + "src/platform/missingMedia/missingMediaStore.ts:circular dependency", + "src/stores/assetsStore.ts:complexity", + "src/platform/workflow/sharing/components/ShareWorkflowDialogContent.vue:complexity", + "src/renderer/extensions/vueNodes/utils/nodeDataUtils.ts:high impact", + "src/composables/auth/useCurrentUser.ts:high impact", + "src/extensions/core/widgetInputs.ts:high impact", + "apps/desktop-ui/src/utils/envUtil.ts:high impact", + "src/extensions/core/groupNode.ts:complexity", + "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts:circular dependency", + "src/workbench/extensions/manager/components/manager/button/PackInstallButton.vue:circular dependency", + "src/platform/workspace/components/TopUpCreditsDialogContentWorkspace.vue:complexity", + "src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts:complexity", + "src/workbench/extensions/manager/composables/nodePack/usePackInstall.ts:circular dependency", + "src/lib/litegraph/src/LGraphGroup.ts:circular dependency", + "src/workbench/extensions/manager/stores/comfyManagerStore.ts:circular dependency", + "src/lib/litegraph/src/DragAndScale.ts:circular dependency", + "src/components/videoEdit/VideoEditPanel.vue:complexity", + "src/utils/eventUtils.ts:high impact", + "src/composables/useAppMode.ts:high impact", + "src/lib/litegraph/src/utils/collections.ts:circular dependency", + "src/renderer/extensions/vueNodes/components/LGraphNode.vue:complexity", + "src/components/searchbox/v2/NodeSearchListItem.vue:complexity", + "src/platform/workspace/composables/useTeamPlan.ts:high impact", + "src/components/rightSidePanel/errors/ErrorNodeCard.vue:complexity", + "src/platform/settings/settingStore.ts:circular dependency", + "src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue:complexity", + "src/workbench/extensions/manager/services/comfyManagerService.ts:circular dependency", + "src/workbench/extensions/manager/composables/useManagerState.ts:circular dependency", + "src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts:complexity", + "apps/website/src/components/common/VideoPlayer.vue:complexity", + "apps/website/src/components/common/ContentSection.vue:complexity", + "src/lib/litegraph/src/node/NodeSlot.ts:complexity", + "src/lib/litegraph/src/subgraph/subgraphUtils.ts:circular dependency", + "src/composables/useNewMenuItemIndicator.ts:high impact", + "src/utils/hdrFormatUtil.ts:high impact", + "src/lib/litegraph/src/canvas/LinkConnector.ts:complexity", + "src/lib/litegraph/src/widgets/NumberWidget.ts:high impact", + "src/workbench/extensions/manager/components/manager/infoPanel/InfoPanel.vue:circular dependency", + "src/workbench/extensions/manager/components/manager/infoPanel/InfoPanelMultiItem.vue:circular dependency", + "src/services/load3dService.ts:circular dependency", + "src/platform/workspace/components/dialogs/settings/MembersPanelContent.vue:complexity", + "src/lib/litegraph/src/node/NodeOutputSlot.ts:circular dependency", + "src/renderer/extensions/vueNodes/widgets/composables/useImagePreviewWidget.ts:complexity", + "src/components/dialog/GlobalDialog.vue:complexity", + "src/workbench/extensions/manager/components/manager/PackVersionSelectorPopover.vue:circular dependency", + "src/components/graph/GraphCanvas.vue:complexity", + "src/renderer/glsl/useGLSLPreview.ts:complexity", + "src/core/graph/widgets/dynamicWidgets.ts:untested risk", + "src/platform/cloud/onboarding/survey/surveySchema.ts:high impact", + "browser_tests/fixtures/helpers/SubgraphHelper.ts:circular dependency", + "src/composables/maskeditor/useKeyboard.ts:high impact", + "src/core/graph/subgraph/migration/proxyWidgetMigration.ts:complexity", + "apps/website/src/composables/useCurrentPath.ts:high impact", + "src/renderer/extensions/vueNodes/widgets/components/DisplayCarousel.vue:complexity", + "src/components/load3d/menubar/SceneMenuGroup.vue:complexity", + "src/composables/useLoad3dViewer.ts:circular dependency", + "src/lib/litegraph/src/utils/mathParser.ts:untested risk", + "src/composables/node/useNodePricing.ts:complexity", + "src/platform/missingModel/components/MissingModelRow.vue:complexity", + "src/utils/linkFixer.ts:complexity", + "src/workbench/extensions/manager/composables/useManagerDisplayPacks.ts:circular dependency", + "src/extensions/core/load3d/Load3dUtils.ts:circular dependency", + "src/workbench/extensions/manager/components/manager/packCard/PackCard.vue:circular dependency", + "src/components/dialog/content/SignInContent.vue:complexity", + "src/lib/litegraph/src/ContextMenu.ts:complexity", + "src/workbench/extensions/manager/components/manager/PackVersionBadge.vue:circular dependency", + "src/platform/workflow/sharing/components/publish/ComfyHubThumbnailStep.vue:complexity", + "src/workbench/extensions/manager/components/manager/packCard/PackCardFooter.vue:circular dependency", + "src/lib/litegraph/src/LiteGraphGlobal.ts:circular dependency", + "src/platform/cloud/onboarding/survey/DynamicSurveyField.vue:complexity", + "src/composables/useEditKeybindingDialog.ts:circular dependency", + "src/stores/maskEditorStore.ts:circular dependency", + "apps/website/src/components/blocks/FeaturedCarousel01.vue:complexity", + "src/components/videoEdit/VideoFilmstripTrim.vue:complexity", + "src/composables/boundingBoxes/useBoundingBoxes.ts:complexity", + "src/extensions/core/rerouteNode.ts:complexity", + "src/renderer/core/canvas/litegraph/litegraphLinkAdapter.ts:complexity", + "src/components/custom/widget/WorkflowTemplateSelectorDialog.vue:complexity", + "src/utils/executionUtil.ts:complexity", + "src/scripts/metadata/avif.ts:complexity", + "src/components/rightSidePanel/errors/ErrorGroupList.vue:complexity", + "src/renderer/extensions/linearMode/DropZone.vue:complexity", + "src/workbench/extensions/manager/components/manager/ManagerDialog.vue:circular dependency", + "src/composables/maskeditor/useCanvasHistory.ts:circular dependency", + "src/workbench/extensions/manager/components/manager/button/PackUpdateButton.vue:circular dependency", + "src/platform/cloud/subscription/components/PricingTable.vue:complexity", + "src/composables/sidebarTabs/useJobHistorySidebarTab.ts:circular dependency", + "src/workbench/extensions/manager/composables/nodePack/useUpdateAvailableNodes.ts:circular dependency", + "src/platform/workspace/components/dialogs/settings/PartnerNodeAccessPanel.vue:complexity", + "src/components/helpcenter/HelpCenterMenuContent.vue:complexity", + "src/scripts/pnginfo.ts:complexity", + "src/scripts/metadata/png.ts:complexity", + "src/composables/graph/useSelectionMenuOptions.ts:circular dependency", + "src/lib/litegraph/src/widgets/LegacyWidget.ts:circular dependency", + "src/workbench/extensions/manager/composables/useManagerDialog.ts:circular dependency", + "browser_tests/fixtures/components/SubgraphEditor.ts:circular dependency", + "scripts/cicd/extract-playwright-counts.ts:complexity", + "apps/website/scripts/generate-models.ts:complexity", + "apps/website/src/components/ui/button-mask/ButtonMask.vue:circular dependency", + "browser_tests/fixtures/components/QueuePanel.ts:circular dependency", + "scripts/cicd/resolve-comfyui-release.ts:complexity", + "scripts/perf-report.ts:complexity" + ] +} diff --git a/.fallowrc.json b/.fallowrc.json deleted file mode 100644 index 16d11fa31c8..00000000000 --- a/.fallowrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", - "entry": ["src/main.ts", "index.html"], - "duplicates": { - "minOccurrences": 3, - "ignore": ["**/*.generated.*", "**/generatedManagerTypes.ts"] - }, - "rules": {} -} diff --git a/.fallowrc.jsonc b/.fallowrc.jsonc new file mode 100644 index 00000000000..604d3ee5e36 --- /dev/null +++ b/.fallowrc.jsonc @@ -0,0 +1,151 @@ +{ + "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/v2.104.0/schema.json", + + // Entry points fallow cannot infer. These files are roots (run by package.json + // scripts / CI / tool CLIs / Storybook), not imported from the app graph. + "entry": [ + "src/main.ts", + "index.html", + "scripts/**/*.{js,ts}", + "apps/website/src/scripts/**/*.ts", + "**/.storybook/{main,preview}.ts", + "packages/ingest-types/openapi-ts.config.ts" + ], + + "ignorePatterns": [ + // Static assets, not analyzable source. + "public/**", + // Devtools browser-extension artifacts, loaded dynamically (mirrors knip). + "tools/devtools/**", + // Storybook-only mocks, reached through Storybook's vite alias, not the prod graph. + "src/storybook/mocks/**" + ], + + "ignoreDependencies": [ + // Iconify icon sets consumed at build time by the iconify tailwind plugin / + // importmap, never via a JS import (mirrors knip ignoreDependencies). + "@iconify/json", + "@iconify-json/lucide", + // Loaded by config, not imported: oxlint jsPlugin (.oxlintrc.json) and + // stylelint customSyntax (.stylelintrc.json) respectively. + "eslint-plugin-playwright", + "postcss-html", + // Vite path aliases to local locale bundles in apps/desktop-ui; virtual + // packages, not installable npm deps. + "@frontend-locales/ar", + "@frontend-locales/en", + "@frontend-locales/es", + "@frontend-locales/fr", + "@frontend-locales/ja", + "@frontend-locales/ko", + "@frontend-locales/pt-BR", + "@frontend-locales/ru", + "@frontend-locales/tr", + "@frontend-locales/zh", + "@frontend-locales/zh-TW", + // Declared in the root manifest and provided to the apps/desktop-ui sub-app + // via pnpm hoisting. Real (benign) phantom deps; tracked for follow-up + // cleanup into apps/desktop-ui/package.json. + "@pinia/testing", + "@testing-library/jest-dom", + "@testing-library/user-event", + "@testing-library/vue", + "@xterm/addon-fit", + "@xterm/addon-serialize", + "@xterm/xterm", + "es-toolkit" + ], + + "ignoreUnresolvedImports": [ + // Static stylesheet referenced from index.html, resolved by the bundler. + "./materialdesignicons.min.css", + // Generated sibling JS for the desktop-bridge type stubs. + "./comfyDesktopBridge.js" + ], + + "ignoreExports": [ + // Public extension API surface, deliberately exported for the 40+ custom-node + // ecosystem (ADR 0003 / 0008). No internal importer by design. + { "file": "src/types/index.ts", "exports": ["*"] }, + { "file": "src/lib/litegraph/src/litegraph.ts", "exports": ["*"] }, + { "file": "src/scripts/ui/menu/index.ts", "exports": ["*"] }, + { + "file": "src/scripts/ui/components/asyncDialog.ts", + "exports": ["ComfyAsyncDialog"] + }, + { + "file": "src/scripts/ui/components/splitButton.ts", + "exports": ["ComfySplitButton"] + }, + { + "file": "src/scripts/utils.ts", + "exports": ["applyTextReplacements", "addStylesheet"] + }, + { + "file": "src/scripts/ui/imagePreview.ts", + "exports": ["createImageHost"] + }, + { + "file": "src/extensions/core/widgetInputs.ts", + "exports": ["convertToInput"] + }, + { + "file": "src/lib/litegraph/src/widgets/widgetMap.ts", + "exports": ["isAssetWidget"] + }, + // Generated OpenAPI client types (mirrors knip ignore). + { + "file": "src/workbench/extensions/manager/types/generatedManagerTypes.ts", + "exports": ["*"] + }, + // Loaded dynamically: cloud onboarding routes, cloud telemetry provider, and + // share dialog are imported lazily / from astro pages, invisible statically. + { + "file": "src/platform/cloud/onboarding/onboardingCloudRoutes.ts", + "exports": ["cloudOnboardingRoutes"] + }, + { + "file": "src/platform/telemetry/providers/cloud/ClickHouseTelemetryProvider.ts", + "exports": ["ClickHouseTelemetryProvider"] + }, + { + "file": "src/platform/workflow/sharing/composables/useShareDialog.ts", + "exports": ["useShareDialog"] + }, + // apps/website data consumed by astro pages; getGalleryItemById is a + // pre-annotated stacked-PR keep. + { + "file": "apps/website/src/data/events.ts", + "exports": ["learningEvents"] + }, + { + "file": "apps/website/src/data/gallery.ts", + "exports": ["getGalleryItemById"] + } + ], + + "duplicates": { + "minOccurrences": 3, + "ignore": [ + "**/*.gen.ts", + "**/*.generated.*", + "**/generatedManagerTypes.ts", + "packages/registry-types/src/comfyRegistryTypes.ts" + ] + }, + + // Staged adoption: the residual dead-code, complexity, and duplication findings + // are inherited legacy (litegraph extension-API members, store members, intra-lib + // cycles, the marketing-media file pending page adoption). They are captured in + // per-analysis baselines so `fallow audit` fails only on NEWLY introduced issues + // in changed files. Baselines are a migration aid, not the desired steady state; + // shrink them as the underlying code is cleaned up, then re-save. + "audit": { + "gate": "new-only", + "deadCodeBaseline": ".fallow-baselines/dead-code.json", + "healthBaseline": ".fallow-baselines/health.json", + "dupesBaseline": ".fallow-baselines/dupes.json" + }, + + "rules": {} +} diff --git a/.github/actions/lint-format-verify/action.yml b/.github/actions/lint-format-verify/action.yml index 11420971237..6dcb8b32822 100644 --- a/.github/actions/lint-format-verify/action.yml +++ b/.github/actions/lint-format-verify/action.yml @@ -1,7 +1,7 @@ name: 'Lint and format verify' description: > - Runs the lint/format/knip verification suite plus a conditional - browser-tests typecheck. Shared by ci-lint-format.yaml (PR) and + Runs the lint/format/knip verification suite plus the browser-tests + typecheck. Shared by ci-lint-format.yaml (PR) and ci-lint-format-queue.yaml (merge queue) so both paths run the exact same checks. The caller is responsible for checkout and frontend setup before invoking this action. @@ -9,14 +9,6 @@ description: > runs: using: composite steps: - - name: Detect browser_tests changes - id: changed-paths - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - with: - filters: | - browser_tests: - - 'browser_tests/**' - - name: Verify lint and format shell: bash run: | @@ -26,6 +18,5 @@ runs: pnpm knip - name: Typecheck browser tests - if: steps.changed-paths.outputs.browser_tests == 'true' shell: bash run: pnpm typecheck:browser diff --git a/.github/actions/setup-frontend/action.yaml b/.github/actions/setup-frontend/action.yaml index cc42f2b935e..474255ed95c 100644 --- a/.github/actions/setup-frontend/action.yaml +++ b/.github/actions/setup-frontend/action.yaml @@ -12,7 +12,7 @@ runs: # Install pnpm, Node.js, build frontend - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/api-update-electron-api-types.yaml b/.github/workflows/api-update-electron-api-types.yaml index befffc6f1d6..25ce45cc03e 100644 --- a/.github/workflows/api-update-electron-api-types.yaml +++ b/.github/workflows/api-update-electron-api-types.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/api-update-manager-api-types.yaml b/.github/workflows/api-update-manager-api-types.yaml index 99a148fff7a..1f6800211be 100644 --- a/.github/workflows/api-update-manager-api-types.yaml +++ b/.github/workflows/api-update-manager-api-types.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/ci-dist-telemetry-scan.yaml b/.github/workflows/ci-dist-telemetry-scan.yaml index 8ef924825cb..b141cd8a8a3 100644 --- a/.github/workflows/ci-dist-telemetry-scan.yaml +++ b/.github/workflows/ci-dist-telemetry-scan.yaml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Use Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/ci-oss-assets-validation.yaml b/.github/workflows/ci-oss-assets-validation.yaml index b0973054d82..8ab43deabb5 100644 --- a/.github/workflows/ci-oss-assets-validation.yaml +++ b/.github/workflows/ci-oss-assets-validation.yaml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Use Node.js uses: actions/setup-node@v6 @@ -88,7 +88,7 @@ jobs: - uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Use Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/ci-tests-e2e.yaml b/.github/workflows/ci-tests-e2e.yaml index 0dbb235cfdf..ba43e0a96c9 100644 --- a/.github/workflows/ci-tests-e2e.yaml +++ b/.github/workflows/ci-tests-e2e.yaml @@ -170,7 +170,7 @@ jobs: if: ${{ !cancelled() && needs.changes.outputs.should-run == 'true' }} steps: - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: version: 10 diff --git a/.github/workflows/ci-vercel-website-preview.yaml b/.github/workflows/ci-vercel-website-preview.yaml index a85dda86ade..4ab3bd10483 100644 --- a/.github/workflows/ci-vercel-website-preview.yaml +++ b/.github/workflows/ci-vercel-website-preview.yaml @@ -41,7 +41,7 @@ jobs: uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node uses: actions/setup-node@v6 @@ -86,7 +86,7 @@ jobs: GIT_PR_ID: ${{ github.event.pull_request.number }} GIT_REPO: ${{ github.repository }} run: | - URL=$(vercel deploy --prebuilt \ + URL=$(vercel deploy --prebuilt --archive=tgz \ --meta githubCommitRef="$GIT_COMMIT_REF" \ --meta githubCommitSha="$GIT_COMMIT_SHA" \ --meta githubCommitAuthorLogin="$GIT_AUTHOR_LOGIN" \ @@ -139,7 +139,7 @@ jobs: uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node uses: actions/setup-node@v6 @@ -171,7 +171,7 @@ jobs: - name: Deploy project artifacts to Vercel id: deploy run: | - URL=$(vercel deploy --prebuilt --prod) + URL=$(vercel deploy --prebuilt --prod --archive=tgz) echo "url=$URL" >> "$GITHUB_OUTPUT" - name: Add deployment URL to summary diff --git a/.github/workflows/ci-website-e2e.yaml b/.github/workflows/ci-website-e2e.yaml index 19b3e8d8407..4a1818791c6 100644 --- a/.github/workflows/ci-website-e2e.yaml +++ b/.github/workflows/ci-website-e2e.yaml @@ -52,6 +52,9 @@ jobs: - name: Build website env: WEBSITE_GITHUB_STARS_OVERRIDE: 110000 + # Un-hides the mobile download email form so e2e can exercise it; + # requests are intercepted in the specs, the key is never contacted. + PUBLIC_CUSTOMERIO_WRITE_KEY: test-e2e-write-key run: pnpm --filter @comfyorg/website build - name: Run Playwright tests diff --git a/.github/workflows/pr-assign-release-sheriff.yaml b/.github/workflows/pr-assign-release-sheriff.yaml index 2d5501d408b..97f5655d340 100644 --- a/.github/workflows/pr-assign-release-sheriff.yaml +++ b/.github/workflows/pr-assign-release-sheriff.yaml @@ -33,6 +33,9 @@ jobs: contents: read issues: write pull-requests: write + # Reading this workflow's own run history, to alert only on the + # transition into failure rather than once an hour forever. + actions: read steps: # pull_request_target checks out the base branch, never PR head code. @@ -43,9 +46,76 @@ jobs: uses: ./.github/actions/setup-frontend - name: Assign release sheriff + id: sheriff env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }} run: pnpm exec tsx scripts/release-sheriff/release-sheriff.ts + + # A failed scheduled run only notifies whoever last pushed to main, which + # in practice is nobody — the reason the placeholder config went unnoticed + # for weeks. Post where the rotation actually watches instead. + # This job runs hourly, so a lasting breakage would otherwise post ~24 + # times a day until someone fixed it — and a channel that cries wolf gets + # muted, which is the failure this alert exists to prevent. Alert on the + # transition into failure: skip if the previous decisive run already did. + # Skipped runs (the pull_request_target gate) are not decisive. + - name: Check whether this failure is already known + id: known + if: failure() && steps.sheriff.outcome == 'failure' + continue-on-error: true + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + RUN_ID: ${{ github.run_id }} + run: | + set -euo pipefail + # The run's conclusion is the wrong signal: a run that died in + # checkout failed without ever reaching the sheriff, and counting it + # as "already alerted" would swallow the next real one. Read the + # step's own conclusion. Only scheduled runs are considered — the + # pull_request_target gate skips most others, so they are the ones + # dense in runs that actually decided something. + PREVIOUS=none + RUNS=$(gh api \ + "repos/$REPO/actions/workflows/pr-assign-release-sheriff.yaml/runs?event=schedule&status=completed&per_page=15" \ + --jq "[.workflow_runs[] | select(.id != ($RUN_ID|tonumber))] | .[].id") + for RUN in $RUNS; do + STEP=$(gh api "repos/$REPO/actions/runs/$RUN/jobs" \ + --jq '[.jobs[].steps[]? | select(.name == "Assign release sheriff")] + | first.conclusion // ""') + if [ "$STEP" = "success" ] || [ "$STEP" = "failure" ]; then + PREVIOUS=$STEP + break + fi + done + echo "previous=$PREVIOUS" >> "$GITHUB_OUTPUT" + + # Scoped to this step, not the job: a checkout or pnpm blip is CI noise + # that is already visible elsewhere, and paging the rotation for it is + # how an alert channel gets muted. + - name: Report a degraded run to Slack + if: >- + failure() && steps.sheriff.outcome == 'failure' && + steps.known.outputs.previous != 'failure' + continue-on-error: true + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_CHANNEL_ID: 'C09K9TPU2G7' # #frontend-releases + REASON: ${{ steps.sheriff.outputs.degraded }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + set -euo pipefail + DETAIL="${REASON:-The job failed before it could resolve a sheriff.}" + TEXT=":rotating_light: *Release sheriff assignment degraded.* ${DETAIL} <${RUN_URL}|View run>" + BODY=$(jq -n --arg ch "$SLACK_CHANNEL_ID" --arg text "$TEXT" '{channel: $ch, text: $text}') + RESPONSE=$(curl -sS -X POST \ + --connect-timeout 10 \ + --max-time 30 \ + -H "Authorization: Bearer $SLACK_BOT_TOKEN" \ + -H "Content-Type: application/json" \ + -d "$BODY" \ + https://slack.com/api/chat.postMessage) + echo "$RESPONSE" | jq -e '.ok == true' >/dev/null diff --git a/.github/workflows/pr-backport.yaml b/.github/workflows/pr-backport.yaml index 7b5d81a982c..2466f5b1540 100644 --- a/.github/workflows/pr-backport.yaml +++ b/.github/workflows/pr-backport.yaml @@ -62,6 +62,7 @@ jobs: fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} - name: Checkout repository uses: actions/checkout@v6 @@ -80,6 +81,9 @@ jobs: - name: Collect backport targets id: targets + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} run: | TARGETS=() declare -A SEEN=() @@ -230,6 +234,8 @@ jobs: id: backport env: PR_NUMBER: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} run: | FAILED="" SUCCESS="" diff --git a/.github/workflows/pr-claude-review.yaml b/.github/workflows/pr-claude-review.yaml index af07fb99cc8..42a22c89dd5 100644 --- a/.github/workflows/pr-claude-review.yaml +++ b/.github/workflows/pr-claude-review.yaml @@ -29,7 +29,7 @@ jobs: ref: refs/pull/${{ github.event.pull_request.number }}/head - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/publish-design-system.yaml b/.github/workflows/publish-design-system.yaml index dd4d4d616b8..de18ed79be0 100644 --- a/.github/workflows/publish-design-system.yaml +++ b/.github/workflows/publish-design-system.yaml @@ -69,7 +69,7 @@ jobs: persist-credentials: false - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/publish-desktop-bridge-types.yaml b/.github/workflows/publish-desktop-bridge-types.yaml index 2116bbfad21..5d0da88f757 100644 --- a/.github/workflows/publish-desktop-bridge-types.yaml +++ b/.github/workflows/publish-desktop-bridge-types.yaml @@ -80,7 +80,7 @@ jobs: persist-credentials: false - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/publish-desktop-ui.yaml b/.github/workflows/publish-desktop-ui.yaml index cfa8cb21f7c..ee0dcf72843 100644 --- a/.github/workflows/publish-desktop-ui.yaml +++ b/.github/workflows/publish-desktop-ui.yaml @@ -84,7 +84,7 @@ jobs: persist-credentials: false - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/release-draft-create.yaml b/.github/workflows/release-draft-create.yaml index 5ed222046c3..380292e6a78 100644 --- a/.github/workflows/release-draft-create.yaml +++ b/.github/workflows/release-draft-create.yaml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - uses: actions/setup-node@v6 with: diff --git a/.github/workflows/release-npm-types.yaml b/.github/workflows/release-npm-types.yaml index 5c43f353c40..0432ca38153 100644 --- a/.github/workflows/release-npm-types.yaml +++ b/.github/workflows/release-npm-types.yaml @@ -75,7 +75,7 @@ jobs: fetch-depth: 1 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/release-pypi-dev.yaml b/.github/workflows/release-pypi-dev.yaml index 315e7566b1f..ac947bf81b8 100644 --- a/.github/workflows/release-pypi-dev.yaml +++ b/.github/workflows/release-pypi-dev.yaml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v6 - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - uses: actions/setup-node@v6 with: diff --git a/.github/workflows/release-version-bump.yaml b/.github/workflows/release-version-bump.yaml index f30115d3b51..91e50c26555 100644 --- a/.github/workflows/release-version-bump.yaml +++ b/.github/workflows/release-version-bump.yaml @@ -187,7 +187,7 @@ jobs: fi - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/release-weekly-comfyui.yaml b/.github/workflows/release-weekly-comfyui.yaml index 193e30431b0..77c07a0b484 100644 --- a/.github/workflows/release-weekly-comfyui.yaml +++ b/.github/workflows/release-weekly-comfyui.yaml @@ -87,7 +87,7 @@ jobs: path: comfyui - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: package_json_file: frontend/package.json @@ -217,7 +217,7 @@ jobs: ref: v${{ needs.resolve-version.outputs.target_version }} - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - uses: actions/setup-node@v6 with: diff --git a/.github/workflows/version-bump-design-system.yaml b/.github/workflows/version-bump-design-system.yaml index 32d82850804..c9cf612be1c 100644 --- a/.github/workflows/version-bump-design-system.yaml +++ b/.github/workflows/version-bump-design-system.yaml @@ -31,7 +31,7 @@ jobs: persist-credentials: false - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/version-bump-desktop-ui.yaml b/.github/workflows/version-bump-desktop-ui.yaml index fc20daa8b66..f47f388e89c 100644 --- a/.github/workflows/version-bump-desktop-ui.yaml +++ b/.github/workflows/version-bump-desktop-ui.yaml @@ -51,7 +51,7 @@ jobs: echo "✅ Branch '$BRANCH' exists" - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/weekly-docs-check.yaml b/.github/workflows/weekly-docs-check.yaml index 23f4e90dc91..6be6dd95ab3 100644 --- a/.github/workflows/weekly-docs-check.yaml +++ b/.github/workflows/weekly-docs-check.yaml @@ -29,7 +29,7 @@ jobs: ref: main - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.i18nrc.cjs b/.i18nrc.cjs index 979d5324638..b1b1406dc11 100644 --- a/.i18nrc.cjs +++ b/.i18nrc.cjs @@ -22,7 +22,8 @@ module.exports = defineConfig({ 'tr', 'pt-BR', 'fa', - 'he' + 'he', + 'it' ], reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream, Civitai, Hugging Face. 'latent' is the short form of 'latent space'. diff --git a/apps/desktop-ui/package.json b/apps/desktop-ui/package.json index 96ed646cbd5..b9818e225ff 100644 --- a/apps/desktop-ui/package.json +++ b/apps/desktop-ui/package.json @@ -27,6 +27,7 @@ "vue-router": "catalog:" }, "devDependencies": { + "@storybook/vue3-vite": "catalog:", "@tailwindcss/vite": "catalog:", "@vitejs/plugin-vue": "catalog:", "dotenv": "catalog:", diff --git a/apps/website/e2e/download.spec.ts b/apps/website/e2e/download.spec.ts index ccc7515a90a..c8b493a5f4f 100644 --- a/apps/website/e2e/download.spec.ts +++ b/apps/website/e2e/download.spec.ts @@ -1,3 +1,4 @@ +import type { Browser, BrowserContext, Page } from '@playwright/test' import { devices, expect } from '@playwright/test' import { test } from './fixtures/blockExternalMedia' @@ -9,6 +10,81 @@ const LINUX_UA = const IPHONE_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1' +// Customer.io CDP request/response shapes (external API — no generated types). +interface CdpEventBody { + userId?: string + traits?: { email?: string } + event?: string + properties?: { locale?: string; page?: string } +} + +interface CdpCapture { + method: string + path: string + body?: CdpEventBody +} + +async function routeCdp( + context: BrowserContext, + captured: CdpCapture[], + { unreachable = false } = {} +) { + await context.route('**/cdp.customer.io/**', async (route) => { + const request = route.request() + const method = request.method() + const path = new URL(request.url()).pathname + if (unreachable) { + captured.push({ method, path }) + return route.abort('failed') + } + if (path.endsWith('/settings')) { + captured.push({ method, path }) + return route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ + integrations: { 'Customer.io Data Pipelines': {} } + }) + }) + } + if (method === 'POST') { + captured.push({ + method, + path, + body: request.postDataJSON() as CdpEventBody + }) + return route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ success: true }) + }) + } + captured.push({ method, path }) + return route.abort('blockedbyclient') + }) +} + +const HERO_HEADING = /Run on your hardware|在你的硬件上运行/i + +function heroLocator(page: Page) { + return page.locator('section', { + has: page.getByRole('heading', { name: HERO_HEADING, level: 1 }) + }) +} + +async function openMobileDownloadPage( + browser: Browser, + path = '/download', + { cdpUnreachable = false } = {} +) { + const context = await browser.newContext({ userAgent: IPHONE_UA }) + const captured: CdpCapture[] = [] + await routeCdp(context, captured, { unreachable: cdpUnreachable }) + const page = await context.newPage() + await page.goto(path) + return { context, page, hero: heroLocator(page), captured } +} + test.describe('Download page @smoke', () => { test.beforeEach(async ({ page }) => { await page.goto('/download') @@ -35,15 +111,12 @@ test.describe('Download page @smoke', () => { test('HeroSection has download and GitHub buttons', async ({ browser }) => { const context = await browser.newContext({ userAgent: WINDOWS_UA }) + const captured: CdpCapture[] = [] + await routeCdp(context, captured) const page = await context.newPage() await page.goto('/download') - const hero = page.locator('section', { - has: page.getByRole('heading', { - name: /Run on your hardware/i, - level: 1 - }) - }) + const hero = heroLocator(page) const downloadBtn = hero.getByRole('link', { name: /DOWNLOAD DESKTOP/i }) await expect(downloadBtn).toBeVisible() await expect(downloadBtn).toHaveAttribute('target', '_blank') @@ -60,6 +133,12 @@ test.describe('Download page @smoke', () => { 'https://github.com/Comfy-Org/ComfyUI#installing' ) + await expect(hero.getByRole('textbox')).toHaveCount(0) + + // Desktop must never load the CDP SDK — settle the network, then assert silence. + await page.waitForLoadState('networkidle') + expect(captured).toHaveLength(0) + await context.close() }) @@ -70,12 +149,7 @@ test.describe('Download page @smoke', () => { const page = await context.newPage() await page.goto('/download') - const hero = page.locator('section', { - has: page.getByRole('heading', { - name: /Run on your hardware/i, - level: 1 - }) - }) + const hero = heroLocator(page) const windowsBtn = hero.locator( 'a[href="https://comfy.org/download/windows/nsis/x64"]' @@ -93,20 +167,13 @@ test.describe('Download page @smoke', () => { hero.getByRole('link', { name: /DOWNLOAD DESKTOP/i }) ).toHaveCount(2) + await expect(hero.getByRole('textbox')).toHaveCount(0) + await context.close() }) test('HeroSection hides every desktop CTA on mobile', async ({ browser }) => { - const context = await browser.newContext({ userAgent: IPHONE_UA }) - const page = await context.newPage() - await page.goto('/download') - - const hero = page.locator('section', { - has: page.getByRole('heading', { - name: /Run on your hardware/i, - level: 1 - }) - }) + const { context, hero } = await openMobileDownloadPage(browser) await expect( hero.getByRole('link', { name: /DOWNLOAD DESKTOP/i }) @@ -118,6 +185,130 @@ test.describe('Download page @smoke', () => { await context.close() }) + test('mobile email form submits identify then track to Customer.io', async ({ + browser + }) => { + const { context, hero, captured } = await openMobileDownloadPage(browser) + + const emailInput = hero.getByRole('textbox', { name: /Email address/i }) + await expect(emailInput).toBeVisible() + await expect( + hero.getByRole('link', { name: /INSTALL FROM GITHUB/i }) + ).toBeVisible() + + await emailInput.fill('someone@example.com') + await hero.getByRole('button', { name: /Send download link/i }).click() + + await expect( + hero.getByText(/The link is sent to someone@example\.com/i) + ).toBeVisible() + + const events = () => captured.filter((capture) => capture.method === 'POST') + const paths = () => events().map((capture) => capture.path) + + // Poll until both expected calls arrive; tolerate unrelated SDK posts + // (e.g. sampled /m metrics), but keep identify-before-track ordering. + await expect + .poll(() => paths()) + .toEqual(expect.arrayContaining(['/v1/i', '/v1/t'])) + expect(paths().indexOf('/v1/i')).toBeLessThan(paths().indexOf('/v1/t')) + + const identify = events().find((capture) => capture.path === '/v1/i')! + const track = events().find((capture) => capture.path === '/v1/t')! + expect(identify.body?.userId).toBe('someone@example.com') + expect(identify.body?.traits).toMatchObject({ + email: 'someone@example.com' + }) + expect(track.body?.event).toBe('download_link_requested') + expect(track.body?.properties).toMatchObject({ + locale: 'en', + page: '/download' + }) + + await context.close() + }) + + test('mobile email form shows error state when Customer.io is unreachable', async ({ + browser + }) => { + const { context, hero } = await openMobileDownloadPage( + browser, + '/download', + { cdpUnreachable: true } + ) + + await hero + .getByRole('textbox', { name: /Email address/i }) + .fill('someone@example.com') + await hero.getByRole('button', { name: /Send download link/i }).click() + + await expect( + hero.getByText(/Something went wrong\. Please try again\./i) + ).toBeVisible() + await expect( + hero.getByRole('button', { name: /Send download link/i }) + ).toBeEnabled() + + await context.close() + }) + + test('honeypot submission shows success without any CDP event', async ({ + browser + }) => { + const { context, hero, captured } = await openMobileDownloadPage(browser) + + await hero + .getByRole('textbox', { name: /Email address/i }) + .fill('someone@example.com') + // Bots fill the hidden decoy via script — mimic that, since Playwright + // refuses to fill invisible elements. + await hero.locator('input[name="company"]').evaluate((decoy) => { + const input = decoy as HTMLInputElement + input.value = 'spam corp' + input.dispatchEvent(new Event('input', { bubbles: true })) + }) + await hero.getByRole('button', { name: /Send download link/i }).click() + + await expect( + hero.getByText(/The link is sent to someone@example\.com/i) + ).toBeVisible() + expect( + captured.filter((capture) => capture.method === 'POST') + ).toHaveLength(0) + + await context.close() + }) + + test('zh-CN download page submits the translated email form with zh-CN locale', async ({ + browser + }) => { + const { context, hero, captured } = await openMobileDownloadPage( + browser, + '/zh-CN/download' + ) + + await expect( + hero.getByRole('heading', { name: '获取下载链接' }) + ).toBeVisible() + + await hero + .getByRole('textbox', { name: '邮箱地址' }) + .fill('someone@example.com') + await hero.getByRole('button', { name: '发送下载链接' }).click() + + await expect( + hero.getByText(/下载链接已发送至 someone@example\.com/) + ).toBeVisible() + + const track = captured.find((capture) => capture.path === '/v1/t') + expect(track?.body?.properties).toMatchObject({ + locale: 'zh-CN', + page: '/zh-CN/download' + }) + + await context.close() + }) + test('ReasonSection heading and reasons are visible', async ({ page }) => { await expect( page.getByRole('heading', { name: /Why.*professionals.*choose/i }) @@ -236,12 +427,7 @@ test.describe('Download page mobile @mobile', () => { const page = await context.newPage() await page.goto('/download') - const hero = page.locator('section', { - has: page.getByRole('heading', { - name: /Run on your hardware/i, - level: 1 - }) - }) + const hero = heroLocator(page) const downloadBtn = hero.getByRole('link', { name: /DOWNLOAD DESKTOP/i }) const githubBtn = hero.getByRole('link', { name: /INSTALL FROM GITHUB/i }) diff --git a/apps/website/e2e/fixtures/blockExternalMedia.ts b/apps/website/e2e/fixtures/blockExternalMedia.ts index d3ed4162554..71ca103668c 100644 --- a/apps/website/e2e/fixtures/blockExternalMedia.ts +++ b/apps/website/e2e/fixtures/blockExternalMedia.ts @@ -11,6 +11,7 @@ const IMAGE_PLACEHOLDER = assetPath('../assets/placeholder-1x1.webp') const VIDEO_PLACEHOLDER = assetPath('../assets/placeholder.webm') const ANALYTICS_PATTERN = '**/va.vercel-scripts.com/**' as const +const CDP_PATTERN = '**/cdp.customer.io/**' as const const YOUTUBE_EMBED_PATTERN = '**/*.youtube-nocookie.com/**' as const const MEDIA_PATTERN = /^https:\/\/media\.comfy\.org\/.*\.(webp|webm|mp4|png|jpg|jpeg|vtt)(\?.*)?$/i @@ -44,6 +45,7 @@ export const test = base.extend<{ blockExternalMedia: void }>({ blockExternalMedia: [ async ({ page }, use) => { await page.route(ANALYTICS_PATTERN, blockAnalytics) + await page.route(CDP_PATTERN, blockAnalytics) await page.route(YOUTUBE_EMBED_PATTERN, fulfillEmptyPage) await page.route(MEDIA_PATTERN, fulfillMedia) await use() diff --git a/apps/website/e2e/flux-3.spec.ts b/apps/website/e2e/flux-3.spec.ts index 1d2b9b7e4a1..92df741134d 100644 --- a/apps/website/e2e/flux-3.spec.ts +++ b/apps/website/e2e/flux-3.spec.ts @@ -1,6 +1,7 @@ import { expect } from '@playwright/test' import { externalLinks, getRoutes } from '../src/config/routes' +import { flux3Page } from '../src/data/flux3' import { t } from '../src/i18n/translations' import { test } from './fixtures/blockExternalMedia' @@ -8,14 +9,17 @@ const PATH = '/flux-3' const HERO_TITLE = t('flux3.hero.title', 'en') const HERO_CTA = t('flux3.hero.primaryCta', 'en') const RUN_OPTIONS_HEADING = t('flux3.runOptions.heading', 'en') +const CTA_HEADING = t('flux3.cta.heading', 'en') +const FAQ_COUNT = flux3Page.faq?.items.length ?? 0 +const CARD_COUNT = flux3Page.gallery?.cards.length ?? 0 const MODELS_ROUTE = getRoutes('en').models -test.describe('Flux 3 announcement page @smoke', () => { +test.describe('Flux 3 page @smoke', () => { test.beforeEach(async ({ page }) => { await page.goto(PATH) }) - test('renders the coming-soon hero and is indexable', async ({ page }) => { + test('renders the hero and is indexable', async ({ page }) => { await expect( page.getByRole('heading', { level: 1, name: HERO_TITLE }) ).toBeVisible() @@ -25,7 +29,10 @@ test.describe('Flux 3 announcement page @smoke', () => { test('hero CTA sends visitors to the cloud in a new tab', async ({ page }) => { - const cta = page.getByRole('link', { name: HERO_CTA }) + const heroSection = page.locator('section').filter({ + has: page.getByRole('heading', { level: 1, name: HERO_TITLE }) + }) + const cta = heroSection.getByRole('link', { name: HERO_CTA }) await expect(cta).toHaveAttribute('href', externalLinks.cloud) await expect(cta).toHaveAttribute('target', '_blank') }) @@ -37,17 +44,55 @@ test.describe('Flux 3 announcement page @smoke', () => { await expect(modelsCrumb).toHaveAttribute('href', MODELS_ROUTE) }) - test('omits the sections the model cannot back yet', async ({ page }) => { + test('renders pricing and run options', async ({ page }) => { + const runOptions = page.getByRole('heading', { + level: 2, + name: RUN_OPTIONS_HEADING + }) + await runOptions.scrollIntoViewIfNeeded() + await expect(runOptions).toBeVisible() + await expect( - page.getByRole('heading', { level: 2, name: RUN_OPTIONS_HEADING }) + page.getByRole('heading', { level: 2, name: t('pricing.title', 'en') }) ).toBeVisible() + }) + + test('renders one gallery card per configured clip', async ({ page }) => { + const heading = page.getByRole('heading', { + level: 2, + name: t('flux3.models.heading', 'en') + }) + await heading.scrollIntoViewIfNeeded() + await expect(heading).toBeVisible() + + const gallery = page.locator('section').filter({ has: heading }) + await expect(gallery.locator('video')).toHaveCount(CARD_COUNT) + }) + + test('renders one FAQ entry per configured question', async ({ page }) => { + const triggers = page.locator('[id^="faq-trigger-"]') + await triggers.first().scrollIntoViewIfNeeded() + await expect(triggers).toHaveCount(FAQ_COUNT) + }) + + test('closing CTA keeps visitors on Flux 3', async ({ page }) => { + const ctaSection = page.locator('section').filter({ + has: page.getByRole('heading', { level: 2, name: CTA_HEADING }) + }) + + const primary = ctaSection.getByRole('link', { + name: t('flux3.cta.primaryCta', 'en') + }) + await primary.scrollIntoViewIfNeeded() + await expect(primary).toHaveAttribute('href', externalLinks.cloud) - // No gallery, pricing or FAQ until Flux 3 ships. - await expect(page.getByText(t('pricing.title', 'en'))).toHaveCount(0) - await expect(page.locator('[id^="faq-trigger-"]')).toHaveCount(0) + const secondary = ctaSection.getByRole('link', { + name: t('flux3.cta.secondaryCta', 'en') + }) + await expect(secondary).toHaveAttribute('href', externalLinks.workflows) }) - test('emits no FAQ structured data while the page has no FAQ', async ({ + test('emits FAQ structured data for the configured questions', async ({ page }) => { const types = await page.evaluate(() => @@ -63,6 +108,6 @@ test.describe('Flux 3 announcement page @smoke', () => { }) ) expect(types).toContain('WebPage') - expect(types).not.toContain('FAQPage') + expect(types).toContain('FAQPage') }) }) diff --git a/apps/website/e2e/minimax.spec.ts b/apps/website/e2e/minimax.spec.ts index b1f69df0de6..2eae0b3ba65 100644 --- a/apps/website/e2e/minimax.spec.ts +++ b/apps/website/e2e/minimax.spec.ts @@ -17,7 +17,7 @@ const CTA_HEADING = t('minimax.cta.heading', 'en') const CTA_PRIMARY = t('minimax.cta.primaryCta', 'en') const CLOUD_URL = externalLinks.cloud const CLOUD_RUN_URL = minimaxLinks.cloudRun -const FAQS = minimaxPage.faq.items +const FAQS = minimaxPage.faq?.items ?? [] const FAQ_COUNT = FAQS.length const FIRST_FAQ = FAQS[0] const PRICING_HEADING = t('pricing.title', 'en') diff --git a/apps/website/e2e/payment.spec.ts b/apps/website/e2e/payment.spec.ts index 528b7f839b6..e78f931fc65 100644 --- a/apps/website/e2e/payment.spec.ts +++ b/apps/website/e2e/payment.spec.ts @@ -8,6 +8,7 @@ const CLOUD_URL = externalLinks.cloud const PLATFORM_USAGE_URL = externalLinks.platformUsage const SUPPORT_URL = externalLinks.support const DOCS_SUBSCRIPTION_URL = externalLinks.docsSubscription +const STATUS_URL = externalLinks.cloudStatus async function expectNoIndex(page: Page) { await expect(page.locator('meta[name="robots"]')).toHaveAttribute( @@ -79,6 +80,17 @@ test.describe('Payment failed page @smoke', () => { await expect(cta).toBeVisible() await expect(cta).toHaveAttribute('href', DOCS_SUBSCRIPTION_URL) }) + + test('points at the status page so an outage can be ruled out', async ({ + page + }) => { + const statusLink = page.getByRole('link', { + name: 'status page', + exact: true + }) + await expect(statusLink).toBeVisible() + await expect(statusLink).toHaveAttribute('href', STATUS_URL) + }) }) test.describe('Payment pages zh-CN @smoke', () => { @@ -111,5 +123,8 @@ test.describe('Payment pages zh-CN @smoke', () => { await expect( page.getByRole('link', { name: '查看订阅文档' }) ).toHaveAttribute('href', DOCS_SUBSCRIPTION_URL) + await expect( + page.getByRole('link', { name: '状态页面', exact: true }) + ).toHaveAttribute('href', STATUS_URL) }) }) diff --git a/apps/website/e2e/seedance-2.5.spec.ts b/apps/website/e2e/seedance-2.5.spec.ts new file mode 100644 index 00000000000..9a45ddb68d4 --- /dev/null +++ b/apps/website/e2e/seedance-2.5.spec.ts @@ -0,0 +1,149 @@ +import { expect } from '@playwright/test' + +import { externalLinks, getRoutes } from '../src/config/routes' +import { seedancePage } from '../src/data/seedance' +import { t } from '../src/i18n/translations' +import { test } from './fixtures/blockExternalMedia' + +const PATH = '/seedance-2.5' +const ZH_PATH = '/zh-CN/seedance-2.5' +const HERO_TITLE = t('seedance.hero.title') +const HERO_EYEBROW = t('seedance.hero.eyebrow') +const HERO_CTA = t('seedance.hero.primaryCta') +const RUN_OPTIONS_HEADING = t('seedance.runOptions.heading') +const REVIEWS_HEADING = t('seedance.reviews.heading') +const MODELS_ROUTE = getRoutes('en').models + +test.describe('Seedance 2.5 announcement page @smoke', () => { + test.beforeEach(async ({ page }) => { + await page.goto(PATH) + }) + + test('renders the hero over its backdrop and is indexable', async ({ + page + }) => { + const hero = page.locator('section').filter({ + has: page.getByRole('heading', { level: 1, name: HERO_TITLE }) + }) + await expect(hero.getByText(HERO_EYEBROW)).toBeVisible() + await expect( + page.getByRole('heading', { level: 1, name: HERO_TITLE }) + ).toBeVisible() + await expect(hero.locator('img')).toHaveAttribute( + 'src', + seedancePage.hero.placeholderImageSrc ?? '' + ) + await expect(page.locator('meta[name="robots"]')).toHaveCount(0) + }) + + test('hero CTA sends visitors to the cloud in a new tab', async ({ + page + }) => { + const cta = page + .locator('section') + .filter({ + has: page.getByRole('heading', { level: 1, name: HERO_TITLE }) + }) + .getByRole('link', { name: HERO_CTA }) + await expect(cta).toHaveAttribute('href', externalLinks.cloud) + await expect(cta).toHaveAttribute('target', '_blank') + }) + + test('breadcrumb trail links to the models catalog', async ({ page }) => { + const modelsCrumb = page + .getByRole('navigation', { name: t('ui.breadcrumb') }) + .getByRole('link', { name: t('models.breadcrumb.models') }) + await expect(modelsCrumb).toHaveAttribute('href', MODELS_ROUTE) + }) + + test('renders run options and reviews', async ({ page }) => { + const runOptions = page.getByRole('heading', { + level: 2, + name: RUN_OPTIONS_HEADING + }) + await runOptions.scrollIntoViewIfNeeded() + await expect(runOptions).toBeVisible() + + const reviews = page.getByRole('heading', { + level: 2, + name: REVIEWS_HEADING + }) + await reviews.scrollIntoViewIfNeeded() + await expect(reviews).toBeVisible() + }) + + // The announcement omits gallery, pricing, FAQ and closing CTA, so these two + // are the only sections it should show. Asserting the whole set means + // reintroducing any of them has to be deliberate. + test('shows only the sections the announcement configures', async ({ + page + }) => { + await expect(page.getByRole('heading', { level: 2 })).toHaveText([ + RUN_OPTIONS_HEADING, + REVIEWS_HEADING + ]) + await expect(page.locator('video')).toHaveCount(0) + }) +}) + +test.describe('Seedance 2.5 announcement page — zh-CN', () => { + test.beforeEach(async ({ page }) => { + await page.goto(ZH_PATH) + }) + + test('renders the localized hero and run options', async ({ page }) => { + const hero = page.locator('section').filter({ + has: page.getByRole('heading', { level: 1, name: HERO_TITLE }) + }) + await expect( + hero.getByText(t('seedance.hero.eyebrow', 'zh-CN')) + ).toBeVisible() + await expect(hero.getByRole('link')).toContainText(/[一-鿿]/) + + await expect( + page.getByRole('heading', { + level: 2, + name: t('seedance.runOptions.heading', 'zh-CN') + }) + ).toBeVisible() + }) + + test('breadcrumb keeps visitors inside the locale', async ({ page }) => { + const modelsCrumb = page + .getByRole('navigation', { name: t('ui.breadcrumb', 'zh-CN') }) + .getByRole('link', { name: t('models.breadcrumb.models', 'zh-CN') }) + await expect(modelsCrumb).toHaveAttribute('href', getRoutes('zh-CN').models) + }) +}) + +test.describe('Seedance 2.5 announcement page — mobile @mobile', () => { + test('hero CTA stays visible and linked at narrow viewports', async ({ + page + }) => { + await page.goto(PATH) + + const cta = page + .locator('section') + .filter({ + has: page.getByRole('heading', { level: 1, name: HERO_TITLE }) + }) + .getByRole('link', { name: HERO_CTA }) + + await cta.scrollIntoViewIfNeeded() + await expect(cta).toBeVisible() + await expect(cta).toHaveAttribute('href', externalLinks.cloud) + + const box = await cta.boundingBox() + const viewport = page.viewportSize() + if (!box || !viewport) { + throw new Error('hero CTA has no layout box to measure') + } + + // toBeVisible() does not imply the element sits inside the viewport, so + // check all four edges. One pixel of tolerance for subpixel rounding. + expect(box.x).toBeGreaterThanOrEqual(-1) + expect(box.y).toBeGreaterThanOrEqual(-1) + expect(box.x + box.width).toBeLessThanOrEqual(viewport.width + 1) + expect(box.y + box.height).toBeLessThanOrEqual(viewport.height + 1) + }) +}) diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-2-md-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-2-md-visual-linux.png index e4faee98186..d30ec2cc072 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-2-md-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-get-started-2-md-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-1-sm-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-1-sm-visual-linux.png index 816c108e776..ab2055b1a02 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-1-sm-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-1-sm-visual-linux.png differ diff --git a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-2-md-visual-linux.png b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-2-md-visual-linux.png index 6a78ef64dd8..eb4e7fb1d9f 100644 Binary files a/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-2-md-visual-linux.png and b/apps/website/e2e/visual-responsive.spec.ts-snapshots/home-product-cards-2-md-visual-linux.png differ diff --git a/apps/website/package.json b/apps/website/package.json index 79f32e75bba..8fc69638a50 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -26,6 +26,7 @@ "@comfyorg/object-info-parser": "workspace:*", "@comfyorg/shared-frontend-utils": "workspace:*", "@comfyorg/tailwind-utils": "workspace:*", + "@customerio/cdp-analytics-browser": "catalog:", "@lucide/vue": "catalog:", "@vercel/analytics": "catalog:", "@vueuse/core": "catalog:", @@ -44,7 +45,11 @@ "@astrojs/mdx": "catalog:", "@astrojs/vue": "catalog:", "@playwright/test": "catalog:", + "@storybook/vue3-vite": "catalog:", "@tailwindcss/vite": "catalog:", + "@testing-library/user-event": "catalog:", + "@testing-library/vue": "catalog:", + "@vitejs/plugin-vue": "catalog:", "astro": "catalog:", "tailwindcss": "catalog:", "tsx": "catalog:", diff --git a/apps/website/src/components/blocks/CardSplitContent01.stories.ts b/apps/website/src/components/blocks/CardSplitContent01.stories.ts new file mode 100644 index 00000000000..fa40cffaefe --- /dev/null +++ b/apps/website/src/components/blocks/CardSplitContent01.stories.ts @@ -0,0 +1,36 @@ +import type { Meta, StoryObj } from '@storybook/vue3-vite' + +import CardSplitContent01 from './CardSplitContent01.vue' + +const meta: Meta = { + title: 'Website/Blocks/CardSplitContent01', + component: CardSplitContent01, + tags: ['autodocs'], + args: { + eyebrow: 'New Model Release', + title: 'MiniMax H3', + body: 'Full multi-modal I/O, native stereo clip. Up to 2K, 5 to 15s per generation. H3 actually conditions on input audio where others overwrite or drop it.', + primaryCta: { label: 'View Model Features', href: '#' }, + secondaryCta: { label: 'Try Workflows', href: '#' }, + tags: ['Open Weights', 'Partner Nodes'], + videoSrc: 'https://media.comfy.org/website/minimax/hero.mp4', + videoAriaLabel: 'MiniMax H3 preview' + } +} + +export default meta +type Story = StoryObj + +export const Default: Story = {} + +export const WithoutTags: Story = { + args: { + tags: undefined + } +} + +export const SingleCta: Story = { + args: { + secondaryCta: undefined + } +} diff --git a/apps/website/src/components/blocks/CardSplitContent01.vue b/apps/website/src/components/blocks/CardSplitContent01.vue new file mode 100644 index 00000000000..9e41516a0e8 --- /dev/null +++ b/apps/website/src/components/blocks/CardSplitContent01.vue @@ -0,0 +1,114 @@ + + + diff --git a/apps/website/src/components/common/PlayPauseButton.vue b/apps/website/src/components/common/PlayPauseButton.vue index 8c990d0f86a..08d5940e4ec 100644 --- a/apps/website/src/components/common/PlayPauseButton.vue +++ b/apps/website/src/components/common/PlayPauseButton.vue @@ -12,8 +12,8 @@ const { playing = false, size = 'md' } = defineProps<{ type="button" :class=" cn( - 'bg-primary-comfy-yellow flex shrink-0 cursor-pointer items-center justify-center rounded-xl', - size === 'sm' ? 'size-8 lg:size-10' : 'size-12' + 'bg-primary-comfy-yellow flex shrink-0 cursor-pointer items-center justify-center', + size === 'sm' ? 'size-8 rounded-lg lg:size-10' : 'size-12 rounded-xl' ) " > @@ -36,7 +36,7 @@ const { playing = false, size = 'md' } = defineProps<{ v-else :class=" cn( - 'text-primary-comfy-ink ml-0.5', + 'ml-0.5 text-primary-comfy-ink', size === 'sm' ? 'size-3 lg:size-4' : 'size-4' ) " diff --git a/apps/website/src/components/common/SiteFooter.vue b/apps/website/src/components/common/SiteFooter.vue index 92372d8b839..9b7d8b47302 100644 --- a/apps/website/src/components/common/SiteFooter.vue +++ b/apps/website/src/components/common/SiteFooter.vue @@ -40,7 +40,8 @@ const topColumns: { title: string; links: FooterLink[] }[] = [ { label: t('nav.comfyEnterprise', locale), href: routes.cloudEnterprise }, { label: t('nav.mcpServer', locale), href: routes.mcp }, { label: t('nav.supportedModels', locale), href: routes.models }, - { label: t('footer.minimaxH3', locale), href: routes.minimax } + { label: t('footer.minimaxH3', locale), href: routes.minimax }, + { label: t('footer.seedance', locale), href: routes.seedance } ] }, { @@ -73,6 +74,16 @@ const topColumns: { title: string; links: FooterLink[] }[] = [ href: externalLinks.youtube, external: true }, + { + label: t('nav.instagram', locale), + href: externalLinks.instagram, + external: true + }, + { + label: t('nav.x', locale), + href: externalLinks.x, + external: true + }, { label: t('footer.affiliateProgram', locale), href: routes.affiliates @@ -123,7 +134,7 @@ const contactColumn: { title: string; links: FooterLink[] } = { class="bg-primary-comfy-ink px-6 py-8 text-primary-comfy-canvas lg:px-20" >

diff --git a/apps/website/src/components/common/VideoPlayer.vue b/apps/website/src/components/common/VideoPlayer.vue index ca95e2cacc6..ad5702ccb48 100644 --- a/apps/website/src/components/common/VideoPlayer.vue +++ b/apps/website/src/components/common/VideoPlayer.vue @@ -14,6 +14,8 @@ import type { HTMLAttributes } from 'vue' import { t } from '../../i18n/translations' import type { Locale } from '../../i18n/translations' +import VolumeMutedIcon from '../icons/VolumeMutedIcon.vue' +import VolumeUnmutedIcon from '../icons/VolumeUnmutedIcon.vue' import PlayPauseButton from './PlayPauseButton.vue' export type VideoTrack = { @@ -30,8 +32,10 @@ const { tracks = [], autoplay = false, autoplayUnmuted = false, + lazyAutoplay = false, loop = false, minimal = false, + muteOnly = false, hideControls = false, fit = 'cover', ariaLabel, @@ -45,8 +49,15 @@ const { /** Attempt autoplay with sound; browsers without engagement-based * permission reject it, and playback falls back to muted. */ autoplayUnmuted?: boolean + /** Omit the native autoplay attribute and keep preload conservative so + * media loads and plays only after hydration; pair with `client:visible` + * to start the preview when it scrolls into view. */ + lazyAutoplay?: boolean loop?: boolean minimal?: boolean + /** Replace the control bar with persistent play/pause and mute toggles + * in the top-right corner. */ + muteOnly?: boolean hideControls?: boolean fit?: 'cover' | 'contain' ariaLabel?: string @@ -253,13 +264,13 @@ function toggleFullscreen() { " :src :poster - :preload="autoplay ? 'auto' : 'metadata'" + :preload="autoplay && !lazyAutoplay ? 'auto' : 'metadata'" crossorigin="anonymous" playsinline - :autoplay + :autoplay="autoplay && !lazyAutoplay" :loop muted - @click="hideControls ? undefined : (playing = !playing)" + @click="hideControls || muteOnly ? undefined : (playing = !playing)" > + +

+ + +
+
diff --git a/apps/website/src/components/common/brandButton.variants.ts b/apps/website/src/components/common/brandButton.variants.ts index cd8aa3ae717..0aaeae5c328 100644 --- a/apps/website/src/components/common/brandButton.variants.ts +++ b/apps/website/src/components/common/brandButton.variants.ts @@ -12,7 +12,9 @@ export const brandButtonVariants = cva({ 'outline-dark': 'hover:text-primary-comfy-yellow border-2 border-primary-comfy-ink text-primary-comfy-ink uppercase hover:bg-primary-comfy-ink', inverse: - 'text-primary-comfy-yellow bg-primary-comfy-ink transition-opacity hover:opacity-90' + 'text-primary-comfy-yellow bg-primary-comfy-ink transition-opacity hover:opacity-90', + 'outline-light': + 'border-2 border-primary-warm-white text-primary-warm-white hover:bg-primary-warm-white hover:text-primary-comfy-ink' }, size: { xs: 'rounded-2xl px-6 py-3 text-xs font-bold', diff --git a/apps/website/src/components/home/ModelReleaseSection.vue b/apps/website/src/components/home/ModelReleaseSection.vue new file mode 100644 index 00000000000..9d449dbbcd4 --- /dev/null +++ b/apps/website/src/components/home/ModelReleaseSection.vue @@ -0,0 +1,29 @@ + + + diff --git a/apps/website/src/components/icons/VolumeMutedIcon.vue b/apps/website/src/components/icons/VolumeMutedIcon.vue new file mode 100644 index 00000000000..f3d1d0ff21c --- /dev/null +++ b/apps/website/src/components/icons/VolumeMutedIcon.vue @@ -0,0 +1,24 @@ + + + diff --git a/apps/website/src/components/icons/VolumeUnmutedIcon.vue b/apps/website/src/components/icons/VolumeUnmutedIcon.vue new file mode 100644 index 00000000000..00ff4df36a5 --- /dev/null +++ b/apps/website/src/components/icons/VolumeUnmutedIcon.vue @@ -0,0 +1,34 @@ + + + diff --git a/apps/website/src/components/payment/PaymentStatusSection.vue b/apps/website/src/components/payment/PaymentStatusSection.vue index 0d8aec3f1ea..bff1a0a0e47 100644 --- a/apps/website/src/components/payment/PaymentStatusSection.vue +++ b/apps/website/src/components/payment/PaymentStatusSection.vue @@ -75,13 +75,13 @@ const iconRingClass = {{ t(`payment.${status}.label`, locale) }}

{{ t(`payment.${status}.title`, locale) }}

{{ t(`payment.${status}.subtitle`, locale) }}

@@ -96,6 +96,20 @@ const iconRingClass = {{ t(`payment.${status}.secondaryCta`, locale) }} + +

+ {{ t('payment.failed.statusPrompt.prefix', locale) }} + + {{ t('payment.failed.statusPrompt.statusLink', locale) }} + + {{ t('payment.failed.statusPrompt.suffix', locale) }} +

diff --git a/apps/website/src/components/product/local/HeroSection.vue b/apps/website/src/components/product/local/HeroSection.vue index dea5b96b27c..ea552f71c88 100644 --- a/apps/website/src/components/product/local/HeroSection.vue +++ b/apps/website/src/components/product/local/HeroSection.vue @@ -9,6 +9,7 @@ import { t } from '../../../i18n/translations' import BrandButton from '../../common/BrandButton.vue' import ProductHeroBadge from '../../common/ProductHeroBadge.vue' import DownloadLocalButton from './DownloadLocalButton.vue' +import MobileDownloadEmailForm from './MobileDownloadEmailForm.vue' const { locale = 'en' } = defineProps<{ locale?: Locale }>() @@ -166,9 +167,9 @@ onUnmounted(() => {
- +
{
@@ -297,7 +298,8 @@ onUnmounted(() => { {{ t('download.hero.subtitle', locale) }}

-
+
+ ({ + isEnabled: true, + isMobileUa: true, + mockPreload: vi.fn(), + mockSubmit: vi.fn().mockResolvedValue(undefined) +})) + +vi.mock('../../../scripts/customerio', () => ({ + get isDownloadLinkRequestEnabled() { + return hoisted.isEnabled + }, + preloadDownloadLinkAnalytics: hoisted.mockPreload, + requestDownloadLink: hoisted.mockSubmit +})) + +vi.mock('../../../composables/useDownloadUrl', async () => { + const { computed } = await import('vue') + return { + useDownloadUrl: () => ({ + isMobileUa: computed(() => hoisted.isMobileUa) + }) + } +}) + +describe('MobileDownloadEmailForm', () => { + beforeEach(() => { + vi.clearAllMocks() + hoisted.isEnabled = true + hoisted.isMobileUa = true + }) + + afterEach(() => { + cleanup() + }) + + it('renders nothing when the write key is not configured', () => { + hoisted.isEnabled = false + render(MobileDownloadEmailForm) + expect(screen.queryByRole('textbox')).toBeNull() + }) + + it('renders nothing for non-mobile user agents', () => { + hoisted.isMobileUa = false + render(MobileDownloadEmailForm) + expect(screen.queryByRole('textbox')).toBeNull() + }) + + it('preloads the SDK when the visible form mounts', () => { + render(MobileDownloadEmailForm) + expect(hoisted.mockPreload).toHaveBeenCalledOnce() + }) + + it('does not preload the SDK for non-mobile user agents', () => { + hoisted.isMobileUa = false + render(MobileDownloadEmailForm) + expect(hoisted.mockPreload).not.toHaveBeenCalled() + }) + + it('shows an inline validation message for an invalid email and sends nothing', async () => { + const user = userEvent.setup() + render(MobileDownloadEmailForm) + + await user.type(screen.getByRole('textbox'), 'not-an-email') + await user.click( + screen.getByRole('button', { name: /send download link/i }) + ) + + const alert = await screen.findByRole('alert') + expect(alert.textContent).toMatch(/enter a valid email address/i) + const input = screen.getByRole('textbox') + expect(input.getAttribute('aria-invalid')).toBe('true') + expect(input.getAttribute('aria-describedby')).toBe(alert.id) + expect(hoisted.mockSubmit).not.toHaveBeenCalled() + }) + + it('fakes success without sending anything when the honeypot is filled', async () => { + const user = userEvent.setup() + render(MobileDownloadEmailForm) + + const visibleInput = screen.getByRole('textbox') + await user.type(visibleInput, 'someone@example.com') + const decoy = screen + .getAllByRole('textbox', { hidden: true }) + .find((input) => input !== visibleInput)! + await fireEvent.update(decoy, 'spam corp') + await user.click( + screen.getByRole('button', { name: /send download link/i }) + ) + + expect( + await screen.findByText(/link is sent to someone@example\.com/i) + ).toBeTruthy() + expect(hoisted.mockSubmit).not.toHaveBeenCalled() + }) + + it('shows an inline error on failure and lets a retry succeed', async () => { + const user = userEvent.setup() + hoisted.mockSubmit.mockRejectedValueOnce(new Error('network down')) + render(MobileDownloadEmailForm) + + await user.type(screen.getByRole('textbox'), 'someone@example.com') + const submitButton = screen.getByRole('button', { + name: /send download link/i + }) + await user.click(submitButton) + + expect(await screen.findByText(/something went wrong/i)).toBeTruthy() + expect(screen.getByRole('textbox')).toBeTruthy() + + await user.click(submitButton) + + expect( + await screen.findByText(/link is sent to someone@example\.com/i) + ).toBeTruthy() + expect(hoisted.mockSubmit).toHaveBeenCalledTimes(2) + }) + + it('locks out repeat taps and signals busy while a submission is in flight', async () => { + const user = userEvent.setup() + let resolveSubmit!: () => void + hoisted.mockSubmit.mockImplementationOnce( + () => + new Promise((resolve) => { + resolveSubmit = resolve + }) + ) + render(MobileDownloadEmailForm) + + await user.type(screen.getByRole('textbox'), 'someone@example.com') + const submitButton = screen.getByRole('button', { + name: /send download link/i + }) + await user.click(submitButton) + + expect(submitButton.getAttribute('aria-busy')).toBe('true') + expect((submitButton as HTMLButtonElement).disabled).toBe(true) + + await user.click(submitButton) + expect(hoisted.mockSubmit).toHaveBeenCalledTimes(1) + + resolveSubmit() + expect( + await screen.findByText(/link is sent to someone@example\.com/i) + ).toBeTruthy() + }) + + it('submits the entered email and swaps to the success line', async () => { + const user = userEvent.setup() + render(MobileDownloadEmailForm) + + await user.type(screen.getByRole('textbox'), 'someone@example.com') + await user.click( + screen.getByRole('button', { name: /send download link/i }) + ) + + expect(hoisted.mockSubmit).toHaveBeenCalledWith('someone@example.com', 'en') + expect( + await screen.findByText(/link is sent to someone@example\.com/i) + ).toBeTruthy() + expect(screen.queryByRole('textbox')).toBeNull() + }) + + it('moves focus to the success message when the form is removed', async () => { + const user = userEvent.setup() + render(MobileDownloadEmailForm) + + await user.type(screen.getByRole('textbox'), 'someone@example.com') + await user.click( + screen.getByRole('button', { name: /send download link/i }) + ) + + const successRegion = await screen.findByRole('status') + expect(successRegion.textContent).toMatch( + /link is sent to someone@example\.com/i + ) + // eslint-disable-next-line testing-library/no-node-access + expect(document.activeElement).toBe(successRegion) + }) + + it('forwards a non-default locale to requestDownloadLink', async () => { + const user = userEvent.setup() + render(MobileDownloadEmailForm, { props: { locale: 'zh-CN' } }) + + await user.type(screen.getByRole('textbox'), 'someone@example.com') + await user.click(screen.getByRole('button', { name: '发送下载链接' })) + + expect(hoisted.mockSubmit).toHaveBeenCalledWith( + 'someone@example.com', + 'zh-CN' + ) + }) +}) diff --git a/apps/website/src/components/product/local/MobileDownloadEmailForm.vue b/apps/website/src/components/product/local/MobileDownloadEmailForm.vue new file mode 100644 index 00000000000..3ca37561334 --- /dev/null +++ b/apps/website/src/components/product/local/MobileDownloadEmailForm.vue @@ -0,0 +1,159 @@ + + + diff --git a/apps/website/src/components/ui/icon-button/index.ts b/apps/website/src/components/ui/icon-button/index.ts index 0bbbffcdbb0..bb8b1d0daa0 100644 --- a/apps/website/src/components/ui/icon-button/index.ts +++ b/apps/website/src/components/ui/icon-button/index.ts @@ -11,7 +11,8 @@ export const iconButtonVariants = cva( ghost: 'text-primary-warm-white hover:text-primary-comfy-yellow bg-transparent', outline: - 'text-primary-comfy-yellow hover:bg-primary-comfy-yellow border-primary-comfy-yellow border-2 bg-primary-comfy-ink hover:text-primary-comfy-ink' + 'text-primary-comfy-yellow hover:bg-primary-comfy-yellow border-primary-comfy-yellow border-2 bg-primary-comfy-ink hover:text-primary-comfy-ink', + solid: 'bg-primary-comfy-yellow text-primary-comfy-ink hover:opacity-90' }, size: { sm: 'size-8', diff --git a/apps/website/src/composables/useDownloadUrl.test.ts b/apps/website/src/composables/useDownloadUrl.test.ts new file mode 100644 index 00000000000..ae3a948450c --- /dev/null +++ b/apps/website/src/composables/useDownloadUrl.test.ts @@ -0,0 +1,63 @@ +import { describe, expect, it } from 'vitest' + +import { detectDevice } from './useDownloadUrl' + +const UA = { + iphone: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1', + androidPhone: + 'Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36', + androidTablet: + 'Mozilla/5.0 (Linux; Android 14; SM-X910) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', + ipadLegacy: + 'Mozilla/5.0 (iPad; CPU OS 12_5_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1', + ipadDesktopMode: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15', + mac: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15', + windows: + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', + linux: + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' +} as const + +describe('detectDevice', () => { + it.for([ + { label: 'iPhone', ua: UA.iphone }, + { label: 'Android phone', ua: UA.androidPhone }, + { label: 'Android tablet', ua: UA.androidTablet }, + { label: 'iPad with legacy iPad UA', ua: UA.ipadLegacy } + ])('treats $label as mobile with no platform', ({ ua }) => { + expect(detectDevice(ua, 5)).toEqual({ + platform: null, + isMobileUa: true + }) + }) + + it('treats an iPad masquerading as a Mac (touch + Macintosh UA) as mobile', () => { + expect(detectDevice(UA.ipadDesktopMode, 5)).toEqual({ + platform: null, + isMobileUa: true + }) + }) + + it('treats a real Mac (no touch points) as a mac desktop', () => { + expect(detectDevice(UA.mac, 0)).toEqual({ + platform: 'mac', + isMobileUa: false + }) + }) + + it('treats a Windows touchscreen laptop as a windows desktop', () => { + expect(detectDevice(UA.windows, 10)).toEqual({ + platform: 'windows', + isMobileUa: false + }) + }) + + it('treats desktop Linux as an unknown desktop platform', () => { + expect(detectDevice(UA.linux, 0)).toEqual({ + platform: null, + isMobileUa: false + }) + }) +}) diff --git a/apps/website/src/composables/useDownloadUrl.ts b/apps/website/src/composables/useDownloadUrl.ts index 4a4b3603833..ca0590614e8 100644 --- a/apps/website/src/composables/useDownloadUrl.ts +++ b/apps/website/src/composables/useDownloadUrl.ts @@ -9,15 +9,26 @@ export const downloadUrls = { export type Platform = 'windows' | 'mac' -function isMobile(ua: string): boolean { - return /iphone|ipad|ipod|android/.test(ua) +export interface DetectedDevice { + platform: Platform | null + isMobileUa: boolean } -function detectPlatform(ua: string): Platform | null { - if (isMobile(ua)) return null - if (ua.includes('win')) return 'windows' - if (ua.includes('macintosh') || ua.includes('mac os x')) return 'mac' - return null +// iPadOS Safari sends a Macintosh desktop UA by default; real Macs report no +// touch points, so a "Mac" with a touchscreen is an iPad. +export function detectDevice( + ua: string, + maxTouchPoints: number +): DetectedDevice { + const lowerUa = ua.toLowerCase() + const isIpadOs = lowerUa.includes('macintosh') && maxTouchPoints > 1 + const isMobileUa = /iphone|ipad|ipod|android/.test(lowerUa) || isIpadOs + if (isMobileUa) return { platform: null, isMobileUa } + if (lowerUa.includes('win')) return { platform: 'windows', isMobileUa } + if (lowerUa.includes('macintosh') || lowerUa.includes('mac os x')) { + return { platform: 'mac', isMobileUa } + } + return { platform: null, isMobileUa } } // TODO: Only Windows x64 and macOS arm64 are available today. @@ -38,11 +49,11 @@ export function useDownloadUrl() { ) onMounted(() => { - const ua = navigator.userAgent.toLowerCase() - isMobileUa.value = isMobile(ua) - platform.value = detectPlatform(ua) + const device = detectDevice(navigator.userAgent, navigator.maxTouchPoints) + isMobileUa.value = device.isMobileUa + platform.value = device.platform detected.value = true }) - return { downloadUrl, platform, showFallback } + return { downloadUrl, platform, showFallback, isMobileUa } } diff --git a/apps/website/src/config/routes.ts b/apps/website/src/config/routes.ts index 3dc8469918e..45786bcefa4 100644 --- a/apps/website/src/config/routes.ts +++ b/apps/website/src/config/routes.ts @@ -25,6 +25,7 @@ const baseRoutes = { mcp: '/mcp', minimax: '/minimax', flux3: '/flux-3', + seedance: '/seedance-2.5', brand: '/brand' } as const diff --git a/apps/website/src/data/comingSoonHero.ts b/apps/website/src/data/comingSoonHero.ts new file mode 100644 index 00000000000..99a4367f94f --- /dev/null +++ b/apps/website/src/data/comingSoonHero.ts @@ -0,0 +1,5 @@ +// Every announcement page uses the same frosted backdrop: the art is byte +// identical across the Figma frames, so they share one asset rather than +// uploading a copy per model. +export const COMING_SOON_HERO = + 'https://media.comfy.org/website/coming-soon/hero.webp' diff --git a/apps/website/src/data/flux3.ts b/apps/website/src/data/flux3.ts index 13cd57cb6e0..9a4c71ce882 100644 --- a/apps/website/src/data/flux3.ts +++ b/apps/website/src/data/flux3.ts @@ -2,23 +2,254 @@ import type { ModelLaunchPage } from '../templates/model-launch/types' import { externalLinks } from '../config/routes' -// Flux 3 has not launched yet, so this page announces it and holds the URL. -// When the model ships, fill in the gallery, pricing, FAQ and closing CTA the -// way /minimax does; no new components are needed. +// Flux 3 launch footage, encoded to the site's web video profile and served +// from media.comfy.org. +const media = { + hero: 'https://media.comfy.org/website/flux-3/hero.mp4', + card1: 'https://media.comfy.org/website/flux-3/card-1.webm', + card2: 'https://media.comfy.org/website/flux-3/card-2.webm', + card3: 'https://media.comfy.org/website/flux-3/card-3.webm', + card4: 'https://media.comfy.org/website/flux-3/card-4.webm', + card5: 'https://media.comfy.org/website/flux-3/card-5.webm', + card6: 'https://media.comfy.org/website/flux-3/card-6.webm' +} as const + export const flux3Page: ModelLaunchPage = { metaTitleKey: 'flux3.meta.title', metaDescriptionKey: 'flux3.meta.description', breadcrumbLabelKey: 'flux3.breadcrumb.model', breadcrumbUpdatedKey: 'flux3.breadcrumb.updated', hero: { - eyebrowKey: 'flux3.hero.eyebrow', + videoSrc: media.hero, titleKey: 'flux3.hero.title', + titleRestKey: 'flux3.hero.titleRest', + descriptionKey: 'flux3.hero.description', primaryCta: { labelKey: 'flux3.hero.primaryCta', href: externalLinks.cloud, target: '_blank' }, - badgeKeys: ['flux3.hero.tagPartnerNodes', 'flux3.hero.tagImageToVideo'] + secondaryCta: { + labelKey: 'flux3.hero.secondaryCta', + href: externalLinks.workflows, + target: '_blank' + }, + badgeKeys: ['flux3.hero.tagPartnerNodes', 'flux3.hero.tagOpenWeightsSoon'] + }, + gallery: { + headingKey: 'flux3.models.heading', + cards: [ + { + id: 'lake-valley', + name: { en: 'Flux 3', 'zh-CN': 'Flux 3' }, + tier: 'premium', + note: { en: 'Pay-as-you-go', 'zh-CN': '按量付费' }, + description: { + en: 'A peaceful pixelated lake valley holds every detail as the camera pushes in.', + 'zh-CN': '宁静的像素风湖谷,镜头推进时每个细节都清晰保留。' + }, + mediaSrc: media.card1, + href: externalLinks.workflows + }, + { + id: 'three-dancers', + name: { en: 'Flux 3', 'zh-CN': 'Flux 3' }, + tier: 'premium', + note: { en: 'Pay-as-you-go', 'zh-CN': '按量付费' }, + description: { + en: 'Three dancers, three rooms, one rhythm, timing locked across every panel.', + 'zh-CN': '三位舞者、三个房间、同一个节奏,每一格画面的节拍都锁得住。' + }, + mediaSrc: media.card2, + href: externalLinks.workflows + }, + { + id: 'porcelain', + name: { en: 'Flux 3', 'zh-CN': 'Flux 3' }, + tier: 'premium', + note: { en: 'Pay-as-you-go', 'zh-CN': '按量付费' }, + description: { + en: 'Shattered porcelain reassembles on white, every fragment tracked in reverse.', + 'zh-CN': '碎裂的青花瓷在白色背景上复原,每一片碎片都被倒放追踪。' + }, + mediaSrc: media.card3, + href: externalLinks.workflows + }, + { + id: 'drone-transition', + name: { en: 'Flux 3', 'zh-CN': 'Flux 3' }, + tier: 'premium', + note: { en: 'Pay-as-you-go', 'zh-CN': '按量付费' }, + description: { + en: 'A drone crosses from one environment to the next.', + 'zh-CN': '无人机从一个场景穿越到下一个场景。' + }, + mediaSrc: media.card4, + href: externalLinks.workflows + }, + { + id: 'outlaws', + name: { en: 'Flux 3', 'zh-CN': 'Flux 3' }, + tier: 'premium', + note: { en: 'Pay-as-you-go', 'zh-CN': '按量付费' }, + description: { + en: 'Outlaws ride into town, hooves and crowd noise with the frame.', + 'zh-CN': '匪徒骑马进城,马蹄声与人群嘈杂声随画面同步生成。' + }, + mediaSrc: media.card5, + href: externalLinks.workflows + }, + { + id: 'bear-checkpoint', + name: { en: 'Flux 3', 'zh-CN': 'Flux 3' }, + tier: 'premium', + note: { en: 'Pay-as-you-go', 'zh-CN': '按量付费' }, + description: { + en: 'A bear closes in at the checkpoint, game-engine look held steady.', + 'zh-CN': '一头熊在检查站前逼近,游戏引擎般的质感稳定统一。' + }, + mediaSrc: media.card6, + href: externalLinks.workflows + } + ] + }, + pricing: { + // The Figma opens this page on monthly, as /minimax does. + defaultBillingCycle: 'monthly', + banner: { + titleKey: 'flux3.pricing.banner.title', + subtitleKey: 'flux3.pricing.banner.subtitle', + cta: { + labelKey: 'flux3.pricing.banner.cta', + href: externalLinks.cloud, + target: '_blank' + } + } + }, + faq: { + headingKey: 'flux3.faq.heading', + items: [ + { + id: 'prompt-syntax', + question: { + en: 'Do I need special prompt syntax or keywords for Flux 3?', + 'zh-CN': 'Flux 3 需要特殊的提示词语法或关键词吗?' + }, + answer: { + en: 'No. Flux 3 interprets and rewrites your prompt before generation, so plain language works. Describe the scene the way you would brief a colleague. Keyword stacking and caption-style prose add nothing.', + 'zh-CN': + '不需要。Flux 3 会在生成前理解并改写你的提示词,因此用日常语言就可以。像给同事交代拍摄需求那样描述画面即可。堆砌关键词或写成图注式短语没有额外帮助。' + } + }, + { + id: 'prompt-rewriting', + question: { + en: 'Does Flux 3 change my prompt? Will it override what I asked for?', + 'zh-CN': 'Flux 3 会改写我的提示词吗?会不会覆盖我的要求?' + }, + answer: { + en: "It rewrites, but the rewrite preserves what you explicitly specify. The more precisely you describe a scene, the more of the output is your call rather than the model's. Vague prompts hand control to the rewriter.", + 'zh-CN': + '它会改写,但你明确指定的内容会被保留。你对画面描述得越精确,成片就越由你决定,而不是由模型决定。含糊的提示词等于把控制权交给改写环节。' + } + }, + { + id: 'burned-in-text', + question: { + en: 'Why is my text appearing burned into the video instead of being spoken?', + 'zh-CN': '为什么我的文字变成了画面上的字幕,而不是被念出来?' + }, + answer: { + en: 'Quoted text without a visible speaker tends to render as on-screen text. To get a spoken line: quote the line, describe a speaker visible on camera, and add "no on-screen text, no subtitles".', + 'zh-CN': + '如果引号中的文字没有对应的出镜说话者,通常会被渲染成画面文字。想要念出来的台词:把台词放在引号里,描述一个出现在镜头中的说话者,并加上 "no on-screen text, no subtitles"。' + } + }, + { + id: 'audio-control', + question: { + en: 'How do I control audio in Flux 3?', + 'zh-CN': '如何控制 Flux 3 的音频?' + }, + answer: { + en: 'Describe audio in layers and name each one separately: ambient sound, music, and speech. Each lands as its own layer. Lumping them into one phrase gives you less control over the mix.', + 'zh-CN': + '把音频分层描述,并分别点名:环境音、音乐、人声。每一项都会作为独立的音轨生成。把它们塞进一句话里,会让你对混音的控制变弱。' + } + }, + { + id: 'multi-shot', + question: { + en: 'Can Flux 3 generate multiple shots in one generation?', + 'zh-CN': 'Flux 3 能在一次生成里输出多个镜头吗?' + }, + answer: { + en: 'Yes. Structure the prompt as "SHOT ONE ... HARD CUT. SHOT TWO ..." and it produces real cuts inside a single generation. For an uncut take, ask explicitly for "one continuous unbroken shot".', + 'zh-CN': + '可以。把提示词写成 "SHOT ONE ... HARD CUT. SHOT TWO ..." 的结构,它就会在一次生成中产生真正的剪切点。如果要一镜到底,请明确写出 "one continuous unbroken shot"。' + } + }, + { + id: 'cuts-not-reading', + question: { + en: 'Why do my cuts not look like cuts?', + 'zh-CN': '为什么我的剪切点看起来不像剪切?' + }, + answer: { + en: 'Consecutive shots that are too similar will not register as edits. Change scale, location, or colour between shots so the cut reads cleanly.', + 'zh-CN': + '相邻镜头如果太相似,就不会被看成一次剪辑。在镜头之间改变景别、场景或色调,剪切点才会清晰可辨。' + } + }, + { + id: 'music-bed', + question: { + en: 'Can I hold one music bed across multiple shots?', + 'zh-CN': '可以让同一段配乐贯穿多个镜头吗?' + }, + answer: { + en: 'Yes. Specify it directly, such as "one continuous music bed across all three shots", alongside the shot structure.', + 'zh-CN': + '可以。在镜头结构旁边直接写明,例如 "one continuous music bed across all three shots"。' + } + }, + { + id: 'prompt-examples', + question: { + en: 'What does a good Flux 3 prompt look like?', + 'zh-CN': '一个好的 Flux 3 提示词是什么样的?' + }, + answer: { + en: `Three examples, copy and paste ready. + +Plain brief: A cozy ramen shop on a rainy Tokyo night: steam rising from the broth, neon reflections in the window puddles, the cook working calmly. Rain patter and quiet kitchen sounds. + +Spoken line: A weather presenter on camera in front of a stylized storm map, speaking directly to the lens: "Storm season is here and this time, we're ready." Confident delivery, clean studio lighting. No on-screen text, no subtitles. + +Multi-shot: SHOT ONE: wide aerial of a desert highway at dawn, a single red car speeding through. HARD CUT. SHOT TWO: interior close-up, the driver's hands drumming the wheel to the radio. HARD CUT. SHOT THREE: from the roadside, the car shrinking into the heat haze. Warm engine hum under one continuous music bed across all three shots.`, + 'zh-CN': `三个可直接复制使用的示例(提示词保留英文原文,以保证效果一致)。 + +日常描述:A cozy ramen shop on a rainy Tokyo night: steam rising from the broth, neon reflections in the window puddles, the cook working calmly. Rain patter and quiet kitchen sounds. + +带台词:A weather presenter on camera in front of a stylized storm map, speaking directly to the lens: "Storm season is here and this time, we're ready." Confident delivery, clean studio lighting. No on-screen text, no subtitles. + +多镜头:SHOT ONE: wide aerial of a desert highway at dawn, a single red car speeding through. HARD CUT. SHOT TWO: interior close-up, the driver's hands drumming the wheel to the radio. HARD CUT. SHOT THREE: from the roadside, the car shrinking into the heat haze. Warm engine hum under one continuous music bed across all three shots.` + } + } + ] + }, + closingCta: { + headingKey: 'flux3.cta.heading', + primaryCta: { + labelKey: 'flux3.cta.primaryCta', + href: externalLinks.cloud, + target: '_blank' + }, + secondaryCta: { + labelKey: 'flux3.cta.secondaryCta', + href: externalLinks.workflows, + target: '_blank' + } }, runOptions: { headingKey: 'flux3.runOptions.heading', diff --git a/apps/website/src/data/gallery.ts b/apps/website/src/data/gallery.ts index bf066ed8d3d..c9a2c4d12f4 100644 --- a/apps/website/src/data/gallery.ts +++ b/apps/website/src/data/gallery.ts @@ -184,8 +184,3 @@ const galleryItems: GalleryItem[] = [ export const visibleGalleryItems: GalleryItem[] = galleryItems.filter( (item) => item.visible !== false ) - -/** @knipIgnoreUsedByStackedPR */ -export function getGalleryItemById(id: string): GalleryItem | undefined { - return galleryItems.find((item) => item.id === id) -} diff --git a/apps/website/src/data/seedance.ts b/apps/website/src/data/seedance.ts new file mode 100644 index 00000000000..d3458e812a0 --- /dev/null +++ b/apps/website/src/data/seedance.ts @@ -0,0 +1,38 @@ +import type { ModelLaunchPage } from '../templates/model-launch/types' + +import { externalLinks } from '../config/routes' +import { COMING_SOON_HERO } from './comingSoonHero' + +// Seedance 2.5 has not shipped yet, so this page announces it and holds the +// URL. On launch day, replace this config with the full one the way /flux-3 +// did; the page stubs and the template stay as they are. +export const seedancePage: ModelLaunchPage = { + metaTitleKey: 'seedance.meta.title', + metaDescriptionKey: 'seedance.meta.description', + breadcrumbLabelKey: 'seedance.breadcrumb.model', + breadcrumbUpdatedKey: 'seedance.breadcrumb.updated', + hero: { + layout: 'overlay', + placeholderImageSrc: COMING_SOON_HERO, + eyebrowKey: 'seedance.hero.eyebrow', + titleKey: 'seedance.hero.title', + primaryCta: { + labelKey: 'seedance.hero.primaryCta', + href: externalLinks.cloud, + target: '_blank' + } + }, + runOptions: { + headingKey: 'seedance.runOptions.heading', + subtitleKey: 'seedance.runOptions.subtitle', + ctaKey: 'seedance.runOptions.cta' + }, + reviews: { + headingKey: 'seedance.reviews.heading', + highlight: { + titleKey: 'seedance.reviews.highlightTitle', + descriptionKey: 'seedance.reviews.highlightDescription', + ctaKey: 'seedance.reviews.highlightCta' + } + } +} diff --git a/apps/website/src/i18n/translations.ts b/apps/website/src/i18n/translations.ts index 998489a3f49..bd0a3a53f4e 100644 --- a/apps/website/src/i18n/translations.ts +++ b/apps/website/src/i18n/translations.ts @@ -6,6 +6,10 @@ const translations = { en: 'Partner Nodes', 'zh-CN': '合作伙伴节点' }, + 'tags.openWeights': { + en: 'Open Weights', + 'zh-CN': '开放权重' + }, 'tags.imageToVideo': { en: 'Image To Video', 'zh-CN': '图像生成视频' @@ -115,6 +119,33 @@ const translations = { 'zh-CN': '运行你的第一个工作流' }, + // Model release card (home page) + 'modelRelease.eyebrow': { + en: 'New Model Release', + 'zh-CN': '新模型发布' + }, + 'modelRelease.title': { + en: 'MiniMax H3', + 'zh-CN': 'MiniMax H3' + }, + 'modelRelease.body': { + en: 'Full multi-modal I/O, native stereo clip. Up to 2K, 5 to 15s per generation. H3 actually conditions on input audio where others overwrite or drop it.', + 'zh-CN': + '完整的多模态输入输出,原生立体声剪辑。最高 2K,每次生成 5 至 15 秒。H3 真正基于输入音频进行条件生成,而其他模型则会覆盖或丢弃它。' + }, + 'modelRelease.viewFeatures': { + en: 'View Model Features', + 'zh-CN': '查看模型特性' + }, + 'modelRelease.tryWorkflows': { + en: 'Try Workflows', + 'zh-CN': '试用工作流' + }, + 'modelRelease.videoAriaLabel': { + en: 'MiniMax H3 preview', + 'zh-CN': 'MiniMax H3 预览' + }, + // ProductShowcaseSection 'showcase.subtitle1': { en: 'Connect models, processing steps, and outputs on a canvas where every decision is visible and every step is inspectable.', @@ -806,6 +837,36 @@ const translations = { 'zh-CN': '从 GITHUB 安装' }, + // Download – MobileDownloadEmailForm + 'download.emailForm.heading': { + en: 'Get download link', + 'zh-CN': '获取下载链接' + }, + 'download.emailForm.emailLabel': { + en: 'Email address', + 'zh-CN': '邮箱地址' + }, + 'download.emailForm.placeholder': { + en: 'you@email.com', + 'zh-CN': 'you@email.com' + }, + 'download.emailForm.submit': { + en: 'Send download link', + 'zh-CN': '发送下载链接' + }, + 'download.emailForm.success': { + en: 'The link is sent to {email}!', + 'zh-CN': '下载链接已发送至 {email}!' + }, + 'download.emailForm.invalidEmail': { + en: 'Please enter a valid email address.', + 'zh-CN': '请输入有效的邮箱地址。' + }, + 'download.emailForm.error': { + en: 'Something went wrong. Please try again.', + 'zh-CN': '出错了,请重试。' + }, + // Download – CloudBannerSection 'download.cloud.prefix': { en: 'Need more power?', @@ -2527,6 +2588,7 @@ const translations = { 'footer.company': { en: 'Company', 'zh-CN': '公司' }, 'footer.contact': { en: 'Contact', 'zh-CN': '联系我们' }, 'footer.minimaxH3': { en: 'MiniMax H3', 'zh-CN': 'MiniMax H3' }, + 'footer.seedance': { en: 'Seedance 2.5', 'zh-CN': 'Seedance 2.5' }, 'footer.about': { en: 'About', 'zh-CN': '关于' }, 'footer.termsOfService': { en: 'Terms of Service', 'zh-CN': '服务条款' }, 'footer.privacyPolicy': { en: 'Privacy Policy', 'zh-CN': '隐私政策' }, @@ -4553,6 +4615,18 @@ const translations = { en: 'READ SUBSCRIPTION DOCS', 'zh-CN': '查看订阅文档' }, + 'payment.failed.statusPrompt.prefix': { + en: 'Check our', + 'zh-CN': '请查看我们的' + }, + 'payment.failed.statusPrompt.statusLink': { + en: 'status page', + 'zh-CN': '状态页面' + }, + 'payment.failed.statusPrompt.suffix': { + en: 'for more information.', + 'zh-CN': '了解更多信息。' + }, // AffiliateHeroSection 'affiliate.hero.label': { en: 'AFFILIATE', 'zh-CN': '联盟' }, @@ -4936,45 +5010,86 @@ const translations = { // Shared by every model-launch gallery card (see templates/model-launch). 'modelLaunch.tagFree': { en: 'Free', 'zh-CN': '免费' }, 'modelLaunch.tagPremium': { en: 'Premium', 'zh-CN': '高级' }, - // Flux 3 model page (/flux-3) — announcement only until the model ships + // Flux 3 model page (/flux-3) 'flux3.meta.title': { - en: 'Flux 3 on Comfy — Coming Soon', - 'zh-CN': 'Comfy 上的 Flux 3 — 即将推出' + en: 'Flux 3 on Comfy — Video With Native Audio', + 'zh-CN': 'Comfy 上的 Flux 3 — 带原生音频的视频模型' }, 'flux3.meta.description': { - en: 'Flux 3 is coming to Comfy. Run it on Comfy Cloud the day it lands, or start building workflows for free now with every other model Comfy supports.', + en: "Run Flux 3 on Comfy: Black Forest Labs' multimodal model generates video with native audio, up to 20 seconds in one generation, from text, image, video or keyframes.", 'zh-CN': - 'Flux 3 即将登陆 Comfy。上线当天即可在 Comfy Cloud 上运行;现在就可以用 Comfy 支持的其他模型免费开始搭建工作流。' + '在 Comfy 上运行 Flux 3:Black Forest Labs 的多模态模型可生成带原生音频的视频,单次生成最长 20 秒,支持文本、图像、视频或关键帧输入。' }, 'flux3.breadcrumb.model': { en: 'Flux 3', 'zh-CN': 'Flux 3' }, 'flux3.breadcrumb.updated': { en: 'Updated August 2026', 'zh-CN': '更新于 2026 年 8 月' }, - 'flux3.hero.eyebrow': { en: 'New', 'zh-CN': '全新' }, 'flux3.hero.title': { - en: 'Flux 3 coming soon', - 'zh-CN': 'Flux 3 即将推出' + en: 'Flux 3', + 'zh-CN': 'Flux 3' }, - 'flux3.hero.primaryCta': { - en: 'RUN COMFY FOR FREE', - 'zh-CN': '免费使用 Comfy' + 'flux3.hero.titleRest': { + en: ' is here', + 'zh-CN': ' 已上线' + }, + 'flux3.hero.description': { + en: 'Flux 3 generates video with native audio, up to 20 seconds in a single generation. Go text to video or image to video. Run it on Comfy Cloud today. Open weights coming soon.', + 'zh-CN': + 'Flux 3 可生成带原生音频的视频,单次生成最长 20 秒。支持文本生成视频与图像生成视频。今天就在 Comfy Cloud 上运行它。开源权重即将推出。' }, 'flux3.hero.tagPartnerNodes': { - en: 'Partner node', + en: 'Partner nodes', 'zh-CN': '合作伙伴节点' }, - 'flux3.hero.tagImageToVideo': { - en: 'Image to video', - 'zh-CN': '图像生成视频' + 'flux3.hero.tagOpenWeightsSoon': { + en: 'Open weights coming soon', + 'zh-CN': '开源权重即将推出' + }, + 'flux3.hero.primaryCta': { + en: 'RUN FLUX 3', + 'zh-CN': '运行 Flux 3' + }, + 'flux3.hero.secondaryCta': { + en: 'TRY WORKFLOWS', + 'zh-CN': '试用工作流' + }, + 'flux3.cta.heading': { + en: 'Twenty seconds with sound, in one generation.', + 'zh-CN': '二十秒,自带声音,一次生成。' + }, + 'flux3.cta.primaryCta': { + en: 'RUN FLUX 3', + 'zh-CN': '运行 Flux 3' + }, + 'flux3.cta.secondaryCta': { + en: 'TRY WORKFLOWS', + 'zh-CN': '试用工作流' + }, + 'flux3.pricing.banner.title': { + en: "Start Comfy Cloud for free. Upgrade when you're ready.", + 'zh-CN': '免费开始使用 Comfy Cloud,准备好了再升级。' + }, + 'flux3.pricing.banner.subtitle': { + en: '5 free runs on real GPUs — no credit card required.', + 'zh-CN': '在真实 GPU 上免费运行 5 次 — 无需信用卡。' + }, + 'flux3.pricing.banner.cta': { en: 'TRY FREE', 'zh-CN': '免费试用' }, + 'flux3.faq.heading': { + en: 'Q&A', + 'zh-CN': '问答' + }, + 'flux3.models.heading': { + en: 'Made with Flux 3', + 'zh-CN': '用 Flux 3 制作' }, 'flux3.runOptions.heading': { en: 'One engine, every way to run it', 'zh-CN': '同一引擎,多种运行方式' }, 'flux3.runOptions.subtitle': { - en: 'Build workflows in the browser today. Batch campaigns with the API, or bring it in-house.', - 'zh-CN': '今天就在浏览器中搭建工作流。用 API 批量制作,或部署到自有环境。' + en: 'Run Flux 3 in the browser today. Batch campaigns with the API, or bring it in-house.', + 'zh-CN': '今天就在浏览器中运行 Flux 3。用 API 批量制作,或部署到自有环境。' }, 'flux3.runOptions.cta': { en: 'LEARN MORE', @@ -4994,6 +5109,59 @@ const translations = { '你的 AI 助手可以接入整个生态、构建工作流,并生成图像、视频、音频或 3D 内容。' }, 'flux3.reviews.highlightCta': { en: 'GET STARTED', 'zh-CN': '开始使用' }, + // Seedance 2.5 model page (/seedance-2.5) — announcement until the model ships + 'seedance.meta.title': { + en: 'Seedance 2.5 on Comfy — Coming Soon', + 'zh-CN': 'Comfy 上的 Seedance 2.5 — 即将推出' + }, + 'seedance.meta.description': { + en: 'Seedance 2.5 is coming to Comfy. Run it on Comfy Cloud the day it lands, or start building workflows for free now with every other model Comfy supports.', + 'zh-CN': + 'Seedance 2.5 即将登陆 Comfy。上线当天即可在 Comfy Cloud 上运行;现在就可以用 Comfy 支持的其他模型免费开始搭建工作流。' + }, + 'seedance.breadcrumb.model': { + en: 'Seedance 2.5', + 'zh-CN': 'Seedance 2.5' + }, + 'seedance.breadcrumb.updated': { + en: 'Updated August 2026', + 'zh-CN': '更新于 2026 年 8 月' + }, + 'seedance.hero.eyebrow': { en: 'Coming soon', 'zh-CN': '即将推出' }, + 'seedance.hero.title': { + en: 'Seedance 2.5', + 'zh-CN': 'Seedance 2.5' + }, + 'seedance.hero.primaryCta': { + en: 'RUN COMFY FOR FREE', + 'zh-CN': '免费使用 Comfy' + }, + 'seedance.runOptions.heading': { + en: 'One engine, every way to run it', + 'zh-CN': '同一引擎,多种运行方式' + }, + 'seedance.runOptions.subtitle': { + en: 'Build workflows in the browser today. Batch campaigns with the API, or bring it in-house.', + 'zh-CN': '今天就在浏览器中搭建工作流。用 API 批量制作,或部署到自有环境。' + }, + 'seedance.runOptions.cta': { + en: 'LEARN MORE', + 'zh-CN': '了解更多' + }, + 'seedance.reviews.heading': { + en: '4+ million Comfy creators say', + 'zh-CN': '超过 400 万 Comfy 创作者这样说' + }, + 'seedance.reviews.highlightTitle': { + en: 'Comfy MCP: now turn your agent into a creative technologist.', + 'zh-CN': 'Comfy MCP:让你的智能体成为创意技术专家。' + }, + 'seedance.reviews.highlightDescription': { + en: 'Your AI assistant can access the ecosystem, build workflows, and generate images, video, audio, or 3D.', + 'zh-CN': + '你的 AI 助手可以接入整个生态、构建工作流,并生成图像、视频、音频或 3D 内容。' + }, + 'seedance.reviews.highlightCta': { en: 'GET STARTED', 'zh-CN': '开始使用' }, 'minimax.meta.title': { en: 'MiniMax H3 on Comfy — Open-Weight Video Model', 'zh-CN': 'Comfy 上的 MiniMax H3 — 开源权重视频模型' diff --git a/apps/website/src/pages/index.astro b/apps/website/src/pages/index.astro index 079089234b0..b97fab216cf 100644 --- a/apps/website/src/pages/index.astro +++ b/apps/website/src/pages/index.astro @@ -2,6 +2,7 @@ import BaseLayout from "../layouts/BaseLayout.astro"; import ProductCardsSection from "../components/home/ProductCardsSection.vue"; import HeroSection from "../components/home/HeroSection.vue"; +import ModelReleaseSection from "../components/home/ModelReleaseSection.vue"; import SocialProofBarSection from "../components/common/SocialProofBarSection.vue"; import ProductShowcaseSection from "../components/home/ProductShowcaseSection.vue"; import UseCaseSection from "../components/home/UseCaseSection.vue"; @@ -45,6 +46,7 @@ const { siteUrl } = pageContext( > + diff --git a/apps/website/src/pages/seedance-2.5.astro b/apps/website/src/pages/seedance-2.5.astro new file mode 100644 index 00000000000..8fdb2bb2c79 --- /dev/null +++ b/apps/website/src/pages/seedance-2.5.astro @@ -0,0 +1,6 @@ +--- +import ModelLaunchPage from '../templates/model-launch/ModelLaunchPage.astro' +import { seedancePage } from '../data/seedance' +--- + + diff --git a/apps/website/src/pages/zh-CN/index.astro b/apps/website/src/pages/zh-CN/index.astro index 030006addc1..9a38701604d 100644 --- a/apps/website/src/pages/zh-CN/index.astro +++ b/apps/website/src/pages/zh-CN/index.astro @@ -2,6 +2,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro' import ProductCardsSection from '../../components/home/ProductCardsSection.vue' import HeroSection from '../../components/home/HeroSection.vue' +import ModelReleaseSection from '../../components/home/ModelReleaseSection.vue' import SocialProofBarSection from '../../components/common/SocialProofBarSection.vue' import ProductShowcaseSection from '../../components/home/ProductShowcaseSection.vue' import UseCaseSection from '../../components/home/UseCaseSection.vue' @@ -32,6 +33,7 @@ const { siteUrl } = pageContext( > + diff --git a/apps/website/src/pages/zh-CN/seedance-2.5.astro b/apps/website/src/pages/zh-CN/seedance-2.5.astro new file mode 100644 index 00000000000..605f5369ba1 --- /dev/null +++ b/apps/website/src/pages/zh-CN/seedance-2.5.astro @@ -0,0 +1,6 @@ +--- +import ModelLaunchPage from '../../templates/model-launch/ModelLaunchPage.astro' +import { seedancePage } from '../../data/seedance' +--- + + diff --git a/apps/website/src/scripts/customerio.test.ts b/apps/website/src/scripts/customerio.test.ts new file mode 100644 index 00000000000..173f3c4d29b --- /dev/null +++ b/apps/website/src/scripts/customerio.test.ts @@ -0,0 +1,97 @@ +// @vitest-environment happy-dom +import { beforeEach, describe, expect, it, vi } from 'vitest' + +const hoisted = vi.hoisted(() => ({ + sdkImported: vi.fn(), + mockIdentify: vi.fn().mockResolvedValue(undefined), + mockTrack: vi.fn().mockResolvedValue(undefined), + mockLoad: vi.fn() +})) + +vi.mock('@customerio/cdp-analytics-browser', () => { + hoisted.sdkImported() + // AnalyticsBrowser.load returns a thenable resolving to [Analytics, Context] + return { + AnalyticsBrowser: { + load: hoisted.mockLoad.mockReturnValue( + Promise.resolve([ + { identify: hoisted.mockIdentify, track: hoisted.mockTrack }, + {} + ]) + ) + } + } +}) + +async function importModule(writeKey: string) { + vi.stubEnv('PUBLIC_CUSTOMERIO_WRITE_KEY', writeKey) + return import('./customerio') +} + +describe('customerio', () => { + beforeEach(() => { + vi.clearAllMocks() + vi.resetModules() + vi.unstubAllEnvs() + }) + + it('is disabled and never loads the SDK when the write key is empty', async () => { + const { isDownloadLinkRequestEnabled, preloadDownloadLinkAnalytics } = + await importModule('') + + expect(isDownloadLinkRequestEnabled).toBe(false) + preloadDownloadLinkAnalytics() + + expect(hoisted.sdkImported).not.toHaveBeenCalled() + expect(hoisted.mockIdentify).not.toHaveBeenCalled() + expect(hoisted.mockTrack).not.toHaveBeenCalled() + }) + + it('identifies by email then tracks download_link_requested with locale and page', async () => { + const { isDownloadLinkRequestEnabled, requestDownloadLink } = + await importModule('test-key') + + expect(isDownloadLinkRequestEnabled).toBe(true) + await requestDownloadLink('someone@example.com', 'zh-CN') + + expect(hoisted.mockLoad).toHaveBeenCalledWith({ writeKey: 'test-key' }) + expect(hoisted.mockIdentify).toHaveBeenCalledWith('someone@example.com', { + email: 'someone@example.com' + }) + expect(hoisted.mockTrack).toHaveBeenCalledWith('download_link_requested', { + locale: 'zh-CN', + page: window.location.pathname + }) + expect(hoisted.mockIdentify.mock.invocationCallOrder[0]).toBeLessThan( + hoisted.mockTrack.mock.invocationCallOrder[0] + ) + }) + + it('retries the SDK load on the next submit instead of caching a failed load', async () => { + const { preloadDownloadLinkAnalytics, requestDownloadLink } = + await importModule('test-key') + + hoisted.mockLoad.mockRejectedValueOnce(new Error('offline')) + preloadDownloadLinkAnalytics() + await expect(requestDownloadLink('a@example.com', 'en')).rejects.toThrow( + 'offline' + ) + + await requestDownloadLink('a@example.com', 'en') + + expect(hoisted.mockLoad).toHaveBeenCalledTimes(2) + expect(hoisted.mockTrack).toHaveBeenCalledTimes(1) + }) + + it('loads the SDK once across preload and repeated submits', async () => { + const { preloadDownloadLinkAnalytics, requestDownloadLink } = + await importModule('test-key') + + preloadDownloadLinkAnalytics() + await requestDownloadLink('a@example.com', 'en') + await requestDownloadLink('b@example.com', 'en') + + expect(hoisted.mockLoad).toHaveBeenCalledTimes(1) + expect(hoisted.mockTrack).toHaveBeenCalledTimes(2) + }) +}) diff --git a/apps/website/src/scripts/customerio.ts b/apps/website/src/scripts/customerio.ts new file mode 100644 index 00000000000..8e70e7ccc9c --- /dev/null +++ b/apps/website/src/scripts/customerio.ts @@ -0,0 +1,43 @@ +import type { Analytics } from '@customerio/cdp-analytics-browser' + +import type { Locale } from '@/i18n/translations' + +// Public client-side key for the "comfy.org website" Customer.io source, +// overridable per-environment; setting the env var to '' disables the form. +const CUSTOMER_IO_WEBSITE_WRITE_KEY: string = + import.meta.env.PUBLIC_CUSTOMERIO_WRITE_KEY ?? '77380595dd956c04ac7c' + +export const isDownloadLinkRequestEnabled = CUSTOMER_IO_WEBSITE_WRITE_KEY !== '' + +let analyticsPromise: Promise | null = null + +function loadAnalytics(): Promise { + analyticsPromise ??= import('@customerio/cdp-analytics-browser') + .then(async ({ AnalyticsBrowser }) => { + const [analytics] = await AnalyticsBrowser.load({ + writeKey: CUSTOMER_IO_WEBSITE_WRITE_KEY + }) + return analytics + }) + .catch((err: unknown) => { + // Don't cache failures - let the next call retry the load. + analyticsPromise = null + throw err + }) + return analyticsPromise +} + +export function preloadDownloadLinkAnalytics() { + if (!isDownloadLinkRequestEnabled) return + // Preload is best-effort; a failure here will be retried on submit. + void loadAnalytics().catch(() => {}) +} + +export async function requestDownloadLink(email: string, locale: Locale) { + const analytics = await loadAnalytics() + await analytics.identify(email, { email }) + await analytics.track('download_link_requested', { + locale, + page: window.location.pathname + }) +} diff --git a/apps/website/src/templates/model-launch/ModelLaunchGallerySection.vue b/apps/website/src/templates/model-launch/ModelLaunchGallerySection.vue index 9d3f376a577..3cc0ac47f12 100644 --- a/apps/website/src/templates/model-launch/ModelLaunchGallerySection.vue +++ b/apps/website/src/templates/model-launch/ModelLaunchGallerySection.vue @@ -84,7 +84,7 @@ const { stop } = useIntersectionObserver( : t('modelLaunch.tagPremium', locale) }} - + {{ card.note[locale] }}
@@ -96,7 +96,7 @@ const { stop } = useIntersectionObserver( rel="noopener" :aria-label="card.name[locale]" size="sm" - class="bg-primary-warm-gray hover:bg-primary-comfy-yellow rounded-xl text-primary-comfy-ink hover:text-primary-comfy-ink" + class="hover:bg-primary-comfy-yellow rounded-xl bg-primary-warm-gray text-primary-comfy-ink hover:text-primary-comfy-ink" > diff --git a/apps/website/src/templates/model-launch/ModelLaunchHeroSection.vue b/apps/website/src/templates/model-launch/ModelLaunchHeroSection.vue index 01fd4267caf..2f31bb195e5 100644 --- a/apps/website/src/templates/model-launch/ModelLaunchHeroSection.vue +++ b/apps/website/src/templates/model-launch/ModelLaunchHeroSection.vue @@ -1,4 +1,6 @@ diff --git a/apps/website/src/templates/model-launch/modelLaunchPages.test.ts b/apps/website/src/templates/model-launch/modelLaunchPages.test.ts index f17c1943c42..123e06d783b 100644 --- a/apps/website/src/templates/model-launch/modelLaunchPages.test.ts +++ b/apps/website/src/templates/model-launch/modelLaunchPages.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest' import { flux3Page } from '../../data/flux3' import { minimaxPage } from '../../data/minimax' +import { seedancePage } from '../../data/seedance' import type { TranslationKey } from '../../i18n/translations' import { t } from '../../i18n/translations' import type { ModelLaunchPage } from './types' @@ -9,10 +10,11 @@ import type { ModelLaunchPage } from './types' // Add every new launch-page config here so it inherits these checks. const pages: { name: string; page: ModelLaunchPage }[] = [ { name: 'minimax', page: minimaxPage }, - { name: 'flux3', page: flux3Page } + { name: 'flux3', page: flux3Page }, + { name: 'seedance', page: seedancePage } ] -describe.each(pages)('$name launch page config', ({ page }) => { +describe.for(pages)('$name launch page config', ({ page }) => { it('gives every gallery card a unique id', () => { const ids = page.gallery?.cards.map((card) => card.id) ?? [] expect(new Set(ids).size).toBe(ids.length) @@ -82,13 +84,13 @@ describe.each(pages)('$name launch page config', ({ page }) => { ].filter((href): href is string => href !== undefined) for (const href of hrefs) { - expect(href, href).toMatch(/^https:\/\//) + expect(href).toMatch(/^https:\/\//) } }) it('serves gallery media that the card can actually render', () => { for (const card of page.gallery?.cards ?? []) { - expect(card.mediaSrc, card.id).toMatch( + expect(card.mediaSrc).toMatch( /^https:\/\/media\.comfy\.org\/.+\.(webm|webp|png|jpg)$/ ) } diff --git a/apps/website/src/templates/model-launch/types.ts b/apps/website/src/templates/model-launch/types.ts index c6d7f1cb146..97ef7e9fe50 100644 --- a/apps/website/src/templates/model-launch/types.ts +++ b/apps/website/src/templates/model-launch/types.ts @@ -9,6 +9,11 @@ import type { LocalizedText, TranslationKey } from '../../i18n/translations' // add the `.*` translation keys it points at, and add two page stubs // (`pages/.astro` + `pages/zh-CN/.astro`) that hand the config to // ModelLaunchPage.astro. No new components should be needed. +// +// An announcement page for a model that has not shipped is the same config with +// less in it: give the hero `layout: 'overlay'` and a `placeholderImageSrc`, +// omit gallery/pricing/faq/closingCta, and swap in the full config on launch +// day. `src/data/seedance.ts` is the worked example. interface ModelLaunchCta { labelKey: TranslationKey @@ -21,6 +26,10 @@ export interface ModelLaunchHero { // Still stand-in for the hero frame, for pages announcing a model whose // launch footage does not exist yet. Ignored once videoSrc is set. placeholderImageSrc?: string + // 'overlay' centres the eyebrow, heading and CTAs on top of the media behind + // a scrim, which is how the announcement pages are designed. Launch pages + // keep 'stacked', where the media sits above the text. + layout?: 'stacked' | 'overlay' // Small label above the heading, e.g. NEW. eyebrowKey?: TranslationKey // Brand mark drawn as a CSS mask over the top-right corner of the video. diff --git a/apps/website/vitest.config.ts b/apps/website/vitest.config.ts index 8702580cd07..9e6ffd3e8c5 100644 --- a/apps/website/vitest.config.ts +++ b/apps/website/vitest.config.ts @@ -1,6 +1,14 @@ +import vue from '@vitejs/plugin-vue' +import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, test: { environment: 'node', include: ['src/**/*.{test,spec}.ts'], diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index e9fe57a88a3..76e1296e43d 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -9,6 +9,15 @@ import { TOUR_SEEN_SETTING } from '@/platform/onboarding/onboardingTours' import { NodeBadgeMode } from '@/types/nodeSource' +import { + EMPTY_BILLING_BALANCE, + EMPTY_BILLING_PLANS, + LEGACY_PERSONAL_BILLING_STATUS +} from '@e2e/fixtures/data/cloudWorkspace' +import { + UNSUBSCRIBED, + ZERO_BALANCE +} from '@e2e/fixtures/data/subscriptionFixtures' import { ComfyActionbar } from '@e2e/fixtures/components/Actionbar' import { ComfyTemplates } from '@e2e/fixtures/components/Templates' import { ComfyMouse } from '@e2e/fixtures/ComfyMouse' @@ -16,6 +25,7 @@ import { TestIds } from '@e2e/fixtures/selectors' import { comfyExpect } from '@e2e/fixtures/utils/customMatchers' import { assetPath } from '@e2e/fixtures/utils/paths' import { nextFrame, sleep } from '@e2e/fixtures/utils/timing' +import { mockWorkspace, workspace } from '@e2e/fixtures/utils/workspaceMocks' import { VueNodeHelpers } from '@e2e/fixtures/VueNodeHelpers' import { BottomPanel } from '@e2e/fixtures/components/BottomPanel' import { ComfyNodeSearchBox } from '@e2e/fixtures/components/ComfyNodeSearchBox' @@ -564,6 +574,26 @@ export const comfyPageFixture = base.extend<{ } if (testInfo.tags.includes('@cloud')) { + const context = page.context() + await context.route('**/api/auth/session', (route) => + route.fulfill({ status: 204 }) + ) + await context.route('**/api/billing/status', (route) => + route.fulfill({ json: LEGACY_PERSONAL_BILLING_STATUS }) + ) + await context.route('**/api/billing/balance', (route) => + route.fulfill({ json: EMPTY_BILLING_BALANCE }) + ) + await context.route('**/api/billing/plans', (route) => + route.fulfill({ json: EMPTY_BILLING_PLANS }) + ) + await context.route('**/customers/cloud-subscription-status', (route) => + route.fulfill({ json: UNSUBSCRIBED }) + ) + await context.route('**/customers/balance', (route) => + route.fulfill({ json: ZERO_BALANCE }) + ) + await mockWorkspace(context, workspace('personal', 'owner'), []) await comfyPage.cloudAuth.mockAuth() } diff --git a/browser_tests/fixtures/components/SidebarTab.ts b/browser_tests/fixtures/components/SidebarTab.ts index 5b1dbc5bbf2..c7e8b29c566 100644 --- a/browser_tests/fixtures/components/SidebarTab.ts +++ b/browser_tests/fixtures/components/SidebarTab.ts @@ -12,9 +12,9 @@ export class SidebarTab { public readonly page: Page, public readonly tabId: string ) { - this.tabButton = page.locator(`.${tabId}-tab-button`) - this.selectedTabButton = page.locator( - `.${tabId}-tab-button.side-bar-button-selected` + this.tabButton = page.getByTestId(TestIds.sidebar.tabButton(tabId)) + this.selectedTabButton = this.tabButton.and( + page.locator('.side-bar-button-selected') ) } diff --git a/browser_tests/fixtures/data/cloudWorkspace.ts b/browser_tests/fixtures/data/cloudWorkspace.ts index cd8a900bd44..440b91043e8 100644 --- a/browser_tests/fixtures/data/cloudWorkspace.ts +++ b/browser_tests/fixtures/data/cloudWorkspace.ts @@ -1,4 +1,8 @@ -import type { BillingStatusResponse as IngestBillingStatusResponse } from '@comfyorg/ingest-types' +import type { + BillingBalanceResponse, + BillingPlansResponse, + BillingStatusResponse as IngestBillingStatusResponse +} from '@comfyorg/ingest-types' import type { Member, @@ -7,13 +11,32 @@ import type { } from '@/platform/workspace/api/workspaceApi' import type { RemoteConfig } from '@/platform/remoteConfig/types' -// `/api/features` is the remote-config source: production builds resolve the -// workspaces flag from it (the `ff:` localStorage override is dev-only). -export const WORKSPACE_FEATURE_FLAG: RemoteConfig = { - team_workspaces_enabled: true, +export const CLOUD_REMOTE_CONFIG: RemoteConfig = { consolidated_billing_enabled: true } +export const LEGACY_PERSONAL_BILLING_STATUS = { + billing_rail: 'legacy_stripe', + billing_status: 'inactive', + has_funds: true, + is_active: false, + max_seats: 1, + occupied_seats: 1, + subscription_status: 'ended', + subscription_tier: 'FREE', + team_credit_stop: null +} satisfies IngestBillingStatusResponse + +export const EMPTY_BILLING_BALANCE = { + amount_micros: 0, + currency: 'usd', + effective_balance_micros: 0 +} satisfies BillingBalanceResponse + +export const EMPTY_BILLING_PLANS = { + plans: [] +} satisfies BillingPlansResponse + export const TEAM_WORKSPACE: WorkspaceWithRole = { id: 'ws-team', name: 'Team Comfy', @@ -24,6 +47,11 @@ export const TEAM_WORKSPACE: WorkspaceWithRole = { subscription_tier: 'PRO' } +export const TEAM_MEMBER_WORKSPACE: WorkspaceWithRole = { + ...TEAM_WORKSPACE, + role: 'member' +} + export const CREATOR: Member = { id: 'u-liz', name: 'Liz', @@ -99,6 +127,14 @@ export const ENDED_STANDARD_BILLING_STATUS = { team_credit_stop: null } satisfies IngestBillingStatusResponse & { billing_rail: 'stripe' } +export const INACTIVE_TEAM_BILLING_STATUS = { + ...TEAM_BILLING_STATUS, + billing_status: 'inactive', + is_active: false, + subscription_status: 'canceled', + subscription_tier: 'TEAM' +} satisfies IngestBillingStatusResponse + export const TEAM_PRO_PLAN: Plan = { slug: TEAM_PLAN_SLUG, tier: 'PRO', diff --git a/browser_tests/fixtures/data/workspaceSwitcher.ts b/browser_tests/fixtures/data/workspaceSwitcher.ts index d28a6f3a257..d6593f20088 100644 --- a/browser_tests/fixtures/data/workspaceSwitcher.ts +++ b/browser_tests/fixtures/data/workspaceSwitcher.ts @@ -8,7 +8,6 @@ export const TEAM_WORKSPACE_NAME = 'Team Workspace' export const OFF_SCREEN_WORKSPACE_NAME = 'Off-screen Team Workspace' export const WORKSPACE_SWITCHER_REMOTE_CONFIG: RemoteConfig = { - team_workspaces_enabled: true, unified_cloud_auth: true } diff --git a/browser_tests/fixtures/helpers/CloudWorkspaceMockHelper.ts b/browser_tests/fixtures/helpers/CloudWorkspaceMockHelper.ts index ff5b29227a9..dfbf56cb01b 100644 --- a/browser_tests/fixtures/helpers/CloudWorkspaceMockHelper.ts +++ b/browser_tests/fixtures/helpers/CloudWorkspaceMockHelper.ts @@ -1,4 +1,4 @@ -import type { Page, Route } from '@playwright/test' +import type { Locator, Page, Route } from '@playwright/test' import type { BillingStatusResponse } from '@comfyorg/ingest-types' import type { @@ -9,13 +9,14 @@ import type { import { mockSystemStats } from '@e2e/fixtures/data/systemStats' import { + CLOUD_REMOTE_CONFIG, DEFAULT_TEAM_MEMBERS, TEAM_BILLING_STATUS, TEAM_PRO_PLAN, - TEAM_WORKSPACE, - WORKSPACE_FEATURE_FLAG + TEAM_WORKSPACE } from '@e2e/fixtures/data/cloudWorkspace' import { CloudAuthHelper } from '@e2e/fixtures/helpers/CloudAuthHelper' +import { TestIds } from '@e2e/fixtures/selectors' import { mockWorkspaceTokenMint } from '@e2e/fixtures/utils/workspaceMocks' interface RoleChangeRequest { @@ -45,6 +46,30 @@ const jsonRoute = (body: unknown) => ({ export class CloudWorkspaceMockHelper { constructor(private readonly page: Page) {} + async openWorkspaceSettings(): Promise { + await this.page.goto( + process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:8188' + ) + await this.page.waitForFunction( + () => !!window.app?.extensionManager, + null, + { + timeout: 45_000 + } + ) + await this.page + .getByRole('button', { name: /^Settings/ }) + .first() + .click() + const dialog = this.page.getByTestId(TestIds.dialogs.settings) + await dialog.waitFor({ state: 'visible' }) + await dialog + .locator('nav') + .getByRole('button', { name: 'Workspace', exact: true }) + .click() + return dialog.getByRole('main') + } + async setup( members: Member[] = DEFAULT_TEAM_MEMBERS, activeWorkspace: WorkspaceWithRole = TEAM_WORKSPACE, @@ -71,7 +96,7 @@ export class CloudWorkspaceMockHelper { const { page } = this await page.route('**/api/features', (r) => - r.fulfill(jsonRoute(WORKSPACE_FEATURE_FLAG)) + r.fulfill(jsonRoute(CLOUD_REMOTE_CONFIG)) ) await page.route('**/api/system_stats', (r) => r.fulfill(jsonRoute(mockSystemStats)) @@ -138,6 +163,9 @@ export class CloudWorkspaceMockHelper { await page.route('**/api/billing/status', (r) => r.fulfill(jsonRoute(billingStatus)) ) + await page.route('**/api/billing/payment-portal', (r) => + r.fulfill(jsonRoute({ url: 'https://billing.example/portal' })) + ) await page.route('**/api/billing/balance', (r) => r.fulfill( jsonRoute({ diff --git a/browser_tests/fixtures/helpers/SubscriptionHelper.ts b/browser_tests/fixtures/helpers/SubscriptionHelper.ts index f3b6bd80968..69d93a95c3b 100644 --- a/browser_tests/fixtures/helpers/SubscriptionHelper.ts +++ b/browser_tests/fixtures/helpers/SubscriptionHelper.ts @@ -132,6 +132,18 @@ export class SubscriptionHelper { handler: checkoutHandler }) await this.page.route(checkoutPattern, checkoutHandler) + + const billingPortalPattern = '**/customers/billing' + const billingPortalHandler = async (route: Route) => { + await route.fulfill({ + json: { billing_portal_url: 'https://billing.example/portal' } + }) + } + this.routeHandlers.push({ + pattern: billingPortalPattern, + handler: billingPortalHandler + }) + await this.page.route(billingPortalPattern, billingPortalHandler) } configure(...operators: SubscriptionOperator[]): void { diff --git a/browser_tests/fixtures/selectors.ts b/browser_tests/fixtures/selectors.ts index 541213a5c85..85d2e20dbab 100644 --- a/browser_tests/fixtures/selectors.ts +++ b/browser_tests/fixtures/selectors.ts @@ -11,7 +11,8 @@ export const TestIds = { nodePreviewCard: 'node-preview-card', workflows: 'workflows-sidebar', workflowsRefreshButton: 'workflows-refresh-button', - modeToggle: 'mode-toggle' + modeToggle: 'mode-toggle', + tabButton: (tabId: string) => `${tabId}-tab-button` }, tree: { folder: 'tree-folder', diff --git a/browser_tests/fixtures/utils/cloudAppSetup.ts b/browser_tests/fixtures/utils/cloudAppSetup.ts index d56f8bdd929..0d3aabc96c7 100644 --- a/browser_tests/fixtures/utils/cloudAppSetup.ts +++ b/browser_tests/fixtures/utils/cloudAppSetup.ts @@ -18,7 +18,6 @@ export const APP_URL = // billing surfaces the cloud specs assert; without it they fall back to the // legacy variants. const DEFAULT_FEATURES = { - team_workspaces_enabled: true, consolidated_billing_enabled: true } satisfies RemoteConfig diff --git a/browser_tests/fixtures/utils/cloudBillingMocks.ts b/browser_tests/fixtures/utils/cloudBillingMocks.ts index 0d30bf81061..b5e6c9b2ff2 100644 --- a/browser_tests/fixtures/utils/cloudBillingMocks.ts +++ b/browser_tests/fixtures/utils/cloudBillingMocks.ts @@ -1,4 +1,5 @@ import type { Page } from '@playwright/test' +import type { BillingStatusResponse } from '@comfyorg/ingest-types' import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute' @@ -13,10 +14,13 @@ export async function mockBilling(page: Page) { is_active: true, has_funds: true, subscription_status: 'active', - subscription_tier: 'pro', + subscription_tier: 'PRO', subscription_duration: 'MONTHLY', - billing_status: 'paid' - }) + billing_status: 'paid', + max_seats: 1, + occupied_seats: 1, + team_credit_stop: null + } satisfies BillingStatusResponse) ) ) await page.route('**/api/billing/balance', (r) => diff --git a/browser_tests/fixtures/utils/cloudBootMocks.ts b/browser_tests/fixtures/utils/cloudBootMocks.ts index f692e1fdd3d..f6970bf3a33 100644 --- a/browser_tests/fixtures/utils/cloudBootMocks.ts +++ b/browser_tests/fixtures/utils/cloudBootMocks.ts @@ -5,6 +5,7 @@ import type { RemoteConfig } from '@/platform/remoteConfig/types' import { mockSystemStats } from '@e2e/fixtures/data/systemStats' import { CloudAuthHelper } from '@e2e/fixtures/helpers/CloudAuthHelper' import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute' +import { mockWorkspace, workspace } from '@e2e/fixtures/utils/workspaceMocks' interface CloudBootOptions { /** Remote-config payload for `/api/features` (enables the flags under test). */ @@ -47,6 +48,7 @@ export async function mockCloudBoot( await page.route('**/api/auth/session', (r) => r.fulfill(jsonRoute({ token: 'mock-workspace-token' })) ) + await mockWorkspace(page, workspace('personal', 'owner'), []) await page.route('**/releases**', (r) => r.fulfill(jsonRoute([]))) } diff --git a/browser_tests/fixtures/utils/cloudSecretsMocks.ts b/browser_tests/fixtures/utils/cloudSecretsMocks.ts new file mode 100644 index 00000000000..fb48beb0a61 --- /dev/null +++ b/browser_tests/fixtures/utils/cloudSecretsMocks.ts @@ -0,0 +1,144 @@ +import type { + CreateSecretRequest, + SecretListResponse, + SecretProvidersResponse, + SecretResponse +} from '@comfyorg/ingest-types' +import type { Page, Route } from '@playwright/test' + +import type { RemoteConfig } from '@/platform/remoteConfig/types' + +import type { SettingDialog } from '@e2e/fixtures/components/SettingDialog' +import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute' + +/** + * Shared scaffolding for the cloud user-secrets (API keys) E2E, alongside the + * sibling cloud mocks (`cloudBillingMocks`, `workspaceMocks`): the stateful + * in-memory `/secrets` backend and the open-the-Secrets-panel helper, so the + * spec files hold only the behavioral flow. + */ + +// `/api/features` is the remote-config source. Enabling user secrets is what +// surfaces the Secrets settings panel for a signed-in user. +export const SECRETS_BOOT_FEATURES = { + user_secrets_enabled: true +} satisfies RemoteConfig + +// TutorialCompleted suppresses the new-user template browser, whose modal +// overlay (z-1700) would otherwise intercept clicks on the settings dialog. +export const SECRETS_BOOT_SETTINGS = { 'Comfy.TutorialCompleted': true } + +interface SecretsBackend { + /** Bodies received by POST /secrets, in order — for asserting what was sent. */ + createRequests: CreateSecretRequest[] + /** Current server-side store — for asserting delete actually removed a row. */ + store: SecretResponse[] +} + +/** + * Stateful mock of the ingest `/secrets` surface. A single route handler + * branches on path + method so registration order can never make a specific + * path (`/secrets/providers`, `/secrets/:id`) lose to the collection glob. + * + * `providerIds` models entitlement: an entitled account sees runway/gemini, + * a non-entitled account gets an empty list (the server omits them). + */ +export async function mockSecretsBackend( + page: Page, + providerIds: string[] +): Promise { + const backend: SecretsBackend = { createRequests: [], store: [] } + let idSeq = 0 + + const respondList = (route: Route) => + route.fulfill( + jsonRoute({ data: backend.store } satisfies SecretListResponse) + ) + + await page.route('**/api/secrets**', async (route) => { + const request = route.request() + const { pathname } = new URL(request.url()) + const method = request.method() + + // The glob `**/api/secrets**` also matches the panel's own lazy-loaded + // source module (`/src/platform/secrets/api/secretsApi.ts`), whose path + // contains the `/api/secrets` substring. Fulfilling that dev-server module + // request with JSON breaks the dynamic import and the panel never mounts. + // Anchor to the start of the pathname so only genuine `/api/secrets…` API + // routes are handled; everything else falls through to the real Vite server. + if (!/^\/api\/secrets(\/|$)/.test(pathname)) { + return route.continue() + } + + // GET /secrets/providers — the entitlement-gated provider allowlist. + if (pathname.endsWith('/secrets/providers')) { + return route.fulfill( + jsonRoute({ + data: providerIds.map((id) => ({ id })) + } satisfies SecretProvidersResponse) + ) + } + + // /secrets/:id — item routes (only DELETE is exercised by this flow). + const itemMatch = pathname.match(/\/secrets\/([^/]+)$/) + if (itemMatch) { + const id = itemMatch[1] + if (method === 'DELETE') { + backend.store = backend.store.filter((s) => s.id !== id) + return route.fulfill({ status: 204, body: '' }) + } + return respondList(route) + } + + // /secrets — collection routes. + if (method === 'POST') { + const body = (request.postDataJSON() ?? {}) as CreateSecretRequest + backend.createRequests.push(body) + idSeq += 1 + const created: SecretResponse = { + id: `00000000-0000-4000-8000-${String(idSeq).padStart(12, '0')}`, + name: body.name, + provider: body.provider, + created_at: '2026-07-08T00:00:00Z', + updated_at: '2026-07-08T00:00:00Z' + } + backend.store.push(created) + // 201 Created, echoing metadata ONLY — the schema has no secret_value + // field. `jsonRoute` is 200-only, so this one is spelled out. + return route.fulfill({ + status: 201, + contentType: 'application/json', + body: JSON.stringify(created) + }) + } + + // GET /secrets (list). + return respondList(route) + }) + + return backend +} + +/** + * Open the settings dialog and land on the Secrets panel, waiting for both the + * provider allowlist and the secret list to resolve so subsequent assertions + * are not racing the panel's on-mount fetches. Returns the dialog root locator + * for scoping the caller's assertions. + */ +export async function openSecretsPanel(settingDialog: SettingDialog) { + const { page } = settingDialog + await settingDialog.open() + + const providersResolved = page.waitForResponse((r) => + r.url().includes('/api/secrets/providers') + ) + const listResolved = page.waitForResponse( + (r) => + /\/api\/secrets(\?|$)/.test(r.url()) && r.request().method() === 'GET' + ) + + await settingDialog.category('Secrets').click() + + await Promise.all([providersResolved, listResolved]) + return settingDialog.root +} diff --git a/browser_tests/fixtures/utils/workspaceMocks.ts b/browser_tests/fixtures/utils/workspaceMocks.ts index 4714331cebc..ecec64927f8 100644 --- a/browser_tests/fixtures/utils/workspaceMocks.ts +++ b/browser_tests/fixtures/utils/workspaceMocks.ts @@ -1,4 +1,4 @@ -import type { Page } from '@playwright/test' +import type { BrowserContext, Page } from '@playwright/test' import type { Member, @@ -38,10 +38,10 @@ export function member( * this the mint fails and auth cannot resolve the active workspace. */ export async function mockWorkspaceTokenMint( - page: Page, + routeTarget: Page | BrowserContext, ws: Pick ) { - await page.route('**/api/auth/token', (r) => + await routeTarget.route('**/api/auth/token', (r) => r.fulfill( jsonRoute({ token: 'mock-workspace-token', @@ -60,10 +60,10 @@ export async function mockWorkspaceTokenMint( * reload. */ export async function mockWorkspaceList( - page: Page, + routeTarget: Page | BrowserContext, workspaces: WorkspaceWithRole[] ): Promise { - await page.route('**/api/workspaces', async (route) => { + await routeTarget.route('**/api/workspaces', async (route) => { if (route.request().method() !== 'GET') return route.fallback() await route.fulfill(jsonRoute({ workspaces })) }) @@ -74,13 +74,13 @@ export async function mockWorkspaceList( * given workspace with the given roster (drives the original-owner gate). */ export async function mockWorkspace( - page: Page, + routeTarget: Page | BrowserContext, ws: WorkspaceWithRole, members: Member[] ) { - await mockWorkspaceList(page, [ws]) - await mockWorkspaceTokenMint(page, ws) - await page.route('**/api/workspace/members**', (r) => + await mockWorkspaceList(routeTarget, [ws]) + await mockWorkspaceTokenMint(routeTarget, ws) + await routeTarget.route('**/api/workspace/members**', (r) => r.fulfill( jsonRoute({ members, diff --git a/browser_tests/tests/authAccountSwitch.spec.ts b/browser_tests/tests/authAccountSwitch.spec.ts index e6e5b88e2e9..c81476f3450 100644 --- a/browser_tests/tests/authAccountSwitch.spec.ts +++ b/browser_tests/tests/authAccountSwitch.spec.ts @@ -6,9 +6,9 @@ import type { WorkspaceTokenResponse } from '@/platform/workspace/stores/workspa import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage' import { AssetsSidebarTab } from '@e2e/fixtures/components/SidebarTab' import { + CLOUD_REMOTE_CONFIG, DEFAULT_TEAM_MEMBERS, - TEAM_WORKSPACE, - WORKSPACE_FEATURE_FLAG + TEAM_WORKSPACE } from '@e2e/fixtures/data/cloudWorkspace' import { AssetsHelper, createMockJob } from '@e2e/fixtures/helpers/AssetsHelper' import { CloudWorkspaceMockHelper } from '@e2e/fixtures/helpers/CloudWorkspaceMockHelper' @@ -141,7 +141,7 @@ test.describe('Cloud account switch', { tag: '@cloud' }, () => { await page.unroute('**/securetoken.googleapis.com/**') const features = { - ...WORKSPACE_FEATURE_FLAG, + ...CLOUD_REMOTE_CONFIG, onboarding_survey_enabled: false, unified_cloud_auth: false } satisfies RemoteConfig diff --git a/browser_tests/tests/billingFacadeConsumers.spec.ts b/browser_tests/tests/billingFacadeConsumers.spec.ts index f702b221711..81118c3149e 100644 --- a/browser_tests/tests/billingFacadeConsumers.spec.ts +++ b/browser_tests/tests/billingFacadeConsumers.spec.ts @@ -19,11 +19,9 @@ import { /** * Billing facade consumers — FE-933 (B3) regression. * - * The repointed surfaces (avatar popover tier badge / balance, free-tier - * dialog renewal date) must keep rendering from `useBillingContext`. The facade - * selects its backend by flag: `team_workspaces_enabled: false` routes through - * the legacy `/customers/*` endpoints, while `true` routes a personal workspace - * through the workspace `/api/billing/*` endpoints. Both shapes are mocked here. + * The repointed surfaces (avatar popover balance, free-tier dialog renewal + * date) must keep rendering from `useBillingContext`. Cloud + * personal workspaces route through the workspace `/api/billing/*` endpoints. * Drives a raw `page` (not the `comfyPage` fixture) so the cloud app boots * against fully mocked endpoints — same pattern as creditsTile.spec.ts. */ @@ -56,11 +54,24 @@ const mockBalance: BillingBalanceResponse = { effective_balance_micros: 6000 } +const mockWorkspaceBalance: BillingBalanceResponse = { + amount_micros: 0, + currency: 'usd', + effective_balance_micros: 0 +} + async function mockCloudBoot( page: Page, subscriptionStatus: CloudSubscriptionStatusResponse, - remoteConfig: RemoteConfig = { team_workspaces_enabled: false } + remoteConfig: RemoteConfig = {}, + billingRail?: BillingStatusResponse['billing_rail'] ) { + const billingRequests = { + legacyStatus: 0, + legacyBalance: 0, + workspaceStatus: 0 + } + await page.route('**/api/features', (r) => r.fulfill(jsonRoute(remoteConfig))) await page.route('**/api/system_stats', (r) => r.fulfill(jsonRoute(mockSystemStats)) @@ -106,25 +117,34 @@ async function mockCloudBoot( ) ) - // Legacy backend (team_workspaces_enabled: false). - await page.route('**/customers/cloud-subscription-status', (r) => - r.fulfill(jsonRoute(subscriptionStatus)) - ) - await page.route('**/customers/balance', (r) => - r.fulfill(jsonRoute(mockBalance)) - ) + // Legacy endpoints remain mocked for consumers that explicitly use them. + await page.route('**/customers/cloud-subscription-status', (r) => { + billingRequests.legacyStatus++ + return r.fulfill(jsonRoute(subscriptionStatus)) + }) + await page.route('**/customers/balance', (r) => { + billingRequests.legacyBalance++ + return r.fulfill(jsonRoute(mockBalance)) + }) - // Workspace backend (team_workspaces_enabled: true) — a personal workspace - // now routes through `/api/billing/*`. - await page.route('**/api/billing/status', (r) => - r.fulfill(jsonRoute(toWorkspaceStatus(subscriptionStatus))) - ) - await page.route('**/api/billing/balance', (r) => - r.fulfill(jsonRoute(mockBalance)) - ) + // Cloud personal workspaces route through `/api/billing/*`. + await page.route('**/api/billing/status', (r) => { + billingRequests.workspaceStatus++ + return r.fulfill( + jsonRoute({ + ...toWorkspaceStatus(subscriptionStatus), + billing_rail: billingRail + }) + ) + }) + await page.route('**/api/billing/balance', (r) => { + return r.fulfill(jsonRoute(mockWorkspaceBalance)) + }) await page.route('**/api/billing/plans', (r) => r.fulfill(jsonRoute({ plans: [] })) ) + + return billingRequests } async function bootApp(page: Page) { @@ -142,27 +162,34 @@ async function bootApp(page: Page) { } test.describe('Billing facade consumers (FE-933)', { tag: '@cloud' }, () => { - test('avatar popover renders tier badge and balance from the facade', async ({ + test('avatar popover renders a legacy-rail balance from the facade', async ({ page }) => { test.setTimeout(60_000) - await mockCloudBoot(page, { - is_active: true, - subscription_tier: 'PRO', - subscription_duration: 'MONTHLY', - renewal_date: '2099-02-20T10:00:00Z', - end_date: null - }) + const billingRequests = await mockCloudBoot( + page, + { + is_active: true, + subscription_tier: 'PRO', + subscription_duration: 'MONTHLY', + renewal_date: '2099-02-20T10:00:00Z', + end_date: null + }, + { consolidated_billing_enabled: true }, + 'legacy_stripe' + ) await bootApp(page) await page.getByRole('button', { name: 'Current user' }).click() const popover = page.locator('.current-user-popover') await expect(popover).toBeVisible() - await expect(popover.getByText('Pro', { exact: true })).toBeVisible() await expect(popover.getByText('12,660')).toBeVisible() await expect(popover.getByTestId('add-credits-button')).toBeVisible() + expect(billingRequests.workspaceStatus).toBeGreaterThan(0) + expect(billingRequests.legacyStatus).toBeGreaterThan(0) + expect(billingRequests.legacyBalance).toBeGreaterThan(0) }) test('subscribe-to-run routes an inactive FREE user to the pricing table', async ({ @@ -170,8 +197,8 @@ test.describe('Billing facade consumers (FE-933)', { tag: '@cloud' }, () => { }) => { test.setTimeout(60_000) - // Boots with team workspaces enabled (production shape); the facade routes a - // personal workspace through the workspace `/api/billing/*` endpoints. With + // The facade routes a personal workspace through the workspace + // `/api/billing/*` endpoints. With // subscription gating on, an inactive FREE user gets the "Subscribe to run" // button, which opens the pricing table on click. (refreshRemoteConfig // overwrites window.__CONFIG__ from /api/features, so the flags must come @@ -186,12 +213,17 @@ test.describe('Billing facade consumers (FE-933)', { tag: '@cloud' }, () => { renewal_date: '2099-02-20T10:00:00Z', end_date: null }, - { team_workspaces_enabled: true, subscription_required: true } + { + subscription_required: true, + consolidated_billing_enabled: true + } ) await bootApp(page) await page.getByTestId('subscribe-to-run-button').click() - await expect(page.getByRole('heading', { name: /Plans for/ })).toBeVisible() + await expect( + page.getByRole('heading', { name: 'Choose a Plan' }) + ).toBeVisible() }) }) diff --git a/browser_tests/tests/cloudSecrets.spec.ts b/browser_tests/tests/cloudSecrets.spec.ts index 2271b5595ba..1ebc9dd4f80 100644 --- a/browser_tests/tests/cloudSecrets.spec.ts +++ b/browser_tests/tests/cloudSecrets.spec.ts @@ -1,20 +1,17 @@ -import type { - CreateSecretRequest, - SecretListResponse, - SecretProvidersResponse, - SecretResponse -} from '@comfyorg/ingest-types' import { expect } from '@playwright/test' -import type { Page, Route } from '@playwright/test' - -import type { RemoteConfig } from '@/platform/remoteConfig/types' +import { ComfyPage } from '@e2e/fixtures/ComfyPage' import { cloudAppFixture as test, waitForCloudApp } from '@e2e/fixtures/cloudAppFixture' import { bootCloud, mockCloudBoot } from '@e2e/fixtures/utils/cloudBootMocks' -import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute' +import { + SECRETS_BOOT_FEATURES, + SECRETS_BOOT_SETTINGS, + mockSecretsBackend, + openSecretsPanel +} from '@e2e/fixtures/utils/cloudSecretsMocks' /** * End-to-end coverage for the user-secrets (API keys) surface in the cloud app: @@ -24,155 +21,26 @@ import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute' * * Drives a raw `page` against fully-mocked endpoints (the `comfyPage` fixture * would reach the OSS devtools backend during setup); `mockCloudBoot` + - * `bootCloud` boot the app signed-in, and this spec layers a stateful in-memory - * `/secrets` backend on top so the flow is deterministic and never touches a - * real server. + * `bootCloud` boot the app signed-in, and `mockSecretsBackend` layers a + * stateful in-memory `/secrets` backend on top so the flow is deterministic + * and never touches a real server. A bare `ComfyPage` (constructed, never + * `setup()`) supplies the shared `SettingDialog` page object without the + * backend-touching fixture setup. */ const APP_URL = process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:8188' -// `/api/features` is the remote-config source. Enabling user secrets is what -// surfaces the Secrets settings panel for a signed-in user. -const BOOT_FEATURES = { - user_secrets_enabled: true -} satisfies RemoteConfig - -// TutorialCompleted suppresses the new-user template browser, whose modal -// overlay (z-1700) would otherwise intercept clicks on the settings dialog. -const BOOT_SETTINGS = { 'Comfy.TutorialCompleted': true } - // The plaintext key a user types in. It must be sent on create but NEVER echoed // back by the API or rendered anywhere in the UI. const RUNWAY_KEY_VALUE = 'sk-runway-do-not-echo-0xDEADBEEF' -interface SecretsBackend { - /** Bodies received by POST /secrets, in order — for asserting what was sent. */ - createRequests: CreateSecretRequest[] - /** Current server-side store — for asserting delete actually removed a row. */ - store: SecretResponse[] -} - -/** - * Stateful mock of the ingest `/secrets` surface. A single route handler - * branches on path + method so registration order can never make a specific - * path (`/secrets/providers`, `/secrets/:id`) lose to the collection glob. - * - * `providerIds` models entitlement: an entitled account sees runway/gemini, - * a non-entitled account gets an empty list (the server omits them). - */ -async function mockSecretsBackend( - page: Page, - providerIds: string[] -): Promise { - const backend: SecretsBackend = { createRequests: [], store: [] } - let idSeq = 0 - - const respondList = (route: Route) => - route.fulfill( - jsonRoute({ data: backend.store } satisfies SecretListResponse) - ) - - await page.route('**/api/secrets**', async (route) => { - const request = route.request() - const { pathname } = new URL(request.url()) - const method = request.method() - - // The glob `**/api/secrets**` also matches the panel's own lazy-loaded - // source module (`/src/platform/secrets/api/secretsApi.ts`), whose path - // contains the `/api/secrets` substring. Fulfilling that dev-server module - // request with JSON breaks the dynamic import and the panel never mounts. - // Anchor to the start of the pathname so only genuine `/api/secrets…` API - // routes are handled; everything else falls through to the real Vite server. - if (!/^\/api\/secrets(\/|$)/.test(pathname)) { - return route.continue() - } - - // GET /secrets/providers — the entitlement-gated provider allowlist. - if (pathname.endsWith('/secrets/providers')) { - return route.fulfill( - jsonRoute({ - data: providerIds.map((id) => ({ id })) - } satisfies SecretProvidersResponse) - ) - } - - // /secrets/:id — item routes (only DELETE is exercised by this flow). - const itemMatch = pathname.match(/\/secrets\/([^/]+)$/) - if (itemMatch) { - const id = itemMatch[1] - if (method === 'DELETE') { - backend.store = backend.store.filter((s) => s.id !== id) - return route.fulfill({ status: 204, body: '' }) - } - return respondList(route) - } - - // /secrets — collection routes. - if (method === 'POST') { - const body = (request.postDataJSON() ?? {}) as CreateSecretRequest - backend.createRequests.push(body) - idSeq += 1 - const created: SecretResponse = { - id: `00000000-0000-4000-8000-${String(idSeq).padStart(12, '0')}`, - name: body.name, - provider: body.provider, - created_at: '2026-07-08T00:00:00Z', - updated_at: '2026-07-08T00:00:00Z' - } - backend.store.push(created) - // 201 Created, echoing metadata ONLY — the schema has no secret_value field. - return route.fulfill({ - status: 201, - contentType: 'application/json', - body: JSON.stringify(created) - }) - } - - // GET /secrets (list). - return respondList(route) - }) - - return backend -} - -/** - * Open the settings dialog and land on the Secrets panel, waiting for both the - * provider allowlist and the secret list to resolve so subsequent assertions - * are not racing the panel's on-mount fetches. - */ -async function openSecretsPanel(page: Page) { - const settingsDialog = page.getByTestId('settings-dialog') - - await page.evaluate(() => { - const app = window.app - if (!app) throw new Error('window.app is not available') - return app.extensionManager.command.execute('Comfy.ShowSettingsDialog') - }) - await settingsDialog.waitFor({ state: 'visible' }) - - const providersResolved = page.waitForResponse((r) => - r.url().includes('/api/secrets/providers') - ) - const listResolved = page.waitForResponse( - (r) => - /\/api\/secrets(\?|$)/.test(r.url()) && r.request().method() === 'GET' - ) - - await settingsDialog - .locator('nav') - .getByRole('button', { name: 'Secrets' }) - .click() - - await Promise.all([providersResolved, listResolved]) - return settingsDialog -} - test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { test('an entitled account can add, list, and delete a provider key', async ({ - page + page, + request }) => { await mockCloudBoot(page, { - features: BOOT_FEATURES, - settings: BOOT_SETTINGS + features: SECRETS_BOOT_FEATURES, + settings: SECRETS_BOOT_SETTINGS }) await bootCloud(page) const backend = await mockSecretsBackend(page, ['runway', 'gemini']) @@ -180,7 +48,8 @@ test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { await page.goto(APP_URL) await waitForCloudApp(page) - const settingsDialog = await openSecretsPanel(page) + const comfyPage = new ComfyPage(page, request) + const settingsDialog = await openSecretsPanel(comfyPage.settingDialog) // Empty state before anything is added. await expect(settingsDialog.getByText(/No secrets stored/)).toBeVisible() @@ -223,6 +92,22 @@ test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { // ...but the value must never be echoed back into the list — the API // response carries metadata only, so nothing should render it as text. await expect(page.getByText(RUNWAY_KEY_VALUE)).toHaveCount(0) + // `getByText` only sees text nodes; a value reflected into an `` or + // masked field would slip past it, so assert no field carries it either. + // The list has already settled above, so this is a single immediate + // assertion — a poll-until-false could mask a value that briefly echoed + // into a field and then cleared within the polling window. + const secretEchoedInField = await page + .locator('input, textarea') + .evaluateAll( + (fields, value) => + fields.some( + (field) => + (field as HTMLInputElement | HTMLTextAreaElement).value === value + ), + RUNWAY_KEY_VALUE + ) + expect(secretEchoedInField).toBe(false) // --- DELETE ---------------------------------------------------------- await settingsDialog @@ -241,10 +126,13 @@ test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { expect(backend.store).toHaveLength(0) }) - test('the Add Secret backdrop closes only Add Secret', async ({ page }) => { + test('the Add Secret backdrop closes only Add Secret', async ({ + page, + request + }) => { await mockCloudBoot(page, { - features: BOOT_FEATURES, - settings: BOOT_SETTINGS + features: SECRETS_BOOT_FEATURES, + settings: SECRETS_BOOT_SETTINGS }) await bootCloud(page) await mockSecretsBackend(page, ['runway']) @@ -252,7 +140,8 @@ test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { await page.goto(APP_URL) await waitForCloudApp(page) - const settingsDialog = await openSecretsPanel(page) + const comfyPage = new ComfyPage(page, request) + const settingsDialog = await openSecretsPanel(comfyPage.settingDialog) await settingsDialog.getByRole('button', { name: 'Add Secret' }).click() const formDialog = page @@ -269,11 +158,12 @@ test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { }) test('a non-entitled account never sees the gated providers', async ({ - page + page, + request }) => { await mockCloudBoot(page, { - features: BOOT_FEATURES, - settings: BOOT_SETTINGS + features: SECRETS_BOOT_FEATURES, + settings: SECRETS_BOOT_SETTINGS }) await bootCloud(page) // Non-entitled: the server omits runway/gemini from the allowlist. @@ -282,7 +172,8 @@ test.describe('Cloud user secrets (API keys)', { tag: '@cloud' }, () => { await page.goto(APP_URL) await waitForCloudApp(page) - const settingsDialog = await openSecretsPanel(page) + const comfyPage = new ComfyPage(page, request) + const settingsDialog = await openSecretsPanel(comfyPage.settingDialog) await expect(settingsDialog.getByText(/No secrets stored/)).toBeVisible() // The add form opens, but its provider dropdown is empty — the gated diff --git a/browser_tests/tests/currentUserPopoverCredits.spec.ts b/browser_tests/tests/currentUserPopoverCredits.spec.ts index 4a7eda3b42d..e33a025da84 100644 --- a/browser_tests/tests/currentUserPopoverCredits.spec.ts +++ b/browser_tests/tests/currentUserPopoverCredits.spec.ts @@ -2,10 +2,7 @@ import { expect } from '@playwright/test' import type { CloudSubscriptionStatusResponse } from '@/platform/cloud/subscription/composables/useSubscription' import type { RemoteConfig } from '@/platform/remoteConfig/types' -import type { - BillingStatusResponse, - WorkspaceWithRole -} from '@/platform/workspace/api/workspaceApi' +import type { WorkspaceWithRole } from '@/platform/workspace/api/workspaceApi' import type { WorkspaceTokenResponse } from '@/platform/workspace/stores/workspaceAuthStore' import type { operations } from '@/types/comfyRegistryTypes' import { comfyPageFixture } from '@e2e/fixtures/ComfyPage' @@ -17,7 +14,7 @@ type CustomerBalanceResponse = NonNullable< const PERSONAL_WORKSPACE_NAME = 'Personal Workspace' const FUTURE_DATE = '2099-01-01T00:00:00Z' -const mockRemoteConfig: RemoteConfig = { team_workspaces_enabled: true } +const mockRemoteConfig: RemoteConfig = {} const mockListWorkspacesResponse: { workspaces: WorkspaceWithRole[] } = { workspaces: [ @@ -54,22 +51,6 @@ const mockSubscriptionStatus: CloudSubscriptionStatusResponse = { end_date: FUTURE_DATE } -// With team workspaces enabled, the facade routes a personal workspace through -// `/api/billing/*`. The cancelled-but-active state maps to `is_active: true` -// with `subscription_status: 'canceled'`; a paid tier keeps "Add credits" -// visible (free tier would swap it for "Upgrade to add credits"). -const mockBillingStatus: BillingStatusResponse = { - is_active: true, - max_seats: 1, - occupied_seats: 1, - subscription_status: 'canceled', - subscription_tier: 'PRO', - subscription_duration: 'MONTHLY', - has_funds: true, - cancel_at: FUTURE_DATE, - renewal_date: FUTURE_DATE -} - // ~6.3M credits — a 7-digit balance is what pushes the second action button out // of the popover before the fix. const mockBalance: CustomerBalanceResponse = { @@ -128,32 +109,6 @@ const test = comfyPageFixture.extend({ }) ) - // Flag-on (team workspaces enabled) routes a personal workspace through the - // workspace billing endpoints, so the popover sources its data from here. - await page.route('**/api/billing/status', (route) => - route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify(mockBillingStatus) - }) - ) - - await page.route('**/api/billing/balance', (route) => - route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify(mockBalance) - }) - ) - - await page.route('**/api/billing/plans', (route) => - route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ plans: [] }) - }) - ) - await use(page) } }) diff --git a/browser_tests/tests/defaultKeybindings.spec.ts b/browser_tests/tests/defaultKeybindings.spec.ts index 54ea64f90d6..0b6a96ef46a 100644 --- a/browser_tests/tests/defaultKeybindings.spec.ts +++ b/browser_tests/tests/defaultKeybindings.spec.ts @@ -2,6 +2,7 @@ import { expect } from '@playwright/test' import type { ComfyPage } from '@e2e/fixtures/ComfyPage' import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage' +import { SidebarTab } from '@e2e/fixtures/components/SidebarTab' async function pressKeyAndExpectRequest( comfyPage: ComfyPage, @@ -33,17 +34,15 @@ test.describe('Default Keybindings', { tag: '@keyboard' }, () => { for (const { key, tabId, label } of sidebarTabs) { test(`'${key}' toggles ${label} sidebar`, async ({ comfyPage }) => { - const selectedButton = comfyPage.page.locator( - `.${tabId}-tab-button.side-bar-button-selected` - ) + const { selectedTabButton } = new SidebarTab(comfyPage.page, tabId) - await expect(selectedButton).toBeHidden() + await expect(selectedTabButton).toBeHidden() await comfyPage.canvas.press(key) - await expect(selectedButton).toBeVisible() + await expect(selectedTabButton).toBeVisible() await comfyPage.canvas.press(key) - await expect(selectedButton).toBeHidden() + await expect(selectedTabButton).toBeHidden() }) } }) diff --git a/browser_tests/tests/dialogs/creditsTile.spec.ts b/browser_tests/tests/dialogs/creditsTile.spec.ts index 9e614f3f352..f654eed6fd3 100644 --- a/browser_tests/tests/dialogs/creditsTile.spec.ts +++ b/browser_tests/tests/dialogs/creditsTile.spec.ts @@ -27,10 +27,9 @@ import { * The credits tile only lives inside the authenticated cloud app, which the * shared `comfyPage` fixture can't boot (it expects the OSS devtools backend). * Instead this drives a raw page: mock Firebase auth + every boot endpoint so - * the cloud app initializes against fully stubbed data. With team workspaces - * enabled the facade routes a personal workspace through the workspace - * `/api/billing/*` endpoints (mocked with an active Pro subscription); the - * legacy `/customers/*` shapes are mocked too for the flag-off path. The tile + * the cloud app initializes against fully stubbed data. The facade routes a + * personal workspace through the workspace `/api/billing/*` endpoints (mocked + * with an active Pro subscription). The tile * should then render its total / progress bar / monthly+additional breakdown / * add-credits. */ @@ -70,15 +69,32 @@ const mockBillingStatus: BillingStatusResponse = { has_funds: true } -async function mockCloudBoot(page: Page, billingControlEnabled = true) { +const freeBillingStatus: BillingStatusResponse = { + is_active: false, + subscription_tier: 'FREE', + has_funds: true +} + +const endedPersonalBillingStatus: BillingStatusResponse = { + is_active: false, + subscription_status: 'ended', + subscription_tier: 'PRO', + subscription_duration: 'MONTHLY', + plan_slug: 'pro-monthly', + billing_status: 'inactive', + has_funds: true +} + +async function mockCloudBoot( + page: Page, + billingControlEnabled = true, + billingStatus = mockBillingStatus +) { // Frontend-origin boot endpoints (proxied to the backend in production). - // `/api/features` is the remote-config source: production builds resolve - // workspace availability and the billing UX rollout from it (the `ff:` - // localStorage override is dev-only). + // `/api/features` is the remote-config source for the billing UX rollout. await page.route('**/api/features', (r) => r.fulfill( jsonRoute({ - team_workspaces_enabled: true, consolidated_billing_enabled: true, billing_control_enabled: billingControlEnabled } satisfies RemoteConfig) @@ -150,7 +166,10 @@ async function mockCloudBoot(page: Page, billingControlEnabled = true) { // Workspace billing (flag-on path) — a personal workspace now routes through // `/api/billing/*`. await page.route('**/api/billing/status', (r) => - r.fulfill(jsonRoute(mockBillingStatus)) + r.fulfill(jsonRoute(billingStatus)) + ) + await page.route('**/api/billing/payment-portal', (r) => + r.fulfill(jsonRoute({ url: 'https://billing.example/portal' })) ) await page.route('**/api/billing/balance', (r) => r.fulfill(balanceRoute(DEFAULT_BALANCE)) @@ -211,6 +230,65 @@ async function openPlanAndCredits(page: Page) { } test.describe('Credits tile (Plan & Credits)', { tag: '@cloud' }, () => { + test.beforeEach(async ({ page }) => { + await page.addInitScript(() => { + window.open = (url) => { + document.documentElement.dataset.openedUrl = String(url) + return window + } + }) + }) + + test('opens Billing & invoices for a paid owner without a duplicate invoice link', async ({ + page + }) => { + test.setTimeout(60_000) + + await mockCloudBoot(page) + + const content = await openPlanAndCredits(page) + await expect( + content.getByRole('button', { name: 'Invoice history' }) + ).toHaveCount(0) + await content.getByRole('button', { name: 'Billing & invoices' }).click() + + await expect + .poll(() => page.locator('html').getAttribute('data-opened-url')) + .toBe('https://billing.example/portal') + }) + + test('opens Billing & invoices for a Free owner without a subscription', async ({ + page + }) => { + test.setTimeout(60_000) + + await mockCloudBoot(page, true, freeBillingStatus) + + const content = await openPlanAndCredits(page) + await expect(content.getByRole('heading', { name: 'Free' })).toBeVisible() + await content.getByRole('button', { name: 'Billing & invoices' }).click() + + await expect + .poll(() => page.locator('html').getAttribute('data-opened-url')) + .toBe('https://billing.example/portal') + }) + + test('keeps Billing & invoices available after a Personal subscription ends', async ({ + page + }) => { + test.setTimeout(60_000) + + await mockCloudBoot(page, true, endedPersonalBillingStatus) + + const content = await openPlanAndCredits(page) + await expect(content.getByText('Your subscription has ended')).toBeVisible() + await content.getByRole('button', { name: 'Billing & invoices' }).click() + + await expect + .poll(() => page.locator('html').getAttribute('data-opened-url')) + .toBe('https://billing.example/portal') + }) + test('keeps the legacy Workspace UX when billing controls are disabled', async ({ page }) => { diff --git a/browser_tests/tests/dialogs/endedSubscription.spec.ts b/browser_tests/tests/dialogs/endedSubscription.spec.ts index a9e06aaf775..11413a26c7e 100644 --- a/browser_tests/tests/dialogs/endedSubscription.spec.ts +++ b/browser_tests/tests/dialogs/endedSubscription.spec.ts @@ -1,46 +1,40 @@ import { expect } from '@playwright/test' +import type { Locator } from '@playwright/test' -import { - cloudAppFixture as test, - waitForCloudApp -} from '@e2e/fixtures/cloudAppFixture' +import { cloudAppFixture as test } from '@e2e/fixtures/cloudAppFixture' import { DEFAULT_TEAM_MEMBERS, ENDED_STANDARD_BILLING_STATUS, + INACTIVE_TEAM_BILLING_STATUS, + TEAM_BILLING_STATUS, + TEAM_MEMBER_WORKSPACE, TEAM_WORKSPACE } from '@e2e/fixtures/data/cloudWorkspace' import { CloudWorkspaceMockHelper } from '@e2e/fixtures/helpers/CloudWorkspaceMockHelper' -import { TestIds } from '@e2e/fixtures/selectors' test.describe('Ended workspace subscription', { tag: '@cloud' }, () => { test.describe.configure({ timeout: 60_000 }) + let content: Locator test.beforeEach(async ({ page }) => { - await new CloudWorkspaceMockHelper(page).setup( + await page.addInitScript(() => { + window.open = (url) => { + document.documentElement.dataset.openedUrl = String(url) + return window + } + }) + const workspace = new CloudWorkspaceMockHelper(page) + await workspace.setup( DEFAULT_TEAM_MEMBERS, TEAM_WORKSPACE, ENDED_STANDARD_BILLING_STATUS ) - await page.goto(process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:8188') - await waitForCloudApp(page) - - await page - .getByRole('button', { name: /^Settings/ }) - .first() - .click() - const dialog = page.getByTestId(TestIds.dialogs.settings) - await expect(dialog).toBeVisible() - await dialog - .locator('nav') - .getByRole('button', { name: 'Workspace', exact: true }) - .click() + content = await workspace.openWorkspaceSettings() }) test('shows subscribe prompt instead of stale paid plan metadata', async ({ page }) => { - const content = page.getByTestId(TestIds.dialogs.settings).getByRole('main') - await expect( content.getByRole('heading', { name: 'This workspace is not on a subscription' @@ -52,5 +46,71 @@ test.describe('Ended workspace subscription', { tag: '@cloud' }, () => { await expect( content.getByRole('heading', { name: 'Standard' }) ).toHaveCount(0) + await expect( + content.getByRole('button', { name: 'Invoice history' }) + ).toHaveCount(0) + + await content.getByRole('button', { name: 'Billing & invoices' }).click() + await expect + .poll(() => page.locator('html').getAttribute('data-opened-url')) + .toBe('https://billing.example/portal') + }) +}) + +test.describe('Inactive Team subscription billing', { tag: '@cloud' }, () => { + test.describe.configure({ timeout: 60_000 }) + let content: Locator + + test.beforeEach(async ({ page }) => { + await page.addInitScript(() => { + window.open = (url) => { + document.documentElement.dataset.openedUrl = String(url) + return window + } + }) + const workspace = new CloudWorkspaceMockHelper(page) + await workspace.setup( + DEFAULT_TEAM_MEMBERS, + TEAM_WORKSPACE, + INACTIVE_TEAM_BILLING_STATUS + ) + content = await workspace.openWorkspaceSettings() + }) + + test('keeps the owner billing portal available', async ({ page }) => { + await expect( + content.getByRole('heading', { name: 'Inactive team subscription' }) + ).toBeVisible() + await content.getByRole('button', { name: 'Billing & invoices' }).click() + await expect + .poll(() => page.locator('html').getAttribute('data-opened-url')) + .toBe('https://billing.example/portal') + }) +}) + +test.describe('Team member billing permissions', { tag: '@cloud' }, () => { + test.describe.configure({ timeout: 60_000 }) + let content: Locator + + test.beforeEach(async ({ page }) => { + const workspace = new CloudWorkspaceMockHelper(page) + await workspace.setup( + DEFAULT_TEAM_MEMBERS, + TEAM_MEMBER_WORKSPACE, + TEAM_BILLING_STATUS + ) + content = await workspace.openWorkspaceSettings() + }) + + test('does not expose owner billing actions', async () => { + await expect( + content.getByRole('heading', { name: 'Team', exact: true }) + ).toBeVisible() + await expect( + content.getByRole('button', { name: 'Billing & invoices' }) + ).toHaveCount(0) + await expect( + content.getByRole('button', { name: 'Invoice history' }) + ).toHaveCount(0) }) }) diff --git a/browser_tests/tests/dialogs/pricingTableDeepLink.spec.ts b/browser_tests/tests/dialogs/pricingTableDeepLink.spec.ts index 6095ad686f9..d146e536a73 100644 --- a/browser_tests/tests/dialogs/pricingTableDeepLink.spec.ts +++ b/browser_tests/tests/dialogs/pricingTableDeepLink.spec.ts @@ -41,12 +41,9 @@ const APP_URL = process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:8188' const SELF_EMAIL = 'e2e@test.comfy.org' -// consolidated_billing_enabled routes personal workspaces to the unified -// pricing table asserted here; without it they fall back to the legacy table. const BOOT_FEATURES = { - team_workspaces_enabled: true, - consolidated_billing_enabled: true, - billing_control_enabled: true + billing_control_enabled: true, + consolidated_billing_enabled: true } satisfies RemoteConfig // Disable the experimental Asset API: with it on (cloud default) the unmocked // asset endpoints 403 and workflow restore throws uncaught, aborting the diff --git a/browser_tests/tests/localCreditsNoSubscribeUi.spec.ts b/browser_tests/tests/localCreditsNoSubscribeUi.spec.ts index c8cf166bdca..afc275dcf0e 100644 --- a/browser_tests/tests/localCreditsNoSubscribeUi.spec.ts +++ b/browser_tests/tests/localCreditsNoSubscribeUi.spec.ts @@ -42,7 +42,7 @@ test.describe('Local credits surfaces hide subscribe UI (non-cloud)', () => { await topUpDialog.close() // 2. Settings > Credits, reached the same way the reported bug did: the - // popover's "Manage Plan" entry, not a generic keyboard shortcut. This + // popover's plan & credits entry, not a generic keyboard shortcut. This // must also hide the subscribe CTA and keep its own "Add credits" // button working, not just render a dead replacement for it. await page.getByTestId(TestIds.user.currentUserButton).click() @@ -55,6 +55,20 @@ test.describe('Local credits surfaces hide subscribe UI (non-cloud)', () => { await expect( creditsContent.getByText('Upgrade to add credits') ).toHaveCount(0) + await expect( + creditsContent.getByRole('button', { name: 'Manage subscription' }) + ).toHaveCount(0) + await expect( + creditsContent.getByRole('button', { name: 'Billing & invoices' }) + ).toHaveCount(0) + await expect( + creditsContent.getByRole('button', { name: 'Invoice history' }) + ).toBeVisible() + const invoiceRequest = page.waitForRequest('**/customers/billing') + await creditsContent + .getByRole('button', { name: 'Invoice history' }) + .click() + expect((await invoiceRequest).method()).toBe('POST') const settingsAddCredits = creditsContent.getByRole('button', { name: 'Add credits' diff --git a/browser_tests/tests/resultGallery.spec.ts b/browser_tests/tests/resultGallery.spec.ts index 67215041d3c..9f679a820f3 100644 --- a/browser_tests/tests/resultGallery.spec.ts +++ b/browser_tests/tests/resultGallery.spec.ts @@ -17,7 +17,7 @@ test.describe('MediaLightbox', { tag: ['@slow', '@vue-nodes'] }, () => { }) // Open Assets sidebar tab and wait for it to load - await comfyPage.page.locator('.assets-tab-button').click() + await comfyPage.menu.assetsTab.open({ waitForAssets: false }) await comfyPage.page .locator('.sidebar-content-container') .waitFor({ state: 'visible' }) diff --git a/browser_tests/tests/workflowPersistence.spec.ts b/browser_tests/tests/workflowPersistence.spec.ts index ee2e3f42c46..bd5b44b7bf7 100644 --- a/browser_tests/tests/workflowPersistence.spec.ts +++ b/browser_tests/tests/workflowPersistence.spec.ts @@ -307,20 +307,26 @@ test.describe('Workflow Persistence', () => { }, apiWorkflow) await comfyPage.nextFrame() - // Known nodes (KSampler, EmptyLatentImage) should load; unknown node skipped - await expect - .poll(() => comfyPage.nodeOps.getNodeCount()) - .toBeGreaterThanOrEqual(2) + // Known nodes and an error-marked placeholder for the unknown node load. + await expect.poll(() => comfyPage.nodeOps.getNodeCount()).toBe(3) - const getNodeTypes = () => + const getNodes = () => comfyPage.page.evaluate(() => - window.app!.graph.nodes.map((n: { type: string }) => n.type) + window.app!.graph.nodes.map((node) => ({ + type: node.type, + hasErrors: node.has_errors + })) ) - await expect.poll(getNodeTypes).toContain('KSampler') - await expect.poll(getNodeTypes).toContain('EmptyLatentImage') await expect - .poll(getNodeTypes) - .not.toContain('NonExistentCustomNode_XYZ_12345') + .poll(getNodes) + .toContainEqual(expect.objectContaining({ type: 'KSampler' })) + await expect + .poll(getNodes) + .toContainEqual(expect.objectContaining({ type: 'EmptyLatentImage' })) + await expect.poll(getNodes).toContainEqual({ + type: 'NonExistentCustomNode_XYZ_12345', + hasErrors: true + }) }) test('Canvas has auxclick handler to prevent middle-click paste', async ({ diff --git a/docs/TEMPLATE_RANKING.md b/docs/TEMPLATE_RANKING.md index a52c8fc61b3..ecb67e985fe 100644 --- a/docs/TEMPLATE_RANKING.md +++ b/docs/TEMPLATE_RANKING.md @@ -1,66 +1,88 @@ # Template Ranking System -Usage-based ordering for workflow templates with position bias normalization. +How the template picker orders results, and how curators influence that order. -Scores are pre-computed and normalized offline and shipped as static JSON (mirrors `sorted-custom-node-map.json` pattern for node search). +There are two independent orderings: **search** (a query is active) and **browse** (no query). They use different code paths and different signals. -## Sort Modes +## Search ordering -| Mode | Formula | Description | -| -------------- | ------------------------------------------------ | ---------------------- | -| `recommended` | `usage × 0.5 + internal × 0.3 + freshness × 0.2` | Curated recommendation | -| `popular` | `usage × 0.9 + freshness × 0.1` | Pure user-driven | -| `newest` | Date sort | Existing | -| `alphabetical` | Name sort | Existing | +Implemented in [`src/composables/templateSearchConfig.ts`](../src/composables/templateSearchConfig.ts). -Freshness computed at runtime from `template.date`: `1.0 / (1 + daysSinceAdded / 90)`, min 0.1. +`searchTemplates()` runs MiniSearch (BM25) over `title`, `description`, `tags`, `models` and `name`, with field boosts `title ×3`, `models ×2`, `tags ×2`, `name ×1`, `description ×0.5`. It searches with `AND`, falls back to `OR` if that returns nothing, then repeats both for the abbreviation-expanded query (`i2v` → `image video`) and appends the deduplicated extras. -## Data Files +`rankByRelevanceThenUsage()` then orders the hits: -**Usage scores** (generated from Mixpanel): +1. Each hit's relevance score is scaled by its curation multiplier — `1 + searchRankBoost(searchRank) × 0.3`, so curation can move a hit by at most ±30%. +2. Scores are bucketed into bands of 5% of the top score. Different band → higher score wins. +3. Same band → higher `usage` wins, dampened with `log1p`. -```json -// In templates/index.json, add to any template: -{ - "name": "some_template", - "usage": 1000, - ... -} -``` +Bucketing keeps the result a stable total order; a pairwise "within X%" comparison is intransitive and would make the order depend on input order. + +The ±30% cap is the deliberate balance: it is roughly six tiebreak bands, enough for a curated launch template to clear near-equal matches, and never enough to drag a weak match to the top. Curation cannot introduce a template that does not match the query at all. + +## Browse ordering (sort dropdown) + +Implemented in [`src/composables/useTemplateFiltering.ts`](../src/composables/useTemplateFiltering.ts). + +| Mode | Ordering | +| ------------------------ | --------------------------------------------------------------- | +| `relevance` | Search order, unmodified. Auto-selected while a query is active | +| `default` | The array order of `templates/index.json` | +| `recommended` | `usage × 0.5 + curation × 0.3 + freshness × 0.2` | +| `popular` | Raw `usage`, descending | +| `newest` | `date`, descending | +| `alphabetical` | Displayed title, A→Z, number-prefixed titles last | +| `model-size-low-to-high` | `size`, ascending | + +`default` is a deliberate pass-through: the order of `templates/index.json` is the editorial lever owned by the `workflow_templates` repo. Reordering entries there is what changes the default browse order. See [#7062](https://github.com/Comfy-Org/ComfyUI_frontend/pull/7062) for why this is not a computed blend. + +`freshness` is computed at runtime from `template.date` as `max(0.1, 1 / (1 + daysSinceAdded / 90))`. `curation` is `searchRankBoost(searchRank)` shifted from `[-1, 1]` into `[0, 1]`, so an uncurated template sits at the 0.5 midpoint. + +## `searchRank` -**Search rank** (set per-template in workflow_templates repo): +Set per template in the `workflow_templates` repo's `templates/index.json`. It is the manual override curators use to surface important templates — for example the templates accompanying a model launch. ```json -// In templates/index.json, add to any template: { - "name": "some_template", - "searchRank": 8, // Scale 1-10, default 5 - ... + "name": "video_minimax_h3_i2v", + "searchRank": 1000 } ``` -| searchRank | Effect | -| ---------- | ---------------------------- | -| 1-4 | Demote (bury in results) | -| 5 | Neutral (default if not set) | -| 6-10 | Promote (boost in results) | +| `searchRank` | Effect | +| -------------- | ----------------------------------------- | +| absent, or `0` | Neutral. No influence on ordering | +| `1` … `5` | Neutral. Reserved, see below | +| `6` … `1000` | Promote, with rapidly diminishing returns | +| above `1000` | Same as `1000`. Saturated, never larger | +| `-6` and below | Demote, mirroring the positive curve | -## Position Bias Correction +`searchRankBoost()` in [`src/platform/workflow/templates/utils/templateRanking.ts`](../src/platform/workflow/templates/utils/templateRanking.ts) is the single definition of what the field means; both the search path and the `recommended` sort read it. Magnitude follows `log1p(|searchRank|) / log1p(1000)`, capped at 1. The curve is logarithmic so the whole documented `0`–`1000` range from [`workflow_templates/docs/SPEC.md`](https://github.com/Comfy-Org/workflow_templates/blob/main/docs/SPEC.md) is usable, and saturating so an out-of-range value cannot swamp relevance: -Raw usage reflects true preference AND UI position bias. We use linear interpolation: +| `searchRank` | Boost | Search multiplier | +| ------------ | ----- | ----------------- | +| `0` | 0.00 | 1.00× | +| `8` | 0.32 | 1.10× | +| `100` | 0.67 | 1.20× | +| `500` | 0.90 | 1.27× | +| `1000` | 1.00 | 1.30× | +| `1000000` | 1.00 | 1.30× | + +### Why `1`–`5` are inert + +`searchRank` previously used a 1–10 scale where 1–4 demoted and 5 was neutral. A handful of templates — the numbered starter workflows — still carry values from it. Reading those on the current scale would turn a demotion into a promotion, so magnitudes of 5 and below are ignored. Nothing is lost: on a 0–1000 dial a value that small is indistinguishable from noise. + +### Why `0` is neutral rather than a demotion + +`workflow_templates` documents the field as "0-1000, higher = better ranking", and its tooling writes an explicit `"searchRank": 0` onto templates that nobody has curated — the majority of the catalog. Treating `0` as a demotion would therefore bury most templates beneath the minority that simply omit the field. Explicit demotion uses negative values instead. + +## `usage` + +A per-template count shipped in `templates/index.json`, refreshed periodically from real usage data. It drives the `popular` sort, the `recommended` blend, and the search tiebreak within a score band. + +Raw usage reflects both genuine preference and UI position bias, so it is normalized offline before being committed. Position-bias correction uses linear interpolation, giving templates buried further down up to a 2× correction: ``` correction = 1 + (position - 1) / (maxPosition - 1) normalizedUsage = rawUsage × correction ``` - -| Position | Boost | -| -------- | ----- | -| 1 | 1.0× | -| 50 | 1.28× | -| 100 | 1.57× | -| 175 | 2.0× | - -Templates buried at the bottom get up to 2× boost to compensate for reduced visibility. - ---- diff --git a/docs/adr/0015-adopt-fallow.md b/docs/adr/0015-adopt-fallow.md new file mode 100644 index 00000000000..30df88f69aa --- /dev/null +++ b/docs/adr/0015-adopt-fallow.md @@ -0,0 +1,73 @@ +# 15. Adopt Fallow + +Date: 2026-06-29 + +## Status + +Proposed + + + +## Context + +We already run [knip](https://knip.dev/) in CI (the lint-format check) and in +the pre-push hook to catch unused files, exports, and dependencies. It does not +cover duplication or complexity and has no diff-aware gate. + +[Fallow](https://github.com/fallow-rs/fallow) covers that wider set and adds +`fallow audit`, which compares a change against the base branch and, with +baselines, fails only on newly-introduced problems. See its docs for what each +check does. + +Two repo-specific facts shape how we adopt it. The repo already carries +inherited findings (litegraph and store members kept for the extension API, +intra-lib cycles, duplicate test fixtures, a marketing file waiting on a page +that imports it); gating on those would block unrelated work. And static +analysis cannot tell intentional-but-unreferenced code from real dead code, so +build and Storybook entry points, the extension API surface, lazily-loaded +modules, build-time icon sets, and hoisted phantom deps have to be declared. + +## Decision + +Adopt Fallow, introduced as a stack of small PRs so each cleanup is reviewable +on its own: remove the real findings first, then record what stays. Exceptions +go in `.fallowrc.jsonc` (Fallow reads JSONC, so each entry carries a comment +explaining why it is there) and inherited findings go in `.fallow-baselines/` +under `audit.gate: new-only`, so `audit` only flags new issues. Where they +overlap, the exceptions mirror the existing knip ones. No complexity threshold +was lowered and no rule disabled; the baselines are a migration aid to shrink +and re-save as code is cleaned up, not the target state. + +For now Fallow runs through the `pnpm` scripts and sits alongside knip. We have +not wired `fallow audit` into CI or the pre-push hook, and we have not retired +knip. The plan is to clear the remaining violations over time, shrinking the +baselines as we go. Once they are small enough, we gate Fallow in CI to lock in +the cleanup and stop backsliding. + +## Consequences + +### Positive + +- Coverage knip does not have: duplication, complexity, and a diff-aware gate. +- The cleanup stack removed real unused deps, dead exports, an unused type, and + a duplicate component. +- The new-only gate lets us adopt without first clearing the backlog. + +### Negative + +- Two overlapping tools until we either wire Fallow into the gates or drop knip. +- A baseline can hide a new instance of an already-baselined pattern when it + lands in an already-baselined file; baselines need re-saving as code changes. +- Contributors have to learn which findings are real and which belong in the + exception list. + +## Notes + +Open follow-ups, each with a tracking issue: + +- Declare the hoisted deps in `apps/desktop-ui/package.json` and drop those + `ignoreDependencies` exceptions: + [#14768](https://github.com/Comfy-Org/ComfyUI_frontend/issues/14768). +- Decide whether `fallow audit` should run in CI or pre-push, and whether it + replaces knip there: + [#14769](https://github.com/Comfy-Org/ComfyUI_frontend/issues/14769). diff --git a/docs/adr/README.md b/docs/adr/README.md index 3d5652889c6..f383e168979 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -24,6 +24,7 @@ An Architecture Decision Record captures an important architectural decision mad | [0012](0012-cloud-release-notes-use-comfyui-version.md) | Cloud Release Notes Use the ComfyUI Version | Accepted | 2026-07-13 | | [0013](0013-telemetry-service-selection.md) | Telemetry Service Selection | Accepted | 2026-07-28 | | [0014](0014-billing-telemetry-attempt-correlation-and-workspace-scoping.md) | Billing Telemetry Attempt Correlation and Workspace Scoping | Proposed | 2026-07-28 | +| [0015](0015-adopt-fallow.md) | Adopt Fallow | Proposed | 2026-06-29 | ## Creating a New ADR diff --git a/docs/guidance/typescript.md b/docs/guidance/typescript.md index 56b718a54b5..fdc0842f84a 100644 --- a/docs/guidance/typescript.md +++ b/docs/guidance/typescript.md @@ -30,6 +30,11 @@ When you must handle uncertain types, prefer these approaches in order: - Use `z.unknown()` if the type is genuinely unknown, then narrow it - Never add test-only settings/types to production schemas +### Server/API Response Types + +- Never hand-declare or inline types for server/API responses — import them from the generated shared types package (`@comfyorg/ingest-types` for Comfy Cloud's ingest API, `@comfyorg/registry-types` for the Registry API; both under `packages/`). Hand-declared copies silently drift from the real contract. This caused two real bugs in PR #14771: a status value missing from a hand-declared response type, and a hand-declared pagination type missing fields the generated one had. +- A thin local intersection type on top of the generated export is fine for genuine FE-only extensions; a full local redeclaration is not. + ### Public API Contracts - Keep public API types stable (e.g., `ExtensionManager` interface) diff --git a/docs/release-process.md b/docs/release-process.md index 5c549737200..08fb1e98330 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -89,6 +89,24 @@ unreachable Datadog — the job still assigns `fallbackGithubLogin` so PRs are never left unowned, but **exits non-zero** so the degradation is visible. A green run means a real sheriff was resolved from Datadog. +A failed run also posts to **#frontend-releases** with the reason, because a +failing scheduled workflow otherwise only notifies whoever last pushed to +`main` — in practice nobody, which is how the placeholder config survived for +weeks. Needs the `SLACK_BOT_TOKEN` secret; the post is `continue-on-error`, so +Slack being down never masks the underlying result. + +It alerts on the **transition** into failure, not on every failing run: the job +runs hourly, so a lasting breakage would otherwise post around the clock until +someone fixed it, and a channel that cries wolf gets muted. + +The check walks recent **scheduled** runs and reads the conclusion of the +`Assign release sheriff` **step**, not of the run. A run that died in checkout +failed without ever reaching the sheriff, and treating that as "already +alerted" would swallow the next real failure. Scheduled runs are used because +the `pull_request_target` gate skips most other runs, so they are the ones +dense in runs that decided anything. If the check itself cannot run it fails +open and alerts, since a duplicate beats a silence. + ## Publishing Merged PRs with the `Release` label trigger `release-draft-create.yaml`, diff --git a/knip.config.ts b/knip.config.ts index 874d9a2e604..3d6f9b8dc65 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -39,10 +39,7 @@ const config: KnipConfig = { }, ignoreDependencies: [ // Weird importmap things - '@iconify/json', - '@primeuix/forms', - '@primeuix/styled', - '@primevue/icons' + '@iconify/json' ], ignore: [ // Auto generated API types diff --git a/package.json b/package.json index b63516551e5..6022707dc03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@comfyorg/comfyui-frontend", - "version": "1.50.1", + "version": "1.50.2", "private": true, "description": "Official front-end implementation of ComfyUI", "homepage": "https://comfy.org", @@ -78,12 +78,9 @@ "@floating-ui/vue": "catalog:", "@formkit/auto-animate": "catalog:", "@iconify/json": "catalog:", - "@primeuix/forms": "catalog:", - "@primeuix/styled": "catalog:", "@primeuix/utils": "catalog:", "@primevue/core": "catalog:", "@primevue/forms": "catalog:", - "@primevue/icons": "catalog:", "@primevue/themes": "catalog:", "@sentry/vue": "catalog:", "@sparkjsdev/spark": "catalog:", @@ -99,10 +96,11 @@ "@vee-validate/zod": "catalog:", "@vueuse/core": "catalog:", "@vueuse/integrations": "catalog:", - "@vueuse/router": "^14.3.0", + "@vueuse/router": "^14.4.0", "@xterm/addon-fit": "^0.10.0", "@xterm/addon-serialize": "^0.13.0", "@xterm/xterm": "^5.5.0", + "ag-psd": "catalog:", "algoliasearch": "catalog:", "axios": "catalog:", "chart.js": "^4.5.0", @@ -182,7 +180,6 @@ "globals": "catalog:", "happy-dom": "catalog:", "husky": "catalog:", - "jiti": "catalog:", "jsdom": "catalog:", "knip": "catalog:", "lint-staged": "catalog:", diff --git a/packages/ingest-types/src/types.gen.ts b/packages/ingest-types/src/types.gen.ts index 6f6d13bc59e..22988781033 100644 --- a/packages/ingest-types/src/types.gen.ts +++ b/packages/ingest-types/src/types.gen.ts @@ -3368,7 +3368,7 @@ export type CancelSubscriptionResponse = { */ billing_op_id: string /** - * The date when the subscription will end (end of current billing period) + * The terminal cancellation time for a delinquent Stripe subscription, otherwise the end of the current billing period */ cancel_at: string } @@ -3401,8 +3401,8 @@ export type BulkRevokeApiKeysResponse = { export type BillingStatusResponse = { /** * Present when the pending operation cannot proceed without the - * customer. Today this is a Stripe-hosted payment page for a - * subscription whose first invoice needs authentication (SCA/3DS); + * customer. Today this is a Stripe-hosted payment page for an invoice + * needing authentication (SCA/3DS); * send the customer there to complete payment. Mirrors the field of * the same name on BillingOpStatusResponse. * @@ -3438,10 +3438,21 @@ export type BillingStatusResponse = { * client recover a payment it has lost the local reference to — a * cleared browser, or simply a different device from the one that * started it — by polling /billing/ops/{id} without having stored the - * id. Absent when no operation is pending. + * id. Absent when no operation is pending, and for non-owners, who + * cannot act on one. * */ pending_billing_op_id?: string + /** + * How the client should resume `pending_billing_op_id`, not the + * internal operation type: a plan change reports `subscription`, + * because it resumes exactly like one. A top-up resumes with a + * different timeout and completion path, so the two cannot be + * told apart by the client. Present whenever + * `pending_billing_op_id` is. + * + */ + pending_billing_op_type?: 'subscription' | 'topup' /** * Plan identifier (e.g., standard-monthly, team-pro-annual) */ @@ -6163,7 +6174,7 @@ export type CancelSubscriptionData = { export type CancelSubscriptionErrors = { /** - * Invalid request (e.g., no active subscription) + * Invalid request (for example, no active subscription). Ambiguous legacy Stripe state uses code BILLING_RECONCILIATION_REQUIRED. */ 400: ErrorResponse /** diff --git a/packages/ingest-types/src/zod.gen.ts b/packages/ingest-types/src/zod.gen.ts index 9792f6ba109..a05344415d2 100644 --- a/packages/ingest-types/src/zod.gen.ts +++ b/packages/ingest-types/src/zod.gen.ts @@ -2057,6 +2057,7 @@ export const zBillingStatusResponse = z.object({ max_seats: z.number().int(), occupied_seats: z.number().int(), pending_billing_op_id: z.string().optional(), + pending_billing_op_type: z.enum(['subscription', 'topup']).optional(), plan_slug: z.string().optional(), renewal_date: z.string().datetime().optional(), subscription_duration: zSubscriptionDuration.optional(), diff --git a/packages/registry-types/src/comfyRegistryTypes.ts b/packages/registry-types/src/comfyRegistryTypes.ts index 95a6e46c46b..31ac0700ed9 100644 --- a/packages/registry-types/src/comfyRegistryTypes.ts +++ b/packages/registry-types/src/comfyRegistryTypes.ts @@ -6720,8 +6720,18 @@ export interface components { * • Size: No more than 10 MB (30 MB for seedream-5.0-pro) * • Total pixels: No more than 6000x6000 (36,000,000 px) for seedream-5.0-pro * • Maximum of 14 reference images (10 for seedream-5.0-pro) + * + * In the layer-separation scenario (layer_decomposition enabled), image is required and only a single input image is supported (passing multiple images returns an error). Input images must be png, jpeg, webp, bmp, tiff or gif (heic and heif are not supported), up to 30 MB, with total pixels in the range [512x512, 6000x6000] and aspect ratio in [1/16, 16]. */ image?: string | string[]; + /** + * @description Controls whether layer separation is enabled. Only seedream-5.0-pro supports this parameter. + * true: Layer-separation mode. The model decomposes the single input image into one base image plus multiple layers (up to 16), and returns the position and content information of each produced layer, including the stacking order (z_index), bounding box (bounding_box), name (name) and description (description). + * false: Standard image-generation mode; no layer separation is performed. + * Notes on layer-separation mode: only a single input image is supported (passing multiple images returns an error); if any single layer fails to generate, the whole request fails — partial success is not supported; at most 17 images are returned (1 base image + 16 layers). sequential_image_generation, sequential_image_generation_options, tools and stream return an error if passed. + * @default false + */ + layer_decomposition: boolean; /** @enum {string} */ model: "seedream-3-0-t2i-250415" | "seededit-3-0-i2i-250628" | "seedream-4-0-250828" | "seedream-4-5-251128" | "seedream-5-0-260128" | "seedream-5-0-pro-260628"; /** @description Configuration for prompt optimization feature. Only seedream-5.0-pro/5.0-lite/4.5 (only support standard mode) and seedream-4.0 support this parameter. */ @@ -6734,13 +6744,16 @@ export interface components { mode: "standard" | "fast"; }; /** - * @description Specifies the format of the output image. Only seedream-5.0-pro and 5.0-lite support this parameter. + * @description Specifies the format of the output image. Only seedream-5.0-pro and 5.0-lite support this parameter. In the layer-separation scenario, output_format only controls the format of the base image; every layer is always output as png. * @default jpeg * @enum {string} */ output_format: "png" | "jpeg"; - /** @description Text description for image generation or transformation */ - prompt: string; + /** + * @description Text description for image generation or transformation. + * Optional in the layer-separation scenario (seedream-5.0-pro with layer_decomposition enabled): if a prompt is provided, the model recognizes and separates the elements you specify according to the prompt intent; if no prompt is provided, the model automatically detects all major elements in the image and separates them into independent layers. + */ + prompt?: string; /** * @description Specifies the format of the generated image returned in the response * @default url @@ -6784,6 +6797,9 @@ export interface components { * "seedream-5-0-pro-260628": Two methods available (cannot be used together). * Method 1 | Specify the resolution and describe the aspect ratio, shape or purpose of the image in the prompt; the model decides the final size. Optional values: 1K, 2K * Method 2 | Specify width and height in pixels. Default: 1024x1024, total pixels: [1024x1024 (1048576), 2048x2048 (4194304)], aspect ratio: [1/16, 16] + * "seedream-5-0-pro-260628" with layer_decomposition enabled: Only the resolution-level method is supported. Optional values: 1K, 1.5K, 2K, auto. Default: auto. + * The base image is output at the specified resolution with the aspect ratio of the original input image; each layer is output close to the specified resolution, keeping the aspect ratio it had in the original image. + * auto: Output is based on the size and aspect ratio of the input image. Inputs within [1280x720, ~2048x2048] are output at the original input size; inputs smaller than 1K are output at 1K; inputs larger than 2K are output at 2K. */ size?: string; /** @@ -6800,10 +6816,24 @@ export interface components { BytePlusImageGenerationResponse: { /** @description Unix timestamp (in seconds) indicating the time when the request was created */ created?: number; - /** @description Contains information about the generated image(s) */ + /** + * @description Contains information about the generated image(s). + * In the layer-separation scenario, the first element of the array is the base image (z_index=0), and the following elements are the layers, ordered by increasing z_index. + */ data?: { /** @description Base64-encoded image data (if response_format is "b64_json") */ b64_json?: string; + /** @description The bounding-box information of the region that the current layer occupies within the base image. Only layers return this field; the base image covers the whole canvas and does not return bounding_box. Returned only when layer_decomposition is true. */ + bounding_box?: { + /** @description The absolute pixel coordinates of the layer's bounding box, in the output base image's coordinate system with the top-left corner at (0, 0). Coordinate format: [left, top, right, bottom]. */ + absolute?: number[]; + /** @description The per-mille quantized (normalized) coordinates of the layer's bounding box, proportionally mapped to a discrete integer range of [0, 1000] based on the base image size, truncated at a maximum of 1000. Coordinate format: [left, top, right, bottom]. */ + normalized?: number[]; + }; + /** @description A detailed description of the current separated element, providing richer layer characteristics (such as color, state, material) than name. Only layers return this field; the base image does not. Returned only when layer_decomposition is true. */ + description?: string; + /** @description The name/label of the current separated element, automatically generated by the model from the characteristics of the separated subject. Only layers return this field; the base image does not. Returned only when layer_decomposition is true. */ + name?: string; /** @description The file format of the output image. Only seedream-5.0-pro supports this field. */ output_format?: string; /** @description The width and height of the image in pixels, in the format x. Only seedream-5.0-pro, 5.0-lite, 4.5 and 4.0 support this parameter. */ @@ -6813,6 +6843,8 @@ export interface components { * @description URL for image download (if response_format is "url") */ url?: string; + /** @description The stacking order of the layer, increasing from bottom to top: 0 is the bottom-most layer (the base image); larger values sit higher. Use it to recompose the layers into the complete image at the correct stacking order. Returned only when layer_decomposition is true. */ + z_index?: number; }[]; /** @description Error information (if any) */ error?: { @@ -17243,13 +17275,18 @@ export interface components { }; TopazEnhanceGenRequest: { /** - * @description To preserve the original color - available for Reimagine only (must be string "true" or "false" due to Topaz API requirement) + * @description Automatically generate a prompt from the input image - available for Bloom 2 only + * @default true + */ + autoprompt: boolean; + /** + * @description To preserve the original color - available for Reimagine and Bloom 2 only (must be string "true" or "false" due to Topaz API requirement) * @default true * @enum {string} */ color_preservation: "true" | "false"; /** - * @description Creativity settings range from 1 to 9 - - available for Reimagine only + * @description Creativity settings range from 1 to 9 - available for Reimagine and Bloom 2 only * @default 3 */ creativity: number; @@ -17258,6 +17295,11 @@ export interface components { * @default false */ crop_to_fill: boolean; + /** + * @description Strength of the enhancement - low, medium or high - available for Wonder 3.5 only + * @default high + */ + enhancement_strength: string; /** * @description By default, faces (if any) are enhanced during image processing as well. Set face_enhancement to false if you don't want this * @default true @@ -17279,17 +17321,46 @@ export interface components { * @enum {string} */ face_preservation: "true" | "false"; + /** + * @description Whether to add grain to the output image - available for Wonder 3.5 and Bloom 2 only + * @default false + */ + grain: boolean; + /** + * @description Density of the added grain from 0 to 1 - ignored if grain is false - available for Wonder 3.5 and Bloom 2 only + * @default 0.5 + */ + grain_density: number; + /** + * @description Grain model - silver, gaussian or grey - ignored if grain is false - available for Wonder 3.5 and Bloom 2 only + * @default silver + */ + grain_model: string; + /** + * @description Size of the added grain from 1 to 5 - ignored if grain is false - available for Wonder 3.5 and Bloom 2 only + * @default 1 + */ + grain_size: number; + /** + * @description Strength of the added grain from 0 to 1 - ignored if grain is false - available for Wonder 3.5 and Bloom 2 only + * @default 0.5 + */ + grain_strength: number; /** * Format: binary * @description The image file to be processed. Supported formats - jpeg (or jpg), png, tiff (or tif) */ image?: string; + /** @description Height of the input image in pixels - available for Wonder 3.5 and Bloom 2 only */ + input_height?: number; + /** @description Width of the input image in pixels - available for Wonder 3.5 and Bloom 2 only */ + input_width?: number; /** - * @description The model to use for processing the image (Bloom - Creative Upscale) + * @description The model to use for processing the image * @default Reimagine * @enum {string} */ - model: "Reimagine"; + model: "Reimagine" | "Wonder 3.5" | "Bloom 2"; /** * @description The desired format of the output image * @default jpeg @@ -17301,10 +17372,14 @@ export interface components { /** @description The desired width of the output image in pixels */ output_width?: number; /** - * @description Text prompt for creative upscaling guidance - available for Reimagine only + * @description Text prompt for creative upscaling guidance - available for Reimagine and Bloom 2 only * @example enter-your-prompt-here */ prompt?: string; + /** @description URI of a reference image to guide generation - available for Bloom 2 only */ + reference_uri?: string; + /** @description Seed for reproducible generation - available for Bloom 2 only */ + seed?: number; /** * @description Unique identifier of the source image * @example d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b diff --git a/packages/shared-frontend-utils/src/formatUtil.test.ts b/packages/shared-frontend-utils/src/formatUtil.test.ts index 1b7d5896e26..1bc7eb1f82f 100644 --- a/packages/shared-frontend-utils/src/formatUtil.test.ts +++ b/packages/shared-frontend-utils/src/formatUtil.test.ts @@ -201,8 +201,10 @@ describe('formatUtil', () => { }) describe('highlightQuery', () => { - it('should return text unchanged when query is empty', () => { - expect(highlightQuery('Hello World', '')).toBe('Hello World') + it('should sanitize text when query is empty', () => { + expect(highlightQuery('Hello', '')).toBe( + '<img src=x onerror=alert(1)>Hello' + ) }) it('should wrap matching text in highlight span', () => { @@ -220,6 +222,17 @@ describe('formatUtil', () => { expect(result).not.toContain(' diff --git a/src/platform/cloud/onboarding/components/CloudTemplate.test.ts b/src/platform/cloud/onboarding/components/CloudTemplate.test.ts index 35650cc838b..b0ab43c3876 100644 --- a/src/platform/cloud/onboarding/components/CloudTemplate.test.ts +++ b/src/platform/cloud/onboarding/components/CloudTemplate.test.ts @@ -1,9 +1,40 @@ import { render, screen } from '@testing-library/vue' -import { describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { createI18n } from 'vue-i18n' import { createMemoryHistory, createRouter } from 'vue-router' import CloudTemplate from './CloudTemplate.vue' +const i18n = createI18n({ + legacy: false, + locale: 'en', + messages: { en: { g: { comfyOrgLogoAlt: 'ComfyOrg Logo' } } } +}) + +/** + * Drives the real `useMediaQuery`, so the breakpoint the component asks for is + * part of what these tests pin rather than something a mock papers over. + */ +function stubViewportWidth(pixels: number) { + vi.stubGlobal( + 'matchMedia', + vi.fn((query: string) => { + const minWidth = /min-width:\s*([\d.]+)(px|rem)/.exec(query) + const threshold = minWidth + ? Number(minWidth[1]) * (minWidth[2] === 'rem' ? 16 : 1) + : 0 + return { + matches: pixels >= threshold, + media: query, + onchange: null, + addEventListener: vi.fn(), + removeEventListener: vi.fn(), + dispatchEvent: vi.fn() + } + }) + ) +} + const renderWithMeta = async (meta: Record) => { const router = createRouter({ history: createMemoryHistory(), @@ -13,23 +44,56 @@ const renderWithMeta = async (meta: Record) => { await router.isReady() return render(CloudTemplate, { global: { - plugins: [router], + plugins: [router, i18n], stubs: { CloudHeroCarousel: { template: '
' }, - CloudTemplateFooter: true + CloudTemplateFooter: { template: '
' }, + CloudTermsNotice: { template: '
' } } } }) } +afterEach(() => { + vi.unstubAllGlobals() +}) + describe('CloudTemplate', () => { - it('shows the hero carousel when the route does not hide it', async () => { + it('shows the hero carousel on a wide viewport', async () => { + stubViewportWidth(1280) await renderWithMeta({}) expect(screen.getByTestId('hero')).toBeInTheDocument() }) it('hides the hero carousel when route.meta.hideHero is set', async () => { + stubViewportWidth(1280) await renderWithMeta({ hideHero: true }) expect(screen.queryByTestId('hero')).not.toBeInTheDocument() }) + + it('does not mount the hero carousel on a tablet-width viewport', async () => { + stubViewportWidth(1024) + await renderWithMeta({}) + expect( + screen.queryByTestId('hero'), + 'mounting below `xl` would download the hero video on devices that never display it' + ).not.toBeInTheDocument() + }) + + it('swaps the footer for the terms notice when the route asks for it', async () => { + stubViewportWidth(1280) + await renderWithMeta({ showTermsNotice: true }) + expect(screen.getByTestId('terms')).toBeInTheDocument() + expect( + screen.queryByTestId('footer'), + 'the notice and the generic footer are alternatives, never both' + ).not.toBeInTheDocument() + }) + + it('shows the generic footer by default', async () => { + stubViewportWidth(1280) + await renderWithMeta({}) + expect(screen.getByTestId('footer')).toBeInTheDocument() + expect(screen.queryByTestId('terms')).not.toBeInTheDocument() + }) }) diff --git a/src/platform/cloud/onboarding/components/CloudTemplate.vue b/src/platform/cloud/onboarding/components/CloudTemplate.vue index a05717835a9..4a3a1e1e64a 100644 --- a/src/platform/cloud/onboarding/components/CloudTemplate.vue +++ b/src/platform/cloud/onboarding/components/CloudTemplate.vue @@ -1,37 +1,47 @@ - diff --git a/src/platform/cloud/onboarding/components/CloudTemplateFooter.vue b/src/platform/cloud/onboarding/components/CloudTemplateFooter.vue index 049747903e4..4ca3db216d2 100644 --- a/src/platform/cloud/onboarding/components/CloudTemplateFooter.vue +++ b/src/platform/cloud/onboarding/components/CloudTemplateFooter.vue @@ -1,7 +1,5 @@ + + diff --git a/src/platform/cloud/onboarding/composables/useProgressBarPainter.ts b/src/platform/cloud/onboarding/composables/useProgressBarPainter.ts new file mode 100644 index 00000000000..418f7ab48e4 --- /dev/null +++ b/src/platform/cloud/onboarding/composables/useProgressBarPainter.ts @@ -0,0 +1,63 @@ +import { useRafFn } from '@vueuse/core' +import { clamp } from 'es-toolkit' +import { toValue, watch } from 'vue' +import type { MaybeRefOrGetter } from 'vue' + +interface SlideProgressInput { + currentTime: number + duration: number + elapsedMs: number + fallbackMs: number +} + +/** + * Fraction of the way to the next slide. Falls back to elapsed wall-clock against + * the watchdog's delay, so a buffering video still tracks when it will change. + */ +export function slideProgress({ + currentTime, + duration, + elapsedMs, + fallbackMs +}: SlideProgressInput): number { + const ratio = + Number.isFinite(duration) && duration > 0 + ? currentTime / duration + : elapsedMs / fallbackMs + return clamp(ratio, 0, 1) +} + +interface ProgressBarPainterOptions { + target: MaybeRefOrGetter + progress: () => number + active: MaybeRefOrGetter +} + +/** + * Writes to the DOM each frame; a 60Hz ref would re-diff every mounted video. + * Sets `scale`, not `transform`: Tailwind compiles `scale-x-*` to the standalone + * `scale` property, so `transform` would multiply against the class. + */ +export function useProgressBarPainter({ + target, + progress, + active +}: ProgressBarPainterOptions): void { + const paint = () => { + const el = toValue(target) + if (el) el.style.scale = `${clamp(progress(), 0, 1)} 1` + } + + const { pause, resume } = useRafFn(paint, { immediate: false }) + + watch( + [() => toValue(active), () => toValue(target)], + ([isActive, el]) => { + pause() + if (!el) return + paint() + if (isActive) resume() + }, + { immediate: true } + ) +} diff --git a/src/platform/cloud/onboarding/composables/useVideoCarousel.test.ts b/src/platform/cloud/onboarding/composables/useVideoCarousel.test.ts new file mode 100644 index 00000000000..628a1306e5e --- /dev/null +++ b/src/platform/cloud/onboarding/composables/useVideoCarousel.test.ts @@ -0,0 +1,310 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { effectScope, nextTick, shallowRef } from 'vue' +import type { EffectScope } from 'vue' + +import { slideProgress } from '@/platform/cloud/onboarding/composables/useProgressBarPainter' +import { useVideoCarousel } from '@/platform/cloud/onboarding/composables/useVideoCarousel' + +const FALLBACK_MS = 6000 + +type Carousel = ReturnType + +/** + * happy-dom implements play/pause/currentTime but leaves `duration` a read-only + * NaN, so only that one property is patched onto a real media element. + */ +function createVideo(duration = 10) { + const el = document.createElement('video') + Object.defineProperty(el, 'duration', { value: duration, configurable: true }) + vi.spyOn(el, 'play').mockResolvedValue(undefined) + vi.spyOn(el, 'pause').mockImplementation(() => {}) + return el +} + +let scope: EffectScope + +async function mountCarousel(slideCount: number) { + const rootEl = document.createElement('div') + document.body.append(rootEl) + const root = shallowRef(rootEl) + let carousel!: Carousel + scope = effectScope() + scope.run(() => { + carousel = useVideoCarousel({ + count: slideCount, + root, + fallbackMs: FALLBACK_MS + }) + }) + const videos = Array.from({ length: slideCount }, () => createVideo()) + videos.forEach((el, index) => carousel.setVideoRef(index, el)) + await nextTick() + return { carousel, videos, rootEl } +} + +beforeEach(() => { + vi.useFakeTimers() +}) + +afterEach(() => { + scope?.stop() + vi.useRealTimers() + vi.unstubAllGlobals() + vi.restoreAllMocks() +}) + +describe('useVideoCarousel', () => { + it('advances when the active video ends and wraps past the last slide', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onEnded(0) + expect(carousel.activeIndex.value).toBe(1) + + carousel.onEnded(1) + carousel.onEnded(2) + expect(carousel.activeIndex.value).toBe(0) + }) + + it('ignores an ended event from a slide that is not active', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onEnded(2) + + expect(carousel.activeIndex.value).toBe(0) + }) + + it('skips over an already-failed slide rather than landing on it', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onError(1) + expect(carousel.activeIndex.value).toBe(0) + + carousel.next() + expect(carousel.activeIndex.value).toBe(2) + }) + + it('reports forwards travel even when a failed slide is skipped over', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onError(1) + carousel.next() + + expect( + carousel.activeIndex.value, + 'landing two slots away is what makes the index gap unreadable as a direction' + ).toBe(2) + expect(carousel.lastStep.value).toBe(1) + }) + + it('reports backwards travel across the wrap of a two-slide carousel', async () => { + const { carousel } = await mountCarousel(2) + + carousel.previous() + + expect(carousel.activeIndex.value).toBe(1) + expect( + carousel.lastStep.value, + 'either direction moves one slot in a pair, so only the request distinguishes them' + ).toBe(-1) + }) + + it('retries from the start once every slide has failed', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onError(0) + carousel.onError(1) + carousel.onError(2) + expect( + carousel.activeIndex.value, + 'the third failure exhausts the set, which clears it and lands back on slide 0 rather than freezing on a poster for the session' + ).toBe(0) + + carousel.next() + + expect( + carousel.activeIndex.value, + 'cleared marks mean the reel keeps advancing' + ).toBe(1) + }) + + it('ignores a repeated error from a slide already marked failed', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onError(0) + expect(carousel.activeIndex.value).toBe(1) + + carousel.onError(0) + + expect(carousel.activeIndex.value).toBe(1) + }) + + it('advances on the watchdog when playback never starts', async () => { + const { carousel } = await mountCarousel(3) + + await vi.advanceTimersByTimeAsync(FALLBACK_MS) + + expect(carousel.activeIndex.value).toBe(1) + }) + + it('holds the slide while the active video keeps reporting progress', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onPlaying(0) + await nextTick() + + for (let tick = 0; tick < 4; tick++) { + await vi.advanceTimersByTimeAsync(FALLBACK_MS / 2) + carousel.onProgress(0) + } + + expect( + carousel.activeIndex.value, + 'each progress report pushes the stall deadline out past the watchdog' + ).toBe(0) + }) + + it('advances when a playing video silently stops reporting progress', async () => { + const { carousel } = await mountCarousel(3) + + carousel.onPlaying(0) + await nextTick() + await vi.advanceTimersByTimeAsync(FALLBACK_MS) + + expect( + carousel.activeIndex.value, + 'a mid-decode freeze emits no waiting/pause/ended, so silence is the only signal the reel has died' + ).toBe(1) + }) + + it('does not run a watchdog for a single slide', async () => { + await mountCarousel(1) + + expect( + vi.getTimerCount(), + 'activeIndex cannot move with one slide, so a pending timer is the only observable difference' + ).toBe(0) + }) + + it('preloads only the active slide until it is playing, then arms the next', async () => { + const { carousel } = await mountCarousel(3) + + expect(carousel.preloadFor(0)).toBe('auto') + expect(carousel.preloadFor(1)).toBe('none') + expect(carousel.preloadFor(2)).toBe('none') + + carousel.onPlaying(0) + await nextTick() + + expect(carousel.preloadFor(1)).toBe('auto') + expect(carousel.preloadFor(2)).toBe('none') + }) + + it('rewinds the incoming slide and pauses the outgoing one', async () => { + const { carousel, videos } = await mountCarousel(3) + videos[0].currentTime = 4 + videos[1].currentTime = 7 + + carousel.next() + await nextTick() + + expect(videos[1].currentTime).toBe(0) + expect(videos[0].pause).toHaveBeenCalled() + }) + + it('pauses playback while the tab is hidden', async () => { + const { carousel, videos } = await mountCarousel(3) + carousel.onPlaying(0) + await nextTick() + + vi.spyOn(document, 'visibilityState', 'get').mockReturnValue('hidden') + document.dispatchEvent(new Event('visibilitychange')) + await nextTick() + + expect(videos[0].pause).toHaveBeenCalled() + }) + + it('never plays or advances when reduced motion is preferred', async () => { + vi.stubGlobal( + 'matchMedia', + vi.fn((query: string) => ({ + matches: query.includes('prefers-reduced-motion: reduce'), + media: query, + onchange: null, + addEventListener: vi.fn(), + removeEventListener: vi.fn(), + dispatchEvent: vi.fn() + })) + ) + const { carousel, videos } = await mountCarousel(3) + await vi.advanceTimersByTimeAsync(FALLBACK_MS * 2) + + expect(videos[0].play).not.toHaveBeenCalled() + expect(vi.getTimerCount(), 'no watchdog is armed either').toBe(0) + expect(carousel.activeIndex.value).toBe(0) + }) + + it('advances after a playing video reports it has stalled', async () => { + const { carousel } = await mountCarousel(3) + carousel.onPlaying(0) + await nextTick() + carousel.onProgress(0) + + carousel.onStalled(0) + await nextTick() + await vi.advanceTimersByTimeAsync(FALLBACK_MS) + + expect(carousel.activeIndex.value).toBe(1) + }) + + it('reports the carousel inactive once playback is paused and stopped', async () => { + const { carousel } = await mountCarousel(3) + carousel.onPlaying(0) + await nextTick() + expect(carousel.isCarouselActive.value).toBe(true) + + vi.spyOn(document, 'visibilityState', 'get').mockReturnValue('hidden') + document.dispatchEvent(new Event('visibilitychange')) + carousel.onStalled(0) + await nextTick() + + expect(carousel.isCarouselActive.value).toBe(false) + }) +}) + +describe('slideProgress', () => { + it('uses the media clock when the duration is usable', () => { + expect( + slideProgress({ + currentTime: 3, + duration: 12, + elapsedMs: 0, + fallbackMs: FALLBACK_MS + }) + ).toBe(0.25) + }) + + it.for([Number.NaN, Number.POSITIVE_INFINITY, 0])( + 'falls back to elapsed time when duration is %s', + (duration) => { + expect( + slideProgress({ + currentTime: 3, + duration, + elapsedMs: 1500, + fallbackMs: FALLBACK_MS + }) + ).toBe(0.25) + } + ) + + it('clamps a playhead that overruns its reported duration', () => { + expect( + slideProgress({ + currentTime: 30, + duration: 12, + elapsedMs: 0, + fallbackMs: FALLBACK_MS + }) + ).toBe(1) + }) +}) diff --git a/src/platform/cloud/onboarding/composables/useVideoCarousel.ts b/src/platform/cloud/onboarding/composables/useVideoCarousel.ts new file mode 100644 index 00000000000..97e15db63b0 --- /dev/null +++ b/src/platform/cloud/onboarding/composables/useVideoCarousel.ts @@ -0,0 +1,180 @@ +import { + useDocumentVisibility, + useIntersectionObserver, + usePreferredReducedMotion, + useTimeoutFn +} from '@vueuse/core' +import { computed, ref, watch } from 'vue' +import type { ComponentPublicInstance, ShallowRef } from 'vue' + +import { slideProgress } from '@/platform/cloud/onboarding/composables/useProgressBarPainter' +import { wrapIndex } from '@/utils/mathUtil' + +const DEFAULT_FALLBACK_MS = 6000 + +interface VideoCarouselOptions { + /** Fixed for the composable's lifetime: the slide list is a module constant. */ + count: number + /** Readonly so it accepts `useTemplateRef` without widening the element type. */ + root: Readonly> + fallbackMs?: number +} + +export function useVideoCarousel({ + count, + root, + fallbackMs = DEFAULT_FALLBACK_MS +}: VideoCarouselOptions) { + const activeIndex = ref(0) + const failedIndices = ref(new Set()) + const isPlaying = ref(false) + const videoEls = ref<(HTMLVideoElement | null)[]>([]) + + /** Optimistic: the hero is above the fold, and waiting for the observer's + * first callback would cost a frame of playback. */ + const isVisible = ref(true) + useIntersectionObserver(root, ([entry]) => { + isVisible.value = entry?.isIntersecting ?? false + }) + + const documentVisibility = useDocumentVisibility() + const motionPreference = usePreferredReducedMotion() + + const shouldPlay = computed( + () => + motionPreference.value !== 'reduce' && + isVisible.value && + documentVisibility.value !== 'hidden' && + !failedIndices.value.has(activeIndex.value) + ) + + const setVideoRef = ( + index: number, + el: Element | ComponentPublicInstance | null + ) => { + videoEls.value[index] = el instanceof HTMLVideoElement ? el : null + } + const activeVideo = computed(() => videoEls.value[activeIndex.value] ?? null) + + /** The direction the last move was asked to travel. Skipping a failed slide + * can land further than one slot, so the gap between indices does not + * reveal it. */ + const lastStep = ref<1 | -1>(1) + + /** Nearest slide in `delta`'s direction that has not failed. */ + const step = (delta: 1 | -1) => { + if (count === 0) return + // Usually one dropped connection rather than three dead sources, so clear + // the marks and retry instead of freezing on a poster for the session. + if (failedIndices.value.size >= count) failedIndices.value = new Set() + + let candidate = activeIndex.value + for (let attempt = 0; attempt < count; attempt++) { + candidate = wrapIndex(candidate + delta, count) + if (!failedIndices.value.has(candidate)) break + } + lastStep.value = delta + activeIndex.value = candidate + } + + const goToNextSlide = () => step(1) + const goToPreviousSlide = () => step(-1) + + /** Media events fire per slide; only the active one may act. */ + const forActiveSlide = (handle: () => void) => (index: number) => { + if (index === activeIndex.value) handle() + } + + /** Outside reactivity: read once per frame by `progress()`, never in a render. */ + let slideStartedAt = performance.now() + + watch(activeIndex, () => { + slideStartedAt = performance.now() + isPlaying.value = false + const incoming = activeVideo.value + if (incoming) incoming.currentTime = 0 + }) + + const pauseInactiveVideos = () => { + for (const [index, video] of videoEls.value.entries()) { + if (video && index !== activeIndex.value) video.pause() + } + } + + watch( + [shouldPlay, activeVideo], + ([mayPlay, video]) => { + pauseInactiveVideos() + if (!video) return + if (!mayPlay) { + video.pause() + return + } + // Refused (iOS Low Power Mode) or aborted by a rapid slide change. + // Recovery is left to the watchdog, which disposes with the scope; + // mutating state here could outlive the component. + void video.play().catch(() => {}) + }, + { immediate: true } + ) + + const { start: startWatchdog, stop: stopWatchdog } = useTimeoutFn( + goToNextSlide, + fallbackMs, + { immediate: false } + ) + + /** Armed during playback too: a mid-decode freeze emits no `waiting`, `pause` + * or `ended`, so silence from `timeupdate` is the only signal it died. */ + const armWatchdog = () => { + stopWatchdog() + if (count > 1 && shouldPlay.value) startWatchdog() + } + + watch([isPlaying, activeIndex, shouldPlay], armWatchdog, { immediate: true }) + + const nextIndex = computed(() => + count > 1 ? wrapIndex(activeIndex.value + 1, count) : -1 + ) + + return { + activeIndex, + lastStep, + setVideoRef, + isCarouselActive: computed(() => shouldPlay.value || isPlaying.value), + next: goToNextSlide, + previous: goToPreviousSlide, + onPlaying: forActiveSlide(() => { + isPlaying.value = true + }), + onStalled: forActiveSlide(() => { + isPlaying.value = false + }), + onEnded: forActiveSlide(goToNextSlide), + /** Each report pushes the stall deadline out. */ + onProgress: forActiveSlide(armWatchdog), + /** Marks the source dead so `step` skips it. */ + onError: (index: number) => { + if (failedIndices.value.has(index)) return + failedIndices.value = new Set(failedIndices.value).add(index) + if (index === activeIndex.value) goToNextSlide() + }, + /** + * The next slide arms only once the current one is playing, so two clips + * never compete for bandwidth. `none`, not `metadata`, for the rest: that + * would still open a connection per slide. + */ + preloadFor: (index: number): 'auto' | 'none' => + index === activeIndex.value || + (isPlaying.value && index === nextIndex.value) + ? 'auto' + : 'none', + progress: () => + slideProgress({ + currentTime: activeVideo.value?.currentTime ?? 0, + duration: activeVideo.value?.duration ?? Number.NaN, + elapsedMs: performance.now() - slideStartedAt, + fallbackMs + }) + } +} diff --git a/src/platform/cloud/onboarding/constants/heroSlides.ts b/src/platform/cloud/onboarding/constants/heroSlides.ts new file mode 100644 index 00000000000..2da6db0401f --- /dev/null +++ b/src/platform/cloud/onboarding/constants/heroSlides.ts @@ -0,0 +1,50 @@ +/** Hero carousel media on media.comfy.org (gs://comfy-org-videos/website/cloud/onboarding). */ +const HERO_MEDIA = 'https://media.comfy.org/website/cloud/onboarding' + +/** Resolves to an `icon-[comfy--*]` class, all safelisted in the design system. */ +type Provider = 'gemini' | 'openai' | 'kling' | 'bytedance' + +export interface HeroSlide { + readonly id: string + /** Model name — a proper noun, deliberately not an i18n key. */ + readonly title: string + readonly provider: Provider + readonly src: string + readonly poster: string + /** Must match the served file: a wrong type makes the browser skip the source. */ + readonly mimeType: string +} + +export const HERO_SLIDES: readonly HeroSlide[] = [ + { + id: 'nano-banana-pro', + title: 'Nano Banana Pro', + provider: 'gemini', + src: `${HERO_MEDIA}/hero-1.webm`, + poster: `${HERO_MEDIA}/hero-1.webp`, + mimeType: 'video/webm' + }, + { + id: 'seedream-4', + title: 'Seedream 4', + provider: 'bytedance', + src: `${HERO_MEDIA}/hero-2.webm`, + poster: `${HERO_MEDIA}/hero-2.webp`, + mimeType: 'video/webm' + }, + { + id: 'kling-2-5', + title: 'Kling 2.5', + provider: 'kling', + src: `${HERO_MEDIA}/hero-3.webm`, + poster: `${HERO_MEDIA}/hero-3.webp`, + mimeType: 'video/webm' + } +] + +export const PROVIDER_ICON: Record = { + gemini: 'icon-mask-[comfy--gemini]', + openai: 'icon-mask-[comfy--openai]', + kling: 'icon-mask-[comfy--kling]', + bytedance: 'icon-mask-[comfy--bytedance]' +} diff --git a/src/platform/cloud/onboarding/onboardingCloudRoutes.test.ts b/src/platform/cloud/onboarding/onboardingCloudRoutes.test.ts index 1aaf1349565..702a0e9e1fd 100644 --- a/src/platform/cloud/onboarding/onboardingCloudRoutes.test.ts +++ b/src/platform/cloud/onboarding/onboardingCloudRoutes.test.ts @@ -17,6 +17,34 @@ vi.mock('@/platform/auth/session/useSessionCookie', () => ({ useSessionCookie: () => ({ createSessionOrThrow }) })) +const oauthLayout = cloudOnboardingRoutes.find((r) => r.path === '/oauth') +const consentRoute = oauthLayout?.children?.find( + (c) => c.name === 'cloud-oauth-consent' +) +const layoutLoader = oauthLayout?.component +const consentLoader = consentRoute?.component + +/** + * Resolved here rather than inside the test. + * + * These are the real loaders, so calling them compiles `OAuthLayoutView.vue`, + * `OAuthConsentView.vue` and everything they import — seconds of work even on + * an idle machine. Awaited inside a test body that time is billed against the + * 5 s test timeout, which is what made this test fail under a loaded worker + * pool while passing in isolation (#14666). At module scope it is collection + * cost, which nothing times out, and the test itself becomes synchronous. + * + * The loaders are still the ones the router will call: a route pointing at a + * module that does not exist still fails here, at import time. + */ +const resolvedComponents = await Promise.all( + [layoutLoader, consentLoader].map(async (loader) => + typeof loader === 'function' + ? await (loader as () => Promise)() + : undefined + ) +) + describe('cloudOnboardingRoutes', () => { it('consent route is not a child of the /cloud layout', () => { const cloudLayout = cloudOnboardingRoutes.find((r) => r.path === '/cloud') @@ -25,34 +53,30 @@ describe('cloudOnboardingRoutes', () => { }) it('consent route lives under a standalone /oauth layout', () => { - const oauthLayout = cloudOnboardingRoutes.find((r) => r.path === '/oauth') - const consentRoute = oauthLayout?.children?.find( - (c) => c.name === 'cloud-oauth-consent' - ) expect(consentRoute).toBeDefined() expect(consentRoute?.path).toBe('consent') }) - it('consent route carries no requiresAuth meta', () => { - const oauthLayout = cloudOnboardingRoutes.find((r) => r.path === '/oauth') - const consentRoute = oauthLayout?.children?.find( - (c) => c.name === 'cloud-oauth-consent' + it('forgot-password keeps the footer its terms and help links live in', () => { + const cloudLayout = cloudOnboardingRoutes.find((r) => r.path === '/cloud') + const forgotPassword = cloudLayout?.children?.find( + (c) => c.name === 'cloud-forgot-password' ) + + expect(forgotPassword).toBeDefined() + expect(forgotPassword?.meta?.hideFooter).toBeFalsy() + expect(forgotPassword?.meta?.showTermsNotice).toBeFalsy() + }) + + it('consent route carries no requiresAuth meta', () => { expect(consentRoute?.meta?.requiresAuth).toBeFalsy() }) - it('lazily resolves the /oauth layout and consent view components', async () => { - const oauthLayout = cloudOnboardingRoutes.find((r) => r.path === '/oauth') - const consentRoute = oauthLayout?.children?.find( - (c) => c.name === 'cloud-oauth-consent' - ) - const layoutLoader = oauthLayout?.component - const consentLoader = consentRoute?.component + it('lazily resolves the /oauth layout and consent view components', () => { expect(typeof layoutLoader).toBe('function') expect(typeof consentLoader).toBe('function') - const layoutModule = await (layoutLoader as () => Promise)() - const consentModule = await (consentLoader as () => Promise)() + const [layoutModule, consentModule] = resolvedComponents expect(layoutModule).toHaveProperty('default') expect(consentModule).toHaveProperty('default') }) diff --git a/src/platform/cloud/onboarding/onboardingCloudRoutes.ts b/src/platform/cloud/onboarding/onboardingCloudRoutes.ts index 2dda8e45c9a..dbee2617a80 100644 --- a/src/platform/cloud/onboarding/onboardingCloudRoutes.ts +++ b/src/platform/cloud/onboarding/onboardingCloudRoutes.ts @@ -54,6 +54,7 @@ export const cloudOnboardingRoutes: RouteRecordRaw[] = [ name: 'cloud-login', component: () => import('@/platform/cloud/onboarding/CloudLoginView.vue'), + meta: { showTermsNotice: true }, beforeEnter: async (to, _from, next) => { if (!to.query.switchAccount) { const { useCurrentUser } = @@ -72,6 +73,7 @@ export const cloudOnboardingRoutes: RouteRecordRaw[] = [ name: 'cloud-signup', component: () => import('@/platform/cloud/onboarding/CloudSignupView.vue'), + meta: { showTermsNotice: true }, beforeEnter: async (to, _from, next) => { if (!to.query.switchAccount) { const { useCurrentUser } = diff --git a/src/platform/cloud/subscription/billingPolicyCapabilities.test.ts b/src/platform/cloud/subscription/billingPolicyCapabilities.test.ts new file mode 100644 index 00000000000..bfa043ac38a --- /dev/null +++ b/src/platform/cloud/subscription/billingPolicyCapabilities.test.ts @@ -0,0 +1,73 @@ +import { describe, expect, it } from 'vitest' + +import { getBillingPolicyCapabilities } from './billingPolicyCapabilities' +import type { BillingPolicyState } from './billingPolicyState' + +describe('getBillingPolicyCapabilities', () => { + it.for< + [ + BillingPolicyState['kind'], + ReturnType + ] + >([ + [ + 'LocalWithoutActiveSubscription', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + [ + 'LocalTeamWithoutActiveSubscription', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + [ + 'LocalAndUnknown', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + ['LocalAndFree', { topUpAccess: 'allowed', showsSubscribeUpsellUI: false }], + [ + 'LocalAndStandard', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + [ + 'LocalAndCreator', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + ['LocalAndPro', { topUpAccess: 'allowed', showsSubscribeUpsellUI: false }], + [ + 'LocalAndFounders', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + ['LocalAndTeam', { topUpAccess: 'allowed', showsSubscribeUpsellUI: false }], + [ + 'CloudWithoutActiveSubscription', + { topUpAccess: 'subscription-required', showsSubscribeUpsellUI: true } + ], + [ + 'CloudTeamWithoutActiveSubscription', + { topUpAccess: 'subscription-required', showsSubscribeUpsellUI: false } + ], + [ + 'CloudAndUnknown', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + [ + 'CloudAndFree', + { topUpAccess: 'subscription-required', showsSubscribeUpsellUI: true } + ], + [ + 'CloudAndStandard', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + [ + 'CloudAndCreator', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + ['CloudAndPro', { topUpAccess: 'allowed', showsSubscribeUpsellUI: false }], + [ + 'CloudAndFounders', + { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + ], + ['CloudAndTeam', { topUpAccess: 'allowed', showsSubscribeUpsellUI: false }] + ])('maps %s to %o', ([kind, expected]) => { + expect(getBillingPolicyCapabilities({ kind })).toEqual(expected) + }) +}) diff --git a/src/platform/cloud/subscription/billingPolicyCapabilities.ts b/src/platform/cloud/subscription/billingPolicyCapabilities.ts new file mode 100644 index 00000000000..a2989b49960 --- /dev/null +++ b/src/platform/cloud/subscription/billingPolicyCapabilities.ts @@ -0,0 +1,65 @@ +import type { BillingPolicyState } from './billingPolicyState' + +export interface BillingPolicyCapabilities { + topUpAccess: 'allowed' | 'subscription-required' + /** Should render Cloud subscribe/upgrade upsell CTAs. */ + showsSubscribeUpsellUI: boolean +} + +/** + * Every `BillingPolicyState` case is mapped by hand: no + * shared default, no derived/computed fields. Each row is independently + * correct and auditable, and adding a new state is a compile + * error here until it gets its own row. + */ +export function getBillingPolicyCapabilities( + state: BillingPolicyState +): BillingPolicyCapabilities { + switch (state.kind) { + case 'LocalWithoutActiveSubscription': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalTeamWithoutActiveSubscription': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndUnknown': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndFree': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndStandard': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndCreator': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndPro': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndFounders': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'LocalAndTeam': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'CloudWithoutActiveSubscription': + return { + topUpAccess: 'subscription-required', + showsSubscribeUpsellUI: true + } + case 'CloudTeamWithoutActiveSubscription': + return { + topUpAccess: 'subscription-required', + showsSubscribeUpsellUI: false + } + case 'CloudAndUnknown': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'CloudAndFree': + return { + topUpAccess: 'subscription-required', + showsSubscribeUpsellUI: true + } + case 'CloudAndStandard': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'CloudAndCreator': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'CloudAndPro': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'CloudAndFounders': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + case 'CloudAndTeam': + return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } + } +} diff --git a/src/platform/cloud/subscription/billingPolicyState.ts b/src/platform/cloud/subscription/billingPolicyState.ts new file mode 100644 index 00000000000..436473f6337 --- /dev/null +++ b/src/platform/cloud/subscription/billingPolicyState.ts @@ -0,0 +1,19 @@ +export type BillingPolicyState = + | { kind: 'LocalWithoutActiveSubscription' } + | { kind: 'LocalTeamWithoutActiveSubscription' } + | { kind: 'LocalAndUnknown' } + | { kind: 'LocalAndFree' } + | { kind: 'LocalAndStandard' } + | { kind: 'LocalAndCreator' } + | { kind: 'LocalAndPro' } + | { kind: 'LocalAndFounders' } + | { kind: 'LocalAndTeam' } + | { kind: 'CloudWithoutActiveSubscription' } + | { kind: 'CloudTeamWithoutActiveSubscription' } + | { kind: 'CloudAndUnknown' } + | { kind: 'CloudAndFree' } + | { kind: 'CloudAndStandard' } + | { kind: 'CloudAndCreator' } + | { kind: 'CloudAndPro' } + | { kind: 'CloudAndFounders' } + | { kind: 'CloudAndTeam' } diff --git a/src/platform/cloud/subscription/components/CreditSlider.stories.ts b/src/platform/cloud/subscription/components/CreditSlider.stories.ts deleted file mode 100644 index eafbb09d4cb..00000000000 --- a/src/platform/cloud/subscription/components/CreditSlider.stories.ts +++ /dev/null @@ -1,110 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/vue3-vite' -import { ref } from 'vue' - -import CreditSlider from './CreditSlider.vue' - -const meta: Meta = { - title: 'Platform/Subscription/CreditSlider', - component: CreditSlider, - tags: ['autodocs'], - parameters: { layout: 'centered' }, - argTypes: { - disabled: { control: 'boolean' } - }, - args: { - disabled: false - }, - decorators: [ - (story) => ({ - components: { story }, - // Previews at the real layout width: the Figma "Team Plan" card column is - // 512px wide with 32px padding (DES-197), i.e. a 448px content area — the - // width the slider actually renders into inside PricingTableWorkspace. - template: '
' - }) - ] -} - -export default meta -type Story = StoryObj - -export const Default: Story = { - render: (args) => ({ - components: { CreditSlider }, - setup() { - const value = ref(700) - return { args, value } - }, - template: '' - }) -} - -export const Disabled: Story = { - args: { disabled: true }, - render: (args) => ({ - components: { CreditSlider }, - setup() { - const value = ref(700) - return { args, value } - }, - template: '' - }) -} - -// Sample `GET /api/billing/plans → team_credit_stops` payload (DES-197 yearly). -// In production this comes from the API; here it shows the stops being driven -// entirely through props rather than the hardcoded default constant. -const apiTeamCreditStops = { - default_stop_index: 2, - stops: [ - { - id: 'team_200', - credits: 42_200, - yearly: { price_cents: 20_000, discount_percent: 0 } - }, - { - id: 'team_400', - credits: 84_400, - yearly: { price_cents: 38_000, discount_percent: 5 } - }, - { - id: 'team_700', - credits: 147_700, - yearly: { price_cents: 63_000, discount_percent: 10 } - }, - { - id: 'team_1400', - credits: 295_400, - yearly: { price_cents: 119_000, discount_percent: 15 } - }, - { - id: 'team_2500', - credits: 527_500, - yearly: { price_cents: 200_000, discount_percent: 20 } - } - ] -} - -// Reference adapter (FE-934 will own this in the data layer): API → CreditStop[]. -// The pre-discount list price is recovered as discounted / (1 - discount). -const mappedStops = apiTeamCreditStops.stops.map((s) => ({ - credits: s.credits, - discountPercentYearly: s.yearly.discount_percent, - usd: Math.round( - s.yearly.price_cents / 100 / (1 - s.yearly.discount_percent / 100) - ) -})) - -export const BackendDrivenStops: Story = { - name: 'Backend-driven stops (props)', - render: (args) => ({ - components: { CreditSlider }, - setup() { - const defaultStopIndex = apiTeamCreditStops.default_stop_index - const value = ref(mappedStops[defaultStopIndex].usd) - return { args, value, mappedStops, defaultStopIndex } - }, - template: - '' - }) -} diff --git a/src/platform/cloud/subscription/components/CreditSlider.test.ts b/src/platform/cloud/subscription/components/CreditSlider.test.ts deleted file mode 100644 index f4ecc2427c5..00000000000 --- a/src/platform/cloud/subscription/components/CreditSlider.test.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { render, screen, within } from '@testing-library/vue' -import userEvent from '@testing-library/user-event' -import { describe, expect, it, vi } from 'vitest' -import { nextTick } from 'vue' -import { createI18n } from 'vue-i18n' - -import { usdToCredits } from '@/base/credits/comfyCredits' -import { TEAM_PLAN_CREDIT_STOPS } from '@/platform/cloud/subscription/constants/teamPlanCreditStops' - -import CreditSlider from './CreditSlider.vue' - -const i18n = createI18n({ - legacy: false, - locale: 'en', - messages: { - en: { - subscription: { - usdPerMonth: 'USD / mo', - billedYearly: '{total} Billed yearly', - creditSliderSave: 'Save {percent}% ({amount})' - } - } - } -}) - -function renderSlider(props: Record = {}) { - return render(CreditSlider, { props, global: { plugins: [i18n] } }) -} - -async function flush() { - await nextTick() - await nextTick() -} - -describe('CreditSlider', () => { - it('defaults to the $700 stop (index 2) when no value is bound', async () => { - renderSlider() - await flush() - - const thumb = screen.getByRole('slider') - expect(thumb).toHaveAttribute('aria-valuemin', '0') - expect(thumb).toHaveAttribute('aria-valuemax', '4') - expect(thumb).toHaveAttribute('aria-valuenow', '2') - }) - - it('snaps to the next fixed stop on ArrowRight (never a value in between)', async () => { - const user = userEvent.setup() - const onUpdate = vi.fn<(usd: number) => void>() - - renderSlider({ modelValue: 700, 'onUpdate:modelValue': onUpdate }) - await flush() - - screen.getByRole('slider').focus() - await user.keyboard('{ArrowRight}') - - expect(onUpdate).toHaveBeenCalledWith(1400) - }) - - it('snaps to the previous fixed stop on ArrowLeft', async () => { - const user = userEvent.setup() - const onUpdate = vi.fn<(usd: number) => void>() - - renderSlider({ modelValue: 700, 'onUpdate:modelValue': onUpdate }) - await flush() - - screen.getByRole('slider').focus() - await user.keyboard('{ArrowLeft}') - - expect(onUpdate).toHaveBeenCalledWith(400) - }) - - it('emits change with the full {index, usd, credits} payload', async () => { - const user = userEvent.setup() - const onChange = vi.fn() - - renderSlider({ modelValue: 700, onChange }) - await flush() - - screen.getByRole('slider').focus() - await user.keyboard('{ArrowRight}') - - expect(onChange).toHaveBeenCalledWith({ - index: 3, - usd: 1400, - credits: 295_400 - }) - }) - - it('emits nothing when disabled (keyboard interaction suppressed)', async () => { - const user = userEvent.setup() - const onUpdate = vi.fn<(usd: number) => void>() - const onChange = vi.fn() - - renderSlider({ - modelValue: 700, - disabled: true, - 'onUpdate:modelValue': onUpdate, - onChange - }) - await flush() - - screen.getByRole('slider').focus() - await user.keyboard('{ArrowRight}') - - expect(onUpdate).not.toHaveBeenCalled() - expect(onChange).not.toHaveBeenCalled() - }) - - it('shows the discounted price, struck original, save badge and yearly total (DES-197)', async () => { - renderSlider() // default $700 stop → 10% yearly discount - await flush() - - expect(screen.getByTestId('credit-slider-price')).toHaveTextContent('$630') - expect( - screen.getByTestId('credit-slider-original-price') - ).toHaveTextContent('$700') - expect(screen.getByTestId('credit-slider-save')).toHaveTextContent( - 'Save 10% ($70)' - ) - expect(screen.getByTestId('credit-slider-billed-yearly')).toHaveTextContent( - '$7,560' - ) - }) - - it('hides the discount UI at the 0% stop ($200)', async () => { - renderSlider({ modelValue: 200 }) - await flush() - - expect(screen.getByTestId('credit-slider-price')).toHaveTextContent('$200') - expect( - screen.queryByTestId('credit-slider-original-price') - ).not.toBeInTheDocument() - expect(screen.queryByTestId('credit-slider-save')).not.toBeInTheDocument() - }) - - it('renders all five fixed credit stop labels', async () => { - renderSlider({ modelValue: 700 }) - await flush() - - const stops = within(screen.getByTestId('credit-slider-stops')) - for (const label of ['42.2K', '84.4K', '147.7K', '295.4K', '527.5K']) { - expect(stops.getByText(label)).toBeInTheDocument() - } - }) - - it('renders nothing when stops is empty (defensive for BE-sourced data)', async () => { - renderSlider({ stops: [] }) - await flush() - - expect(screen.queryByRole('slider')).not.toBeInTheDocument() - expect(screen.queryByTestId('credit-slider-price')).not.toBeInTheDocument() - }) - - it('renders stops + default index supplied via props (BE-sourced override)', async () => { - const stops = [ - { usd: 50, credits: 10_550, discountPercentYearly: 0 }, - { usd: 100, credits: 21_100, discountPercentYearly: 25 } - ] - // No modelValue → the model default ($700) matches no stop, so selectedIndex - // falls back to defaultStopIndex (here index 1 → $100). - renderSlider({ stops, defaultStopIndex: 1 }) - await flush() - - const thumb = screen.getByRole('slider') - expect(thumb).toHaveAttribute('aria-valuemax', '1') // 2 stops → max index 1 - expect(thumb).toHaveAttribute('aria-valuenow', '1') // default index honored - - // index 1 → $100 at 25% yearly → $75 discounted, struck $100, save $25 - expect(screen.getByTestId('credit-slider-price')).toHaveTextContent('$75') - expect( - screen.getByTestId('credit-slider-original-price') - ).toHaveTextContent('$100') - expect(screen.getByTestId('credit-slider-save')).toHaveTextContent( - 'Save 25% ($25)' - ) - - // Only the prop's labels render — none of the DES-197 defaults. - const labels = within(screen.getByTestId('credit-slider-stops')) - expect(labels.getByText('10.6K')).toBeInTheDocument() - expect(labels.getByText('21.1K')).toBeInTheDocument() - expect(labels.queryByText('147.7K')).not.toBeInTheDocument() - }) - - it('keeps every credit amount equal to usdToCredits(usd) (guards rate drift)', () => { - for (const stop of TEAM_PLAN_CREDIT_STOPS) { - expect(stop.credits).toBe(usdToCredits(stop.usd)) - } - }) -}) diff --git a/src/platform/cloud/subscription/components/CreditSlider.vue b/src/platform/cloud/subscription/components/CreditSlider.vue deleted file mode 100644 index 2854ece9400..00000000000 --- a/src/platform/cloud/subscription/components/CreditSlider.vue +++ /dev/null @@ -1,228 +0,0 @@ - - - diff --git a/src/platform/cloud/subscription/components/CreditsTile.test.ts b/src/platform/cloud/subscription/components/CreditsTile.test.ts index c7f8957c9c7..371533030a9 100644 --- a/src/platform/cloud/subscription/components/CreditsTile.test.ts +++ b/src/platform/cloud/subscription/components/CreditsTile.test.ts @@ -6,7 +6,7 @@ import { createI18n } from 'vue-i18n' import type { BalanceInfo, SubscriptionInfo } from '@/composables/billing/types' import CreditsTile from '@/platform/cloud/subscription/components/CreditsTile.vue' -import type { CurrentTeamCreditStop } from '@/platform/workspace/api/workspaceApi' +import type { TeamCreditStopSummary } from '@/platform/workspace/api/workspaceApi' type Balance = Pick< BalanceInfo, @@ -15,13 +15,15 @@ type Balance = Pick< type Subscription = Pick & { tier: SubscriptionInfo['tier'] | 'TEAM' } -type TeamStop = CurrentTeamCreditStop +type TeamStop = TeamCreditStopSummary const state = vi.hoisted(() => ({ balance: null as Balance | null, subscription: null as Subscription | null, canAccessSubscriptionFeatures: false, isFreeTier: false, + isTeamPlan: false, + tier: null as SubscriptionInfo['tier'], currentTeamCreditStop: null as TeamStop | null, isLoading: false, canTopUp: true, @@ -58,6 +60,8 @@ vi.mock('@/composables/billing/useBillingContext', () => ({ () => state.canAccessSubscriptionFeatures ), isFreeTier: computed(() => state.isFreeTier), + isTeamPlan: computed(() => state.isTeamPlan), + tier: computed(() => state.tier), currentTeamCreditStop: computed(() => state.currentTeamCreditStop), isLoading: computed(() => state.isLoading), type: computed(() => state.type), @@ -155,6 +159,7 @@ function renderTile(props: Record = {}) { function activeProSubscription() { state.canAccessSubscriptionFeatures = true + state.tier = 'PRO' state.subscription = { tier: 'PRO', duration: 'MONTHLY', @@ -174,6 +179,8 @@ describe('CreditsTile', () => { state.subscription = null state.canAccessSubscriptionFeatures = false state.isFreeTier = false + state.isTeamPlan = false + state.tier = null state.currentTeamCreditStop = null state.isLoading = false state.canTopUp = true @@ -392,7 +399,7 @@ describe('CreditsTile', () => { it('offers the upgrade path instead of add-credits on the free tier', async () => { activeProSubscription() - state.isFreeTier = true + state.tier = 'FREE' renderTile() expect(screen.queryByText('Add credits')).toBeNull() await userEvent.click(screen.getByText('Upgrade to add credits')) @@ -402,7 +409,7 @@ describe('CreditsTile', () => { it('keeps offering add-credits on the free tier for non-cloud distributions', () => { mockIsCloud.value = false activeProSubscription() - state.isFreeTier = true + state.tier = 'FREE' renderTile() expect(screen.queryByText('Upgrade to add credits')).toBeNull() expect(screen.getByText('Add credits')).toBeInTheDocument() diff --git a/src/platform/cloud/subscription/components/CreditsTile.vue b/src/platform/cloud/subscription/components/CreditsTile.vue index f22154c03d0..6e6b27bc172 100644 --- a/src/platform/cloud/subscription/components/CreditsTile.vue +++ b/src/platform/cloud/subscription/components/CreditsTile.vue @@ -188,7 +188,7 @@