Repository navigation
fix(client): apply selected units to bundle size filters - #2075
Merged
Merged
Conversation
yifancong
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In Bundle Size's Tree Graph, selecting MB for Asset Size or Module Size still applies a KB threshold. Both debounced handlers capture the initial unit, so a displayed threshold of
1 MBkeeps a roughly 2 KB asset/module. Changing only the unit also leaves the previous byte threshold in effect.Changes
Keep the entered numeric value in state and derive the byte limit from the current unit during rendering. Both filters now update when the unit changes, including when an input debounce is still pending; switching back to KB preserves and reapplies the displayed number.
Added six browser regressions using a real Rspack brief report with small and large assets/modules. They cover selecting the unit before typing, changing the unit after typing, a paused pending debounce, and switching back to KB. The large-module control remains visible above the 1 MB threshold.
Validation on Windows with Node 22.23.2:
rs check --type-checkpassed: lint/type checking for 735 files and formatting for 1018 files. The Windows checkout needed LF normalization to match Git's stored content; no unrelated content or lockfile changes are included.git diff --checkpassed.AI assistance was used for diagnosis, implementation, and testing.