Skip to content

Conversation

tomrf1
Copy link
Member

@tomrf1 tomrf1 commented Oct 3, 2025

We need to signal to the ad slots when the popup gate is being viewed, and when it has been dismissed. This is so that ad refreshing can be suspended.

This PR does this by emitting new CustomEvents for tracking modals:

  • modal:open
  • modal:close

In the detail object it also specifies modalType: 'sign-in-gate-v2'

The PR also makes some small improvements:

  1. removes the signInGateVersion prop from the top-level SignInGateSelector component. This was only added for storybook, but it's simpler if we only use the treatmentType field for determining the version.
  2. moves the call to getAuxiaGateVersion up to the top level, so that we can use the version for these new events

Copy link

github-actions bot commented Oct 3, 2025

Copy link

github-actions bot commented Oct 3, 2025

@tomrf1 tomrf1 added the run_chromatic Runs chromatic when label is applied label Oct 3, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Oct 3, 2025
@tomrf1 tomrf1 requested a review from Copilot October 3, 2025 08:57
Copy link

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

This PR adds event emission for ad slots to signal when the sign-in gate popup is viewed or dismissed, enabling suspension of ad refreshing during popup display.

  • Emits new events: article:sign-in-gate-${signInGateVersion}-viewed and article:sign-in-gate-${signInGateVersion}-dismissed
  • Refactors gate version determination to use treatment type instead of prop-based configuration
  • Moves getAuxiaGateVersion call to top level for consistent version handling across components

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
SignInGatePortal.tsx Updates auxiaGateDisplayData type to be required and simplifies getAuxiaGateVersion call
SignInGateSelector.importable.tsx Removes signInGateVersion prop, moves version determination to top level, adds event emission logic
types.ts Adds clarifying comment about gate versions
SignInGate.stories.tsx Updates stories to use treatmentType instead of signInGateVersion prop
Comments suppressed due to low confidence (1)

dotcom-rendering/src/components/SignInGateSelector.importable.tsx:1

  • The call to getAuxiaGateVersion is missing the first parameter after removing the signInGateVersion parameter. The function signature expects userTreatment as the first parameter, but this is passing it as the second.
import { getCookie, isUndefined, storage } from '@guardian/libs';

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tomrf1 tomrf1 added the run_chromatic Runs chromatic when label is applied label Oct 3, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Oct 3, 2025
@tomrf1 tomrf1 marked this pull request as ready for review October 3, 2025 10:45
Copy link

github-actions bot commented Oct 3, 2025

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.

@tomrf1 tomrf1 added the run_chromatic Runs chromatic when label is applied label Oct 3, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants