Skip to content

MWPW-192837: Fix Express card alignment for wrapping JP titles and feature bullets#795

Open
Axelcureno wants to merge 20 commits into
mainfrom
MWPW-192837
Open

MWPW-192837: Fix Express card alignment for wrapping JP titles and feature bullets#795
Axelcureno wants to merge 20 commits into
mainfrom
MWPW-192837

Conversation

@Axelcureno
Copy link
Copy Markdown
Member

Resolves https://jira.corp.adobe.com/browse/MWPW-192837

Fixes JP /pricing alignment in full-pricing-express: wrapping JP enterprise title and per-bullet drift in feature list were not synced across siblings.

Changes

  • requestAnimationFrame wait after fonts.ready so post-font layout settles before measurement. .header was measuring 35px (fallback metrics) instead of 61px (Adobe Clean JP, 2-line wrap).
  • Per-row sync for [slot="body-s"] children via CSS vars --consonant-merch-card-full-pricing-express-description-row-N-height bound to min-height on :nth-child(N) for N=1..12. Fixes drift when bullet text wraps to different line counts (e.g. 生成AI: 4 lines vs 6 lines).
  • Two-phase clear-then-measure-then-write in runResync, replacing the monotonic ratchet that locked in stale early-render measurements. Uses getBoundingClientRect() for border-box height.
  • Microtask coalesce in resyncSiblings so N simultaneous postCardUpdateHook calls collapse to one runResync.
  • Skip no-op setProperty to avoid style-recalc thrash.

Files

  • web-components/src/variants/full-pricing-express.js
  • web-components/src/variants/full-pricing-express.css.js
  • web-components/dist/* (rebuilt)

Test URLs

Checklist

  • Code follows project conventions
  • Linter clean
  • Verified live: header 61px both cards, bullets 0–9 row-aligned, 10+ diverge naturally (different feature counts)
  • Screenshots

Axel Cureno Basurto and others added 3 commits April 28, 2026 12:07
The four block-level rows (header, short-description, price-container, cta)
were already synced, but bullets inside [slot="body-s"] could drift when one
card's row wrapped to more lines than its sibling (e.g. JP enterprise's 生成AI
text wraps to 6 lines vs 4 on the group card, pushing every following bullet
24px lower on one side.

- Sync per-row min-height across siblings via container CSS variables
  --consonant-merch-card-full-pricing-express-description-row-N-height
- Light-DOM CSS rules bind those vars to [slot=body-s] > *:nth-child(N)
  for N=1..12 (::slotted can't reach grandchildren)
- Two-phase clear-then-measure-then-write avoids the prior monotonic ratchet
  locking in stale early-render measurements
- Microtask coalesce so N cards firing postCardUpdateHook collapse to one resync
- Skip setProperty when value unchanged to avoid style-recalc thrash
- await document.fonts.ready before final resync so JP titles are measured at
  their post-font-load wrapped height (.header was rendering 35px in fallback
  font, 61px after Adobe Clean JP loaded)
EOF
)
document.fonts.ready resolves when fonts have loaded but not necessarily
after the wrapping reflow commits to the DOM. With cached fonts the promise
resolves immediately while the JP title is briefly still single-line in
fallback metrics, so .header was measuring 35px and the var locked at the
smaller value. Add one requestAnimationFrame wait so the post-font layout
pass settles before measurement.
@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Apr 28, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@Axelcureno Axelcureno self-assigned this Apr 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.72%. Comparing base (6e56401) to head (917bf71).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #795      +/-   ##
==========================================
- Coverage   88.75%   88.72%   -0.03%     
==========================================
  Files         241      241              
  Lines       69313    69339      +26     
==========================================
+ Hits        61516    61523       +7     
- Misses       7797     7816      +19     
Files with missing lines Coverage Δ
...omponents/src/variants/full-pricing-express.css.js 100.00% <100.00%> (ø)
...eb-components/src/variants/full-pricing-express.js 99.21% <100.00%> (+1.32%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e56401...917bf71. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Refactor full-pricing-express to use VariantLayout.syncRowHeights base API
from main (PR #858), removing duplicate per-row sync logic.
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.

1 participant