Skip to content

Conversation

juabara
Copy link
Contributor

@juabara juabara commented Aug 14, 2025

What does this change?

Centralise sign-in gate rendering inside the StickyBottomBanner message picker so banners and the sign‑in gate cannot display at the same time.

Main changes

  • Introduce a portal wrapper for sign-in gates:
    • src/components/StickyBottomBanner/SignInGatePortal.tsx — new portal component that uses useSignInGateSelector and renders gates into #sign-in-gate.
    • Test: src/components/StickyBottomBanner/SignInGatePortal.test.tsx (covers edge cases).
  • Make StickyBottomBanner the single source of truth for bottom messages:
    • src/components/StickyBottomBanner.importable.tsx — add sign-in gate as a messagePicker candidate and prioritise message ordering (CMP → SignInGate → Braze → ReaderRevenue).
  • Remove legacy gate coordination:
    • src/components/StickyBottomBanner/ReaderRevenueBanner.tsx — remove legacy signInGateWillShow dependency from reader revenue canShow logic.
    • Deleted/removed usages of legacy signInGateWillShow logic from banner flow.
  • Playwright - Banner e2e:
    • Check if auxia/get-treatments endpoint is called on page load.
    • Wrap the sign-in gate selector inside an Island in the portal to defer activation until visible.
  • Layout updates:
    • Added host prop to layouts that require it so StickyBottomBanner can pass host through.

Why?

  • Problem: legacy sign-in gate flow (signInGateWillShow) could not coordinate with the new SDC/Auxia flow and allowed simultaneous display of banners and gates.
  • Goal: ensure only one bottom message (banner OR sign-in gate) is visible at a time and keep the system extensible and testable.
  • Centralising selection in the StickyBottomBanner messagePicker provides a single priority-based decision point and removes fragile cross-component coordination.

Testing & validation

  • Unit tests: SignInGatePortal unit tests added
  • Playwright: Banner e2e was changed to check if auxia/get-treatments is called on page load.

Notes for reviewers

  • I intentionally removed the island & selector from the legacy withSignInGateSlot helper; that helper now only injects the #sign-in-gate placeholder so StickyBottomBanner owns gate rendering.

- Removed unused sign-in gate logic and integrated new Sign-In Gate Portal component.
- Updated StickyBottomBanner to include host prop for Sign-In Gate functionality.
- Enhanced message picking logic to prioritize Sign-In Gate over other banners.
- Added tests for Sign-In Gate Portal to ensure correct behavior under various conditions.
- Updated Reader Revenue Banner logic to remove dependency on sign-in gate visibility.
- Created Storybook stories for various scenarios including mock implementations for better testing.
- Added host prop to multiple layouts to support Sign-In Gate rendering.
Copy link

github-actions bot commented Aug 14, 2025

@juabara juabara changed the title feat(wip): Integrate Sign-In Gate Portal into Sticky Bottom Banner feat: Integrate Sign-In Gate Portal into Sticky Bottom Banner Sep 1, 2025
@juabara juabara added the run_chromatic Runs chromatic when label is applied label Sep 1, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Sep 1, 2025
Copy link

github-actions bot commented Sep 1, 2025

@juabara juabara added the run_chromatic Runs chromatic when label is applied label Sep 15, 2025
@juabara juabara marked this pull request as ready for review September 15, 2025 08:51
@juabara juabara requested a review from a team as a code owner September 15, 2025 08:51
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Sep 15, 2025
Copy link
Member

@tomrf1 tomrf1 left a comment

Choose a reason for hiding this comment

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

great 🎉

@tomrf1 tomrf1 added the run_chromatic Runs chromatic when label is applied label Sep 18, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Sep 18, 2025
@tomrf1 tomrf1 added the run_chromatic Runs chromatic when label is applied label Sep 18, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Sep 18, 2025
@juabara juabara merged commit be116d8 into main Sep 18, 2025
31 checks passed
@juabara juabara deleted the jm/feat-prevent-banner-and-sign-in-gate-together branch September 18, 2025 08:44
@gu-prout
Copy link

gu-prout bot commented Sep 18, 2025

Seen on PROD (merged by @juabara 8 minutes and 55 seconds ago) Please check your changes!

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.

2 participants