Skip to content

feat(hub-hero-modal): add hub-hero-modal C2 block (MWPW-194632)#5911

Closed
sirivuri wants to merge 2 commits into
adobecom:mainfrom
sirivuri:MWPW-194632-clean
Closed

feat(hub-hero-modal): add hub-hero-modal C2 block (MWPW-194632)#5911
sirivuri wants to merge 2 commits into
adobecom:mainfrom
sirivuri:MWPW-194632-clean

Conversation

@sirivuri
Copy link
Copy Markdown
Contributor

@sirivuri sirivuri commented May 7, 2026

Summary

  • Adds the hub-hero-modal C2 block — a scrollable modal with a sticky title bar and sticky frosted promo CTA, matching Figma spec 10311:248467 (Modal_Sales)
  • Single clean commit on top of current main

Block structure

Element Class Behaviour
Row 0 eyebrow + headline .hub-hero-modal-title position: sticky; top: 0
Rows 1–N copy + media .hub-hero-modal-section Scrollable
CTA extracted from row 1 .hub-hero-modal-cta position: sticky; bottom: 0 (frosted pill)

Key implementation notes

  • No overflow-y on the block — sticky scopes to .dialog-modal (the Milo scroll container). Setting overflow on the block would trap sticky.
  • Z-pattern uses :nth-of-type not :nth-child<div> title/CTA siblings would skew :nth-child ordinals and invert the pattern.
  • CTA is extracted from the first section row only; CTAs in later rows are stripped to prevent unstyled links leaking into content.
  • Sections use semantic <section> elements with aria-label; title and CTA use <div>.

Test plan

  • Unit tests pass: test/c2/blocks/hub-hero-modal/hub-hero-modal.test.js (17 assertions)
  • Local test page: test-pages/hub-hero-modal.html — verify sticky title, sticky CTA, scroll, Z-pattern alignment
  • Verify max-height: calc((100vh - 6px) - 2em) matches .dialog-modal height at 900px and 1024px viewports

🤖 Generated with Claude Code

Scrollable modal block with sticky title bar and sticky promo CTA,
matching Figma spec 10311:248467 (Modal_Sales).

Structure:
- Row 0 → sticky .hub-hero-modal-title (eyebrow + headline)
- Rows 1–N → .hub-hero-modal-section (scrollable, media + copy)
- Single .hub-hero-modal-cta (frosted pill, sticky at modal bottom)

Key implementation details:
- Block has no overflow-y so position:sticky scopes to .dialog-modal
- Z-pattern uses :nth-of-type/:last-of-type (not :nth-child) to avoid
  counting <div> title/CTA siblings skewing section ordinals
- CTA extracted from row 1 only; later rows have CTAs stripped
- <section> elements for content rows; <div> for title and CTA

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

SNOW Change Request Transaction ID: 0000019c1ef37582-dc3fff6

The block lives at libs/c2/blocks/hub-hero-modal/ but loadBlock() looks
for non-MILO_BLOCKS entries at {codeRoot}/blocks/{name}. On the DA test
page (main--da-dc--adobecom.aem.page) codeRoot points to that host which
has no hub-hero-modal block, causing "Failed loading hub-hero-modal block."

Add hub-hero-modal to MILO_BLOCKS so loadBlock() uses miloLibs
(MWPW-194632--milo--sirivuri branch URL) and create thin proxy files at
libs/blocks/hub-hero-modal/ that re-export from the c2 implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sirivuri
Copy link
Copy Markdown
Contributor Author

sirivuri commented May 7, 2026

Closing - incorrect base branch. C2 block depends on --s2a-* design tokens not in main. Canonical PR is #5907 targeting site-redesign-foundation.

@sirivuri sirivuri closed this May 7, 2026
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.

1 participant