Skip to content

Add new dispatch event for when no banner is rendered#15053

Merged
dskamiotis merged 6 commits intomainfrom
ds/add-rr-banner-close-event
Feb 10, 2026
Merged

Add new dispatch event for when no banner is rendered#15053
dskamiotis merged 6 commits intomainfrom
ds/add-rr-banner-close-event

Conversation

@dskamiotis
Copy link
Copy Markdown
Contributor

@dskamiotis dskamiotis commented Dec 22, 2025

What does this change?

Adds custom event dispatching to the StickyBottomBanner component to signal banner state to the commercial bundle:

  • banner:none - Fired when no banner is selected to display

These events are dispatched via document.dispatchEvent() and can be listened to by the commercial bundle to control when mobile sticky ads should show.

Why?

The commercial team needs to coordinate mobile sticky ad placement with reader revenue banners. Mobile sticky ads should only show when:

  • A banner has been closed (banner:close)
  • No banner is due to show (banner:none)

This prevents ads from showing up in the DOM and going against google ad policy

Related to guardian/commercial#2351 which implements the listening logic.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 22, 2025

@dskamiotis dskamiotis added the run_chromatic Runs chromatic when label is applied label Dec 22, 2025
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Dec 22, 2025
@dskamiotis dskamiotis marked this pull request as ready for review January 7, 2026 12:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 7, 2026

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@dskamiotis dskamiotis force-pushed the ds/add-rr-banner-close-event branch from b9fb250 to e2d2fdc Compare January 7, 2026 16:18
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

@GHaberis GHaberis left a comment

Choose a reason for hiding this comment

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

Nice, I can see introducing hasPickMessageCompleted provides precise control over when to dispatch 'banner:none' and ensures the event only fires once banner selection is truly complete so there's no premature dispatch during initial rendering, looks good 👍

@dskamiotis dskamiotis requested review from a team and GHaberis January 9, 2026 20:30
@dskamiotis dskamiotis added the run_chromatic Runs chromatic when label is applied label Jan 9, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jan 9, 2026
Comment thread dotcom-rendering/src/components/StickyBottomBanner.importable.tsx Outdated
Comment thread dotcom-rendering/src/components/StickyBottomBanner.importable.tsx Outdated
@dskamiotis dskamiotis added the feature Departmental tracking: work on a new feature label Jan 13, 2026
Comment thread dotcom-rendering/src/components/StickyBottomBanner.importable.tsx Outdated
@dskamiotis dskamiotis force-pushed the ds/add-rr-banner-close-event branch from cb1c185 to 334324d Compare January 13, 2026 13:55
@dskamiotis dskamiotis added the run_chromatic Runs chromatic when label is applied label Jan 16, 2026
@dskamiotis dskamiotis force-pushed the ds/add-rr-banner-close-event branch from 334324d to bf8b353 Compare January 16, 2026 13:56
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jan 16, 2026
@dskamiotis dskamiotis force-pushed the ds/add-rr-banner-close-event branch 2 times, most recently from 76c6a1f to a73e160 Compare February 10, 2026 14:36
@dskamiotis dskamiotis added run_chromatic Runs chromatic when label is applied and removed Do not merge ⚠️ labels Feb 10, 2026
@dskamiotis dskamiotis force-pushed the ds/add-rr-banner-close-event branch from a73e160 to e6e60a0 Compare February 10, 2026 14:40
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Feb 10, 2026
@dskamiotis dskamiotis merged commit a84d555 into main Feb 10, 2026
23 checks passed
@dskamiotis dskamiotis deleted the ds/add-rr-banner-close-event branch February 10, 2026 14:51
@gu-prout
Copy link
Copy Markdown

gu-prout Bot commented Feb 10, 2026

Seen on PROD (merged by @dskamiotis 30 minutes and 16 seconds ago) Please check your changes!

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

Labels

feature Departmental tracking: work on a new feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants