Skip to content

feat: animate in the Carbon Ads Top Bar - #9343

Open
MattIPv4 wants to merge 5 commits into
mainfrom
MattIPv4/carbon-top-bar-animation
Open

MattIPv4 wants to merge 5 commits into
mainfrom
MattIPv4/carbon-top-bar-animation

Conversation

@MattIPv4

Copy link
Copy Markdown
Member

Description

Following #9250 landing, we've noticed CLS on pages using the Top Bar when no ad loads, due to the placeholder while waiting for an ad already taking up space. After discussion in https://openjs-foundation.slack.com/archives/C09EXEEHFKP/p1794936106221269, we've decided it may be better to have the CLS happen only once an ad is ready to display, following the same approach that we use for the announcement banner.

Validation

No CLS on About page when no ad loads. Ad animates in on About page once loaded.

Related Issues

N/A

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@MattIPv4
MattIPv4 requested review from a team as code owners November 19, 2026 17:20
Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:20
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Nov 19, 2026 9:29pm UTC

Request Review

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.07%. Comparing base (e49feb7) to head (26a049e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9343      +/-   ##
==========================================
+ Coverage   87.06%   87.07%   +0.01%     
==========================================
  Files          91       91              
  Lines        6563     6563              
  Branches      401      401              
==========================================
+ Hits         5714     5715       +1     
+ Misses        845      844       -1     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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.

🟡 Changes recommended

The ad animation still shifts headings while hidden, ignores reduced-motion preferences, and clips taller creatives before abruptly revealing their full height.

3 open issues
What changed in this PR

This PR changes the Carbon Ads Top Bar to render only when an ad is available, avoiding placeholder-related layout shifts when no ad loads.

Changes:

  • Removes the loading placeholder and adds a delayed expand, fade, and slide animation.
  • Updates end-to-end tests to check rendering before and after ad availability.
  • Documents the new loading and animation behavior.
File Description
docs/​carbon-ads.md Documents space-free loading and animated entry.
apps/​site/​tests/​e2e/​carbon-ads.spec.ts Checks that the Top Bar appears only after an ad loads.
apps/​site/​components/​CarbonAds/​TopBar.tsx Removes the loading placeholder.
apps/​site/​components/​CarbonAds/​index.module.css Replaces placeholder styles with entry animation keyframes.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 7.22 MB
New Total First Load JS 7.22 MB
Delta -4.00 B (-0.00%)

Changes

🔄 Modified Routes (4)
Route Old First Load JS New First Load JS Delta
/[locale] 1.69 MB 1.69 MB 📉 -1.00 B (-0.00%)
/[locale]/[...path] 1.69 MB 1.69 MB 📉 -1.00 B (-0.00%)
/[locale]/blog/[...path] 1.69 MB 1.69 MB 📉 -1.00 B (-0.00%)
/[locale]/download/archive/[version] 1.69 MB 1.69 MB 📉 -1.00 B (-0.00%)

This branch was successfully deployed

2 active deployments
Preview — 26a049ef Deployed Nov 19, 2026 by vercel[bot]
Storybook — 26a049ef Deployed Nov 19, 2026 by MattIPv4 via Chromatic #2495
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