Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gray out non-matches when searching #554

Merged
merged 3 commits into from Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions client/components/Treemap.jsx
Expand Up @@ -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());
}
}

Expand Down Expand Up @@ -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;
}
},
/**
Expand Down