fix: hide duplicated bash permission pattern

Removes permission patterns already shown as the rendered bash command
Keeps distinct patterns visible in the permission card
Adds tests for the pattern filtering behavior
This commit is contained in:
Bohdan Triapitsyn
2026-07-22 16:40:42 +03:00
parent 63d37eecdf
commit 1ba3807df5
3 changed files with 32 additions and 6 deletions
@@ -0,0 +1,4 @@
export const getVisiblePermissionPatterns = (patterns: string[], renderedCommand: string): string[] => {
if (!renderedCommand) return patterns;
return patterns.filter((pattern) => pattern !== renderedCommand);
};