fix: update treemap when chunk selection changes#722
Conversation
🦋 Changeset detectedLatest commit: 87c6b51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
72117ed to
9feec7a
Compare
9feec7a to
10d178b
Compare
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the client UI where changing chunk checkbox selections did not update the treemap because the chunk-selection handler called the wrong store action. Adds a browser-level regression test to validate the treemap’s data updates when a chunk is deselected, and includes a patch changeset.
Changes:
- Fix
ModulesTreemap.handleSelectedChunksChangeto callstore.setSelectedChunks(selectedChunks). - Add a Puppeteer regression test that deselects a chunk and asserts the treemap data no longer includes it.
- Add a patch changeset entry documenting the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| client/components/ModulesTreemap.jsx | Corrects the chunk-selection handler to update selectedChunks (not size). |
| test/analyzer.js | Adds a Puppeteer regression test for treemap updates on chunk deselection. |
| .changeset/fix-chunk-selection.md | Publishes a patch changeset describing the regression fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
ModulesTreemap.handleSelectedChunksChangeto callstore.setSelectedChunksRoot cause
Commit
77599a400605587eb4c27d946a1830060cad7c96moved direct MobX state assignments behind action methods. During that refactor, the chunk-selection handler was changed from assigningstore.selectedChunksto callingstore.setSelectedSize(selectedChunks)instead ofstore.setSelectedChunks(selectedChunks).CheckboxListtherefore updated its local checkbox state, but the selected chunks in the store remained unchanged. The treemap continued receiving the original chunks rather than a data set filtered to the current checkbox selection.The nearby handlers introduced in the same commit were reviewed: size selection uses
setSelectedSize, search usessetSearchQuery, and entrypoint/context-menu chunk filtering usessetSelectedChunkscorrectly.Regression test
The new Puppeteer test generates a static report containing multiple chunks, opens it in the browser, deselects a real chunk checkbox, and verifies both that the checkbox is unchecked and that the deselected chunk is absent from the data passed to
Treemap. This test fails with the incorrectsetSelectedSize(selectedChunks)call and passes withsetSelectedChunks(selectedChunks).Validation
npm run lintnpm run buildnpm test— 8 suites passed, 129 tests passed, 4 skipped