MWPW-192837: Fix Express card alignment for wrapping JP titles and feature bullets#795
Open
Axelcureno wants to merge 20 commits into
Open
MWPW-192837: Fix Express card alignment for wrapping JP titles and feature bullets#795Axelcureno wants to merge 20 commits into
Axelcureno wants to merge 20 commits into
Conversation
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.
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Refactor full-pricing-express to use VariantLayout.syncRowHeights base API from main (PR #858), removing duplicate per-row sync logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
requestAnimationFramewait afterfonts.readyso post-font layout settles before measurement..headerwas measuring 35px (fallback metrics) instead of 61px (Adobe Clean JP, 2-line wrap).[slot="body-s"]children via CSS vars--consonant-merch-card-full-pricing-express-description-row-N-heightbound tomin-heighton: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).runResync, replacing the monotonic ratchet that locked in stale early-render measurements. UsesgetBoundingClientRect()for border-box height.resyncSiblingsso N simultaneouspostCardUpdateHookcalls collapse to onerunResync.setPropertyto avoid style-recalc thrash.Files
web-components/src/variants/full-pricing-express.jsweb-components/src/variants/full-pricing-express.css.jsweb-components/dist/*(rebuilt)Test URLs
Checklist