Merge feature/hide-improvements into master

This commit is contained in:
joren
2026-04-02 18:44:03 +02:00

View File

@@ -114,9 +114,15 @@
} }
function isNodeHidden(nd: { name: string; nick: string }): boolean { function isNodeHidden(nd: { name: string; nick: string }): boolean {
const dn = displayName(nd).toLowerCase(); const dn = displayName(nd);
for (const rule of $patchbay.hide_rules) { 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; return false;
} }
@@ -692,6 +698,11 @@
renameInput = $patchbay.aliases?.[nodeContextMenu!.nodeName] ?? ''; renameInput = $patchbay.aliases?.[nodeContextMenu!.nodeName] ?? '';
nodeContextMenu = null; nodeContextMenu = null;
}}>Rename</button> }}>Rename</button>
<button onclick={() => {
const nd = $nodes.find(n => n.id === nodeContextMenu!.nodeId);
if (nd) addHideRule(displayName(nd));
nodeContextMenu = null;
}}>Hide</button>
<button onclick={() => { <button onclick={() => {
fetch('/api/destroy-node', { fetch('/api/destroy-node', {
method: 'POST', method: 'POST',