fix(header): sync ESI CSS variables for the new header states - #7206
Merged
Conversation
The bridge only applied while user data was loading, so --basket-display never reached the header on a basket-only load — the common case, and the one the variable exists to cover. userAvatarData emitted user-avatar unconditionally, leaving the real-avatar element shown with an empty image whenever there was no image to paint. It now emits the url only when it will be shown, and hides that element otherwise, so the avatar icon carries the state. Adds the logged-out signal the cluster hook needs.
…-header-esi-sync # Conflicts: # package-lock.json # package.json
eddieferrer
approved these changes
Aug 31, 2026
emuvente
approved these changes
Aug 31, 2026
emuvente
left a comment
Collaborator
There was a problem hiding this comment.
Great fix! The description claims that this doesn't change local behavior because "local dev has no ESI", but that's not true. We process ESI locally:
Line 51 in 131e350
Collaborator
Author
|
@emuvente I had already verified the work locally and have once more. Also had claude update the description |
Collaborator
|
🎉 This PR is included in version 3.91.0-rc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Collaborator
|
🎉 This PR is included in version 3.91.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Restores the ESI CSS-variable personalization that
KvWwwHeaderBasiclost when it shipped. The variables were already emitted and already bridged; the hooks that read them were missing, so both ends were inert.--basket-displaynever reached the header during a basket-only load.userAvatarDataemitteduser-avatarunconditionally, leaving the real-avatar element shown with an empty image whenever there was nothing to paint. It now emits the url only when it will be shown, and hides that element otherwise so the avatar icon carries the state.user-loading-display) that the logged-in cluster hook needs.Scope of effect
useCDNCachingis route meta and only/ui-site-mapsets it (src/router/routes.js:696-701), so the header bindsdisplayto these variables on that route alone. Live today: the basket hook and the cluster hook.The
user-avatarpolarity fix has no live consumer yet.avatarModecannot reachesiuntilKvWwwHeaderBasicexposesuseEsiAvatar(CIT-5084), andMyKivaButton— the other component that reads these variables, directly under the--ui-data-prefix — only renders on minimal and corporate pages, which are never CDN-cached, so its variable branch is unreachable. That part of the change is groundwork for CIT-5085 rather than a visible fix.One intended behaviour change where the hooks are live: on a stale logged-in-filled cached shell served to a logged-out visitor, the cluster is now suppressed pre-hydration. The visitor links are
v-if-driven and stay hidden (design decision D4), so that visitor briefly sees neither the cluster nor a Log in link, where before they saw placeholder chrome.Verifying
ESI resolves locally, not only at Fastly:
server/vue-render.js:24-26runs anodesiprocessor over the rendered HTML whenconfig.server.simulateCDNis set, andindex.html:5carries the/esi-ui/headinclude. Under that flagcdnNotedLoggedIncomes from thekvlslogin-sync cookie rather than the Fastly header (server/vue-middleware.js:101-105), so both loading states are reachable locally.With a
simulateCDN: trueconfig, on/ui-site-map:kvbsktcookie → no basket link at any point;kvlsset to anything other thanowhile not actually logged in → the logged-in cluster stays suppressed.Logged-in user state confirmed loading correctly.
Covers CIT-5069 items 1, 2 and 4, and CIT-5071 item 3. The remaining items need
kv-ui-elementschanges and are tracked in CIT-5084 and CIT-5085.https://kiva.atlassian.net/browse/CIT-5069
https://kiva.atlassian.net/browse/CIT-5071