Merge feature/hide-improvements into master
This commit is contained in:
@@ -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</button>
|
||||
<button onclick={() => {
|
||||
const nd = $nodes.find(n => n.id === nodeContextMenu!.nodeId);
|
||||
if (nd) addHideRule(displayName(nd));
|
||||
nodeContextMenu = null;
|
||||
}}>Hide</button>
|
||||
<button onclick={() => {
|
||||
fetch('/api/destroy-node', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user