diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8375053 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + + - name: Publish to ComfyUI Registry + run: | + pip install comfy-cli + comfy node publish --token ${{ secrets.COMFY_API_KEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 801ca2f..4f8ea32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +### v0.3.2 +- Keyboard shortcut to open the Find Nodes panel is now configurable via ComfyUI Settings → AF - Nodes → AF - Find Nodes → Shortcuts +- Set to "Disabled" to turn off the shortcut entirely +- Default remains Ctrl+Shift+F + ### v0.3.1 - Critical Fix - Replaced automatic workflow scanning with manual on-demand scanning. Fixes race conditions, cross-tab contamination, and workflow tab restoration issues. diff --git a/package.json b/package.json index d38fe8f..2a0ee7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "comfyui-af-find-nodes", - "version": "0.3.1", + "version": "0.3.2", "description": "A ComfyUI extension that allows you to find and locate nodes by their ID, title, pack, or type in complex workflows.", "author": "Alex Furer", "license": "MIT", diff --git a/pyproject.toml b/pyproject.toml index 680acfc..7fa081f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-af-find-nodes" description = "A ComfyUI extension that allows you to find and locate nodes by their ID, title, pack, or type in complex workflows." -version = "0.3.1" +version = "0.3.2" license = {file = "LICENSE"} dependencies = [] diff --git a/web/AF_Find_Nodes.js b/web/AF_Find_Nodes.js index 8ec419f..e96044d 100644 --- a/web/AF_Find_Nodes.js +++ b/web/AF_Find_Nodes.js @@ -67,6 +67,9 @@ class AF_Find_Nodes_Widget { this.autoBackupEnabled = localStorage.getItem('af-find-node-auto-backup') !== 'false'; this.collapsedPacks = new Set(); this.collapsedStatsPacks = new Set(); // Track collapsed packs in Stats tab + + // Keyboard shortcut - read from ComfyUI settings, fallback to default + this.keyboardShortcut = app.extensionManager?.setting.get("AF.FindNodes.keyboardShortcut") ?? "Ctrl+Shift+F"; } @@ -2367,10 +2370,22 @@ class AF_Find_Nodes_Widget { // Keyboard shortcut handler AF_Find_Nodes_HandleKeyboard(event) { - // Ctrl+Shift+F to toggle search panel - if (event.ctrlKey && event.shiftKey && event.code === 'KeyF') { - event.preventDefault(); - this.AF_Find_Nodes_TogglePanel(); + // Dynamic shortcut from ComfyUI settings + const shortcut = this.keyboardShortcut; + if (shortcut && shortcut !== "Disabled") { + const parts = shortcut.split('+').map(p => p.trim()); + const key = parts[parts.length - 1].toUpperCase(); + const needsCtrl = parts.some(p => p.toLowerCase() === 'ctrl'); + const needsAlt = parts.some(p => p.toLowerCase() === 'alt'); + const needsShift = parts.some(p => p.toLowerCase() === 'shift'); + + if (event.key.toUpperCase() === key && + event.ctrlKey === needsCtrl && + event.altKey === needsAlt && + event.shiftKey === needsShift) { + event.preventDefault(); + this.AF_Find_Nodes_TogglePanel(); + } } // Escape to close panel if (event.code === 'Escape' && this.isVisible) { @@ -2425,11 +2440,31 @@ window.AF_Find_Nodes_Widget = new AF_Find_Nodes_Widget(); app.registerExtension({ name: "AF-Find-Nodes", + settings: [ + { + id: "AF.FindNodes.keyboardShortcut", + name: "Keyboard shortcut to open Find Nodes panel (e.g. Ctrl+Shift+F, Ctrl+G, Disabled)", + type: "text", + defaultValue: "Ctrl+Shift+F", + category: ["AF - Nodes", "AF - Find Nodes", "Shortcuts"], + tooltip: "Key combo to toggle the Find Nodes panel. Use modifier+key format. Set to 'Disabled' to turn off.", + onChange: (value) => { + if (window.AF_Find_Nodes_Widget) { + window.AF_Find_Nodes_Widget.keyboardShortcut = value; + } + } + } + ], + async beforeRegisterNodeDef(nodeType, nodeData, app) { // We don't need to modify node definitions }, async setup() { + // Read shortcut from ComfyUI settings (may now be available) + window.AF_Find_Nodes_Widget.keyboardShortcut = + app.extensionManager?.setting.get("AF.FindNodes.keyboardShortcut") ?? "Ctrl+Shift+F"; + // Add keyboard event listeners document.addEventListener('keydown', (e) => { window.AF_Find_Nodes_Widget.AF_Find_Nodes_HandleKeyboard(e);