webpack-contrib / webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
MIT License
12.53k stars 479 forks source link

Search should gray out non-matches? #553

Closed starpit closed 1 year ago

starpit commented 1 year ago

Issue description

When searching for bundles, the current scheme seems to be to show the matches in red transparent overlay, but leave all of the rest of the colors the same. This makes it fairly hard to see what bundles matched: 1) lots of colors, some quite close to red (e.g. dark magenta); 2) since the match overlay has a transparency, this causes the matches to be even closer to the almost-reds; 3) if there are lots of small matches (which add up), this doesn't jump out.

Suggestion: gray out the non-matches?

without search:

without search

with search string "monaco":

with search

Technical info

  System:
    OS: macOS 13.2
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 14.75 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.19.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.19.3 - /usr/local/bin/npm

Debug info

How do you use this module? As CLI utility or as plugin?

As a webpack plugin.

If CLI, what command was used? (e.g. webpack-bundle-analyzer -O path/to/stats.json)

If plugin, what options were provided? (e.g. new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true }))

No options.

What other Webpack plugins were used?

It would be nice to also attach webpack stats file. It can be generated using these options:

new BundleAnalyzerPlugin({
  analyzerMode: 'disabled',
  generateStatsFile: true,
  // Excludes module sources from stats file so there won't be any sensitive data
  statsOptions: { source: false }
})

stats.json will be created in Webpack bundle output directory.

valscion commented 1 year ago

That would be nice! Would you be open to try to craft such a pull request so we could see how that would look like in practice?