Conversation
|
🚀 Deployed on https://pr-13795--ui5-webcomponents-preview.netlify.app |
NakataCode
left a comment
There was a problem hiding this comment.
Two things that are worth checking:
1. Height cache after theme change
Theme changes re-render via renderDeferred without going through _invalidate, so onInvalidation never fires and _contentHeightForMedia isn't cleared. If a larger-font theme caused a downgrade (e.g. "scene" → "dialog"), switching to a smaller-font theme keeps the stale cached height, and _applyMedia will keep rejecting "scene" even though it would now fit. Since _checkHeightConstraints only writes to the cache on overflow, and the downgraded media fits, nothing re-measures until a resize or content change.
2. Height adaptation for fixed (non-Auto) designs
The old code called _adjustHeightToFitContainer() for all fixed designs, which added the fit-content class so the SVG could scale down into small containers. Now the height logic only runs for design === Auto, and the fit-content CSS was removed. So a fixed design="Dialog" in a small container (e.g. 200px) would overflow instead of scaling the illustration.
A themeAware component re-renders via renderDeferred from reRenderAllUI5Elements, which bypasses _invalidate. onInvalidation therefore never fires on a theme switch, and _contentHeightForMedia accumulates stale entries across themes: a theme whose typography once caused scene -> dialog leaves an oversized scene height in the cache; switching to a theme whose typography would now fit keeps the stale entry, so _applyMedia keeps rejecting scene. Subscribe to attachThemeLoaded in onEnterDOM (detach in onExitDOM) and clear _contentHeightForMedia in the listener. The framework's own themeAware re-render then re-measures fresh via onAfterRendering -> _checkHeightConstraints -> _applyMedia. Also document the load-bearing scrollHeight > clientHeight guard in _checkHeightConstraints so a future contributor is not tempted to remove it. The Cypress test poisons the internal cache with an out-of-range value, fires setTheme, and asserts the media does not downgrade — pinning the contract that the cache is cleared on theme change without depending on the pixel-boundary between two themes' typographies.
Fixes: 12673
Problem:
When
designisAuto,ui5-illustrated-messageautomatically selects the illustration size (Scene/Dialog/Spot/Dot/Base) by comparing the container width and height with fixed breakpoints. The fixed height thresholds, however, cannot alone reliably determine the correct size because, besides the illustration, the component can also contain atitle,subtitle, andactionsof arbitrary height.Solution:
Replace checks against fixed height thresholds with a check of whether the actual content height (illustration + title + subtitle + actions) fits within the container at the current illustration size — decreasing the size if the content overflows.
This also makes the workaround for issue #5852 (where content flickered endlessly between showing and hiding a vertical scrollbar) redundant, since vertical responsiveness now ensures no scrollbar appears in the first place.