MWPW-178300: pre-reserve wrapper heights to eliminate CLS on login page and modals - #525
MWPW-178300: pre-reserve wrapper heights to eliminate CLS on login page and modals#525saurabhsircar11 wants to merge 23 commits into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
…-178300-susi-light-height
…-178300-susi-light-height
|
@saurabhsircar11 I'm seeing a lot of extra spacing. In screenshot, After vs Before: |
…-178300-susi-light-height
|
@meganthecoder Thanks for pointing it out! I have tightened the min-height values to reduce the extra space — also removed the earlier 8px buffer. Updated the PR description with the latest changes. |
The Nala tabs fixture Educators panel can exceed the login-page floor with min-height-only slots. Step-5 now verifies the reserve is applied and the tab panel slot stays at or above that floor when switching tabs. Co-authored-by: Cursor <cursoragent@cursor.com>
…-178300-susi-light-height
meganthecoder
left a comment
There was a problem hiding this comment.
Thanks for all the work. I know that this was Jingle's idea, but I still question the overall premise/approach. This seems difficult to maintain with all the hardcoded values. What about different languages that might be wrap? Also, we know the susi styling is different on stage and prod. Will these match? @echen-adobe what do you think?
| --susi-tabs-panel-height: 521px; | ||
| --susi-tabs-panel-standard: 508px; | ||
| --susi-tabs-panel-edu-express: 521px; | ||
| --susi-tabs-wrapper-standard: 458px; | ||
| --susi-tabs-wrapper-edu-express: 367px; | ||
| --susi-tabs-panel-buffer: 0px; | ||
| --susi-wrapper-standard: 484px; | ||
| --susi-wrapper-b2b-default: 484px; | ||
| --susi-wrapper-b2b-hed: 291px; | ||
| --susi-wrapper-b2b-business: 393px; | ||
| --susi-wrapper-b2b-email-first: 409px; | ||
| --susi-wrapper-b2b-email-only: 294px; | ||
| --susi-wrapper-edu-default: 484px; | ||
| --susi-wrapper-edu-hed: 333px; | ||
| --susi-wrapper-edu-business: 393px; | ||
| --susi-wrapper-edu-express: 400px; | ||
| --susi-wrapper-student-default: 462px; | ||
| --susi-wrapper-student-hed: 422px; | ||
| --susi-wrapper-student-business: 422px; | ||
| --susi-wrapper-student-email-only: 294px; | ||
| --susi-wrapper-student: 422px; | ||
| --susi-wrapper-simplified: 400px; | ||
| --susi-wrapper-legacy-edu-express: 545px; | ||
| --susi-wrapper-legacy-edu-hed: 477px; |
There was a problem hiding this comment.
It looks like most of these aren't being used and that they're duplicated in the js. It'd be better if there was a single source of truth. Either have the js use/apply these css vars or remove the unused css vars.
There was a problem hiding this comment.
Thanks Megan, removed the unused tokens from the CSS and kept the heights in the JS as the single source of truth. Also cleaned up a similar dead duplicate on the JS side.
| @@ -1,7 +1,31 @@ | |||
| /* CLS min-height floors (not exact heights) — re-measure: /drafts/sircar/susi-light-copy */ | |||
There was a problem hiding this comment.
I don't think we should include a draft page path in a comment for maintenance reasons
There was a problem hiding this comment.
Thanks Megan, removed the draft path from the comment
…-178300-susi-light-height
…truth - Remove unused per-profile :root CSS vars (duplicated as JS constants); per-profile heights now owned solely by JS (MODAL_WRAPPER_FALLBACK_PX / TABS_PANEL_HEIGHTS), applied inline. - Remove dead JS TABS_WRAPPER_HEIGHTS / resolveTabsWrapperMinHeight; tab-wrapper heights owned solely by CSS. - Drop draft page path from CSS comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
echen-adobe
left a comment
There was a problem hiding this comment.
Can we get test links for international use cases for all of these? Fixed width might not play well with different languages?
…-178300-susi-light-height
…rements Measured teacher-fragment content across 18 locales: 508px (latin) to 519px (kr). The 545px floor added up to 37px of bottom whitespace in the modal; 520px covers the tallest locale with no overflow.
|
Hi @echen-adobe, I went through all the locales where susi-light shows up — here's what I found. Login pages: checked
One thing you'll still notice: in es/it/fi (and a bit in fr/de/nl/no/dk/br), switching to the Educators tab causes a jump, because that panel comes back taller than the 521px we reserve. Initial load is fine, it's only the tab switch. We could raise the min-height for those locales but then everyone else gets white space under the card. Main has the same jump today (ours is smaller or equal in every locale, and us/uk/se/id_id/in are now completely stable where main still shifts), so I'd rather keep the balanced floor and maybe do a follow-up that bumps the slot height after the first hydration. Modals: opened the sign-in modals on Heads up on something I hit while testing: on the localized business pages (de, fr, es, it, nl, dk, fi, se, no, kr, tw, cn, id_id) the sign-in modal doesn't open at all. The CTA points at the localized To still cover localized modal content, I loaded the published localized fragments directly ( Testing also caught one real issue in our own numbers: the |


Summary
Pre-reserves
susi-lightheights synchronously ininit()before the asyncsusi-sentry-lightCDN component hydrates, reducing Cumulative Layout Shift (CLS) on the login page and in SUSI modals.Tabs (login page only — prod
susi-light tabsis authored on/express/login+ locales):applyTabsReserveFromAuthoring()sets--susi-tabs-panel-heightto the tallest tab panel (max(standard, edu-express)= 521px, measured on login draft with the Students footer bubbles)..susi-tab-panelsusesmin-heightonly (no fixed height / inner scroll) — same strategy as modals. Page scrolls if content exceeds the floor./drafts/sircar/login(Individual ↔ Students).Modals & in-page variants:
applyModalWrapperReserve()sets--susi-modal-wrapper-heightfrom variant class +client_id+ layout flags (data-susi-wrapper-profilefor debugging)..susi-wrapperusesmin-heightonly — Milo.dialog-modalscrolls on short viewports (no inner wrapper scrollbar).Measured wrapper floors (rebaselined from main/stage settled heights, no buffer):
b2b-default484,b2b-hed291,b2b-email-first409,edu-default484,edu-hed333,edu-business393,legacy-edu-express545,legacy-edu-hed477,simplified400, etc.A11y: Inactive tab panels get
aria-hidden+inertalongside.hide.Tradeoff: Floors are set to hydrate-peak / tallest-tab heights. Where settled content is shorter, you may see empty space below the form — intentional CLS mitigation. Tokens were tightened vs earlier commits to reduce dead space while still preventing shift.
Jira Ticket
Resolves: MWPW-178300
Test URLs
Verification Steps
Tabs variant (login page):
.susi-layoutheight should stay stable (0px delta on branch preview).susi-tab-panels; page/dialog scrolls insteadModal variants (both After modal QA URLs):
document.querySelector('.dialog-modal .susi-light')?.dataset.susiWrapperProfile(e.g.b2b-email-first,legacy-edu-hed).susi-wrapper)Priority modals:
b2b-default,b2b-email-first,legacy-edu-express,edu-default,edu-hed,student-defaultBefore (stage): Visible layout shift as
susi-sentry-lightgrows on hydrationAfter: Height reserved from first paint; may retain min-height slack after content settles (acceptable empty space vs CLS)
Potential Regressions
Flavors to spot-check:
b2b,b2b email-first,b2b email-only,edu(+_HED/_Businessclient IDs),student,tabs,simplified, legacy barebuildEdu.Additional Notes
Files changed (vs
stage):susi-light.css—:root--susi-wrapper-*/--susi-tabs-*tokens; tab panelmin-height; modal.susi-wrappermin-height; legacy bare-block rulesusi-light.js—applyModalWrapperReserve,applyTabsReserveFromAuthoring, profile resolvers,MODAL_WRAPPER_FALLBACK_PX,aria-hidden/inerton tabstest/blocks/susi-light/susi-light.test.js— profile + reserve unit tests (23 tests)nala/blocks/susi-light/— tab-switch height assertion (≤8px tolerance)Heights are static constants (not per social-login count / AB bucket). Re-measure on draft QA pages if SUSI layout changes.