feat(workflow): make auto-open on load opt-in; default off
Publish to Comfy registry / Publish Custom Node to registry (push) Has been cancelled
Publish to Comfy registry / Publish Custom Node to registry (push) Has been cancelled
Loading a workflow with missing/disabled nodes no longer pops the Node Stats dialog every time. Gated behind a new ComfyUI setting "Auto-open Node Stats on workflow load" (off by default); the scan still runs so the Workflow tab is accurate when opened manually. Bump to 1.7.2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -24,9 +24,35 @@ const STATUS_META = {
|
||||
// Tiers that may offer a "Disable" action (when ComfyUI Manager is available).
|
||||
const DISABLEABLE_TIERS = new Set(["safe_to_remove", "consider_removing"]);
|
||||
|
||||
// Setting id for the auto-open-on-load behavior. Defaults to off so loading a
|
||||
// workflow with missing/disabled nodes no longer pops the dialog every time.
|
||||
const SETTING_AUTO_OPEN = "comfyui.nodes_stats.autoOpenOnLoad";
|
||||
|
||||
function autoOpenEnabled() {
|
||||
try {
|
||||
const v = app.extensionManager?.setting?.get(SETTING_AUTO_OPEN);
|
||||
if (v !== undefined) return !!v;
|
||||
return !!app.ui?.settings?.getSettingValue?.(SETTING_AUTO_OPEN, false);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "comfyui.nodes_stats",
|
||||
|
||||
settings: [
|
||||
{
|
||||
id: SETTING_AUTO_OPEN,
|
||||
name: "Auto-open Node Stats on workflow load",
|
||||
tooltip:
|
||||
"Pop the Node Stats dialog (Workflow tab) automatically when a loaded workflow has missing or disabled nodes. Off by default — open it manually from the toolbar instead.",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
category: ["Node Stats", "Behavior", "Auto-open on load"],
|
||||
},
|
||||
],
|
||||
|
||||
async setup() {
|
||||
const btn = document.createElement("button");
|
||||
btn.innerHTML = STATS_ICON;
|
||||
@@ -96,6 +122,9 @@ let _lastWorkflowScan = { disabled: [], missing: [] };
|
||||
async function onWorkflowLoaded() {
|
||||
const types = unresolvedNodeTypes();
|
||||
_lastWorkflowScan = await classifyUnresolved(types);
|
||||
// Only auto-open when the user has opted in; the scan is still kept up to date
|
||||
// so the Workflow tab is accurate when opened manually from the toolbar.
|
||||
if (!autoOpenEnabled()) return;
|
||||
if (_lastWorkflowScan.disabled.length || _lastWorkflowScan.missing.length) {
|
||||
showStatsDialog("workflow"); // auto-open on the Workflow tab
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-nodes-stats"
|
||||
description = "Track usage statistics for all ComfyUI nodes and packages"
|
||||
version = "1.7.1"
|
||||
version = "1.7.2"
|
||||
license = "MIT"
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user