From 31d8191672c7ea9e1aa1566f091212dd2bac9820 Mon Sep 17 00:00:00 2001 From: joren Date: Thu, 2 Apr 2026 18:44:00 +0200 Subject: [PATCH] feat: regex hide rules (full-match) + right-click Hide button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hide rules now use anchored regex (^rule$) so plain text like "Speaker" matches exactly "Speaker", not "Gaming Speaker". To match a substring, use e.g. ".*Speaker.*". Rules that already start with ^ or end with $ are used as-is. - Add "Hide" to node right-click context menu — adds the node's display name as a hide rule immediately Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/GraphCanvas.svelte | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/GraphCanvas.svelte b/frontend/src/components/GraphCanvas.svelte index 1ffc482..114cf19 100644 --- a/frontend/src/components/GraphCanvas.svelte +++ b/frontend/src/components/GraphCanvas.svelte @@ -114,9 +114,15 @@ } function isNodeHidden(nd: { name: string; nick: string }): boolean { - const dn = displayName(nd).toLowerCase(); + const dn = displayName(nd); for (const rule of $patchbay.hide_rules) { - if (dn === rule.toLowerCase()) return true; + try { + // Anchor to full match unless user already added anchors + const anchored = (rule.startsWith('^') || rule.endsWith('$')) ? rule : `^${rule}$`; + if (new RegExp(anchored, 'i').test(dn)) return true; + } catch { + if (dn.toLowerCase() === rule.toLowerCase()) return true; + } } return false; } @@ -692,6 +698,11 @@ renameInput = $patchbay.aliases?.[nodeContextMenu!.nodeName] ?? ''; nodeContextMenu = null; }}>Rename +