fix(devtools): render the shared packages badge count once - #4970
Open
dmchoi77 wants to merge 1 commit into
Open
fix(devtools): render the shared packages badge count once#4970dmchoi77 wants to merge 1 commit into
dmchoi77 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 333fad2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 47 packages
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 |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
Description
The packages badge in the Shared Dependencies overview renders its count twice, so a scope holding a single shared package is displayed as "11 packages".
SharedDepsExplorerprintsstats.totalPackagesand then calls thepackagesBadgetranslation, which already interpolates the same value through{{count}}:So the badge renders
1+1 packages. Any count is affected — 33 packages reads as "3333 packages".This PR drops the extra JSX expression and lets the translation carry the count. The opposite fix (removing
{{count}}from the translations) is not viable: the zh-CN string places the number before the classifier, so the count has to stay inside the translation for the word order to hold.The other stat cards in the same row (
totalProviders,totalScopes,totalVersions,loadedCount,reusedCount) render their value and label separately and are unaffected.Related Issue
No existing issue — filing the context here instead.
This is a regression from #4305 (
feat: devtools support dark mode, 813923c). That PR moved the hardcodedpackageslabel into i18n but kept the JSX count:Before #4305 the badge rendered
{stats.totalPackages} packages, which is what this change restores.Types of changes
Checklist