Skip to content

Commit f959f9c

Browse files
starpitvalscion
andauthored
feat: gray out non-matches when searching (#554)
* feat: gray out non-matches when searching This PR reduces the saturation (from 60 to 10) for non-matches. Fixes #553 * Add changelog entry --------- Co-authored-by: Vesa Laakso <[email protected]>
1 parent e231c77 commit f959f9c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1414

1515
* **Improvement**
1616
* Support reading large (>500MB) stats.json files ([#423](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/423) by [@henry-alakazhang](https://github.com/henry-alakazhang))
17+
* Improve search UX by graying out non-matches ([#554](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/554) by [@starpit](https://github.com/starpit))
1718

1819
## 4.7.0
1920

client/components/Treemap.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ export default class Treemap extends Component {
2222
dataObject: this.getTreemapDataObject(nextProps.data)
2323
});
2424
} else if (nextProps.highlightGroups !== this.props.highlightGroups) {
25-
const groupsToRedraw = [
26-
...nextProps.highlightGroups,
27-
...this.props.highlightGroups
28-
];
29-
setTimeout(() => this.treemap.redraw(false, groupsToRedraw));
25+
setTimeout(() => this.treemap.redraw());
3026
}
3127
}
3228

@@ -102,6 +98,11 @@ export default class Treemap extends Component {
10298
b: 0,
10399
a: 0.8
104100
};
101+
} else if (highlightGroups && highlightGroups.size > 0) {
102+
// this means a search (e.g.) is active, but this module
103+
// does not match; gray it out
104+
// https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/553
105+
variables.groupColor.s = 10;
105106
}
106107
},
107108
/**

0 commit comments

Comments
 (0)