fix(settings-hook): list-items --owned-by with --command-regex intersects

When both filters are given, an item must satisfy both: owned by the
requested source AND matching the pattern. Before, the regex branch
skipped every owned row, so the combination could never match.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-09 02:50:32 +00:00
co-authored by Claude Fable 5.1
parent 61edb13c98
commit 614e238a24
+5 -1
View File
@@ -886,7 +886,11 @@ case "$ACTION" in
if (!cmd) continue;
const row = gsOwnedRow(cmd, event, entry.matcher || "");
if (ownedBy && (!row || row.source !== ownedBy)) continue;
if (re && (row || !re.test(cmd))) continue; // the regex only ever sees items no table row owns
// Alone, the regex only ever sees items no table row owns (the
// vendor-own probe). Combined with --owned-by it narrows THAT set:
// filters intersect, a regex never widens a selection.
if (re && !ownedBy && row) continue;
if (re && !re.test(cmd)) continue;
console.log(JSON.stringify(cmd));
}
}