Podcast: rebuild Stats tiles and bar list on @wordpress/components primitives#48744
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
Pull request overview
Refactors the Podcast dashboard Stats UI to rely more on @wordpress/components layout/typography primitives, reducing bespoke markup and SCSS while keeping the same data/interaction behavior.
Changes:
- Rebuilds summary “metric tiles” using
VStack+__experimentalHeading+__experimentalTextand removes tile-typography SCSS. - Rebuilds horizontal bar list rows using
HStack+Textinstead of a CSS grid-based span layout. - Adds a changelog entry documenting the refactor.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| projects/packages/podcast/src/dashboard/stats/style.scss | Removes eyebrow placeholder + tile typography rules; updates bar list layout hooks for HStack-based rendering. |
| projects/packages/podcast/src/dashboard/stats/components/summary-tiles.tsx | Replaces Card-based summary tiles with components primitives (VStack/Heading/Text). |
| projects/packages/podcast/src/dashboard/stats/components/horizontal-bar-list.tsx | Replaces span grid layout with HStack/Text and adjusts markup for button validity. |
| projects/packages/podcast/changelog/update-podcast-stats-components-refactor | Adds changelog entry for the UI refactor. |
Comments suppressed due to low confidence (1)
projects/packages/podcast/src/dashboard/stats/components/horizontal-bar-list.tsx:63
- The bar
<span>is rendered after the row content, and it’s absolutely positioned. With default stacking/paint order this will typically place the bar visually on top of the text (even if translucent). To ensure the fill is behind the text, render the bar before the HStack content or set explicit z-index values (content higher than bar).
<span
className="podcast-stats-bar-list__bar"
style={ { width: `${ pct }%` } }
aria-hidden="true"
/>
| // HStack wrapper — sits above the bar so the fill renders behind text. | ||
| &__content { | ||
| position: relative; | ||
| } | ||
|
|
|
@copilot apply changes based on the comments in this thread |
Fixed in d73cdba. I applied the follow-up from the review thread by explicitly stacking the row content above the absolute bar fill so the tint stays behind the text. Screenshot: N/A — this is a non-visual layering fix to preserve the existing appearance while preventing the bar from painting over the labels. |
5b9a4c5 to
cc6d83c
Compare
…imitives Summary tiles now compose VStack + __experimentalHeading + __experimentalText instead of raw divs with explicit font sizing in SCSS. Bar list rows lay out through HStack + Text rather than a CSS grid of spans. Net SCSS drops ~25 lines and the eyebrow placeholder goes away. The HStack inside clickable rows renders as="span" so the wrapping <button> stays phrasing-content valid. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
d73cdba to
dd8f5e4
Compare
|
@copilot apply changes based on the comments in this thread |
Updated in ed52a1d. I moved the bar element before the row content in Screenshot: no visible UI diff from this follow-up — the rows render the same, with the fix ensuring the background bar remains behind the labels and values. |
This PR updates the top Stats cards.
Proposed changes
VStack+__experimentalHeading+__experimentalTextinstead of raw divs with explicit font sizing in SCSS.HStack+Textrather than a CSS grid of spans. TheHStackinside clickable rows rendersas=\"span\"so the wrapping<button>stays valid phrasing content.%eyebrowplaceholder goes away — typography now comes from the primitives.Stacked on top of #48722 (date range picker). When that merges, this rebases onto trunk automatically.
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Headinglabel + large value + small muted note, with hairline dividers between them.HStackwith the tinted bar behind the row text.Screenshots will be attached as a follow-up comment.