Skip to content

fix(client): apply selected units to bundle size filters - #2075

Merged
yifancong merged 1 commit into
web-infra-dev:mainfrom
dvd233:codex/fix-size-filter-units
Oct 9, 2026
Merged

yifancong merged 1 commit into
web-infra-dev:mainfrom
dvd233:codex/fix-size-filter-units

Conversation

@dvd233

@dvd233 dvd233 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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 MB keeps 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:

  • Built the unchanged baseline before editing and reproduced all six scenarios through the report UI.
  • Client production build and its dependencies passed.
  • All 74 existing client tests passed.
  • All six new browser regressions passed using the existing Rstest/Playwright runner and local Chrome.
  • Full rs check --type-check passed: 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 --check passed.

AI assistance was used for diagnosis, implementation, and testing.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yifancong
yifancong merged commit 975f963 into web-infra-dev:main Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants