diff --git a/tools/winscope/src/TraceView.vue b/tools/winscope/src/TraceView.vue index 594272e9c..a263ea248 100644 --- a/tools/winscope/src/TraceView.vue +++ b/tools/winscope/src/TraceView.vue @@ -437,11 +437,11 @@ function getFilter(filterString) { const negative = []; filterStrings.forEach((f) => { if (f.startsWith('!')) { - const str = f.substring(1); - negative.push((s) => s.indexOf(str) === -1); + const regex = new RegExp(f.substring(1), "i"); + negative.push((s) => !regex.test(s)); } else { - const str = f; - positive.push((s) => s.indexOf(str) !== -1); + const regex = new RegExp(f, "i"); + positive.push((s) => regex.test(s)); } }); const filter = (item) => { diff --git a/tools/winscope/src/TransactionsView.vue b/tools/winscope/src/TransactionsView.vue index 47164d4fe..80b8827ac 100644 --- a/tools/winscope/src/TransactionsView.vue +++ b/tools/winscope/src/TransactionsView.vue @@ -236,10 +236,13 @@ export default { filteredData = filteredData.filter( this.filterTransactions((transaction) => { for (const filter of this.filters) { - if (isNaN(filter) && transaction.layerName?.includes(filter)) { - // If filter isn't a number then check if the transaction's - // target surface's name matches the filter — if so keep it. - return true; + if (isNaN(filter)) { + // If filter isn't a number then check if the transaction's + // target surface's name matches the filter — if so keep it. + const regexFilter = new RegExp(filter, "i"); + if (regexFilter.test(transaction.layerName)) { + return true; + } } if (filter == transaction.obj.id) { // If filteter is a number then check if the filter matches