Skip to content

Podcast: rebuild Stats tiles and bar list on @wordpress/components primitives#48744

Open
robertbpugh wants to merge 4 commits into
update/podcast-stats-date-range-pickerfrom
update/podcast-stats-components-refactor
Open

Podcast: rebuild Stats tiles and bar list on @wordpress/components primitives#48744
robertbpugh wants to merge 4 commits into
update/podcast-stats-date-range-pickerfrom
update/podcast-stats-components-refactor

Conversation

@robertbpugh
Copy link
Copy Markdown
Contributor

@robertbpugh robertbpugh commented May 12, 2026

This PR updates the top Stats cards.

  • Summary tiles now use WordPress's stock Heading, Text, and VStack components instead of hand-rolled divs with custom SCSS.
  • Bar list rows (Top apps, Top countries, Top episodes) now use HStack and Text instead of CSS grid plus custom typography rules.
  • SCSS shrinks: ~25 lines deleted. Typography (font sizes, weights, colors, ellipsis) is owned by the components now — only layout (grid placement, the bar fill, hover/focus states) stays in SCSS.
  • Removes the layout prop on SummaryTiles — both consumers used the inline variant, so the standalone Card/CardBody branch was dead code.

Proposed changes

  • Summary tiles render through 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. The HStack inside clickable rows renders as=\"span\" so the wrapping <button> stays valid phrasing content.
  • SCSS drops ~25 lines and the %eyebrow placeholder 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

  1. Open the podcast Stats tab on a connected site.
  2. Confirm the 4 summary tiles (Total downloads, Top app, Top country, Top day) render with the new Heading label + large value + small muted note, with hairline dividers between them.
  3. Confirm Top episodes / By app / By location bar rows align under HStack with the tinted bar behind the row text.
  4. Click a row in Top episodes — drilldown still navigates to the episode view.

Screenshots will be attached as a follow-up comment.

@robertbpugh robertbpugh self-assigned this May 12, 2026
@robertbpugh robertbpugh requested a review from arcangelini May 12, 2026 21:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the update/podcast-stats-components-refactor branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/podcast-stats-components-refactor
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/podcast-stats-components-refactor

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 12, 2026
@robertbpugh robertbpugh marked this pull request as ready for review May 12, 2026 21:48
Copilot AI review requested due to automatic review settings May 12, 2026 21:48
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 12, 2026

Code Coverage Summary

No summary data is available for parent commit cc6d83c, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for cc6d83c is available.

Full summary · PHP report · JS report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 + __experimentalText and removes tile-typography SCSS.
  • Rebuilds horizontal bar list rows using HStack + Text instead 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"
						/>

Comment on lines +233 to +237
// HStack wrapper — sits above the bar so the fill renders behind text.
&__content {
position: relative;
}

@robertbpugh
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

@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.

@robertbpugh robertbpugh force-pushed the update/podcast-stats-date-range-picker branch from 5b9a4c5 to cc6d83c Compare May 13, 2026 01:07
robertbpugh and others added 3 commits May 12, 2026 21:07
…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>
@robertbpugh robertbpugh force-pushed the update/podcast-stats-components-refactor branch from d73cdba to dd8f5e4 Compare May 13, 2026 01:08
@robertbpugh
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

@copilot apply changes based on the comments in this thread

Updated in ed52a1d. I moved the bar element before the row content in horizontal-bar-list.tsx and removed the now-unneeded z-index overrides, so the bar stays behind the text by normal paint order.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Podcast [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants