From 0ee0c486da6277f4912a48063cb5c5f55ba89f86 Mon Sep 17 00:00:00 2001 From: Nick Mitchell Date: Mon, 30 Jan 2023 10:55:22 -0500 Subject: [PATCH 1/2] feat: gray out non-matches when searching This PR reduces the saturation (from 60 to 10) for non-matches. Fixes #553 --- client/components/Treemap.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/components/Treemap.jsx b/client/components/Treemap.jsx index d9d46b72..0b67321c 100644 --- a/client/components/Treemap.jsx +++ b/client/components/Treemap.jsx @@ -22,11 +22,7 @@ export default class Treemap extends Component { dataObject: this.getTreemapDataObject(nextProps.data) }); } else if (nextProps.highlightGroups !== this.props.highlightGroups) { - const groupsToRedraw = [ - ...nextProps.highlightGroups, - ...this.props.highlightGroups - ]; - setTimeout(() => this.treemap.redraw(false, groupsToRedraw)); + setTimeout(() => this.treemap.redraw()); } } @@ -102,6 +98,11 @@ export default class Treemap extends Component { b: 0, a: 0.8 }; + } else if (highlightGroups && highlightGroups.size > 0) { + // this means a search (e.g.) is active, but this module + // does not match; gray it out + // https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/553 + variables.groupColor.s = 10; } }, /** From 320ec800ab48a6807c694cee029b0259d0ca94d3 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Mon, 13 Feb 2023 10:13:36 +0200 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36a1efaa..31878535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ * **Improvement** * 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)) + * 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)) ## 4.7.0