-
Notifications
You must be signed in to change notification settings - Fork 400
Restructure addon detail page header #13638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
10278aa
to
7ceb5c8
Compare
db7ae51
to
6fe7f25
Compare
6fe7f25
to
afff8d0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13638 +/- ##
==========================================
- Coverage 98.29% 98.27% -0.03%
==========================================
Files 268 266 -2
Lines 10663 10638 -25
Branches 3280 3252 -28
==========================================
- Hits 10481 10454 -27
- Misses 169 171 +2
Partials 13 13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
239da69
to
f20b4ba
Compare
…component. Update styles and adjust related components accordingly.
f20b4ba
to
db93824
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Restructure the addon detail page header by unifying badge components, extracting promoted badge logic, and adding a rating badge.
- Introduce
src/amo/utils/promoted.js
and removegetPromotedBadgesLinkUrl
from the main utils. - Merge
PromotedBadge
into the new universalBadge
component (withBadgeIcon
/BadgeContent
) and update all usages and tests. - Refactor
AddonBadges
and page layout to include the new rating badge, removeAddonMeta
, and adjust header styles.
Reviewed Changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/amo/utils/promoted.js | New file housing promoted badge URL and props helpers |
src/amo/components/Badge/index.js | Universal Badge component with new API and test IDs |
src/amo/components/AddonBadges/index.js | Refactored badge renderer, added rating badge, removed AddonMeta |
src/blog-utils/index.js | Added createBrowserHistory and addQueryParamsToHistory integration |
src/amo/utils/index.js | Removed getPromotedBadgesLinkUrl export from general utils |
Comments suppressed due to low confidence (2)
src/blog-utils/index.js:16
- The function
addQueryParamsToHistory
isn't exported bysrc/amo/utils/index.js
. Either re-export it there or import it from its actual module (e.g.,amo/utils/url
).
import { addQueryParamsToHistory } from 'amo/utils';
src/amo/components/AddonBadges/index.js:133
- The
type
prop'star-full'
is not included in theBadgeType
union definition, which may lead to Flow type errors. Consider adding'star-full'
toBadgeType
or using an existing type.
<Badge link={reviewsLink} type="star-full" label={reviewsLabel}>
@eviljeff PR is stable and ready to verify |
Fixes #15626
Description
This PR:
Context
Given we now have multiple use cases for pilled/linked badges and to make the code more reusable, I've merged the Promotedbadge to the badge component. Now a badge is a badge and you can make it pilled, linkable small/large etc in any context. You can also easily control what UI is renedered due to the compound component API.
Testing
Screen.Recording.2025-06-20.at.17.56.46.mov
Badges are rendered in 4 locations. You'll want to test all breakpoints for all 4 locations.
Search Results
Search for "promoted" you will get promoted results for sure on dev.
Addon Header
Click on an addon that is promoted or has reviews. Verify on correct and incorrect and non-android to get all combination of badges.
Bonus points, check an addon that has multiple promoted groups and make sure you still only see one.
More Addons
Addon section suggesting more addons, if promoted should see badge with "small" variant of icon/text
Search Suggest
When typing in the search box on the right you will see the badge icon (only icon)