fix(ui5-illustrated-message): add v5 loader in tnt illustrations#13160
Open
dobrinyonkov wants to merge 3 commits intomainfrom
Open
fix(ui5-illustrated-message): add v5 loader in tnt illustrations#13160dobrinyonkov wants to merge 3 commits intomainfrom
dobrinyonkov wants to merge 3 commits intomainfrom
Conversation
…stration imports When importing a single TNT illustration directly (e.g., import "@ui5/webcomponents-fiori/dist/illustrations/tnt/NoApplications.js"), the IllustratedMessage was displaying the wrong illustration (V4) instead of the correct one (V5) when using Horizon themes. Root cause: Single V4 TNT illustration imports only registered V4 data. Horizon themes (sap_horizon, sap_horizon_dark, sap_horizon_hcb, sap_horizon_hcw) expect V5 illustrations, but no V5 loader was registered when importing a single illustration file. Solution: Modified the illustration generation script to also register V5 and V5/HC loaders for each V4 TNT illustration. The loaders use dynamic imports, so the V5 SVGs are loaded lazily only when actually needed (i.e., when a Horizon theme is active). This maintains tree-shaking benefits while ensuring correct illustration display. Fixes #8145
68f8113 to
b6994f0
Compare
…stration imports When importing a single TNT illustration directly (e.g., import "@ui5/webcomponents-fiori/dist/illustrations/tnt/NoApplications.js"), the IllustratedMessage was displaying the wrong illustration (V4) instead of the correct one (V5) when using Horizon themes. Root cause: Single V4 TNT illustration imports only registered V4 data. Horizon themes (sap_horizon, sap_horizon_dark, sap_horizon_hcb, sap_horizon_hcw) expect V5 illustrations, but no V5 loader was registered when importing a single illustration file. Solution: Modified the illustration generation script to register V5 and V5/HC loaders for V4 TNT illustrations that have corresponding V5 versions. The loaders use dynamic imports, so the V5 SVGs are loaded lazily only when actually needed (i.e., when a Horizon theme is active). This maintains tree-shaking benefits while ensuring correct illustration display. Note: Not all TNT illustrations have V5 versions (e.g., UnableToLoad, EmptyContentPane, User2), so we check for V5 availability at build time. Fixes #8145
b6994f0 to
d6f5392
Compare
plamenivanov91
requested changes
Feb 27, 2026
Contributor
plamenivanov91
left a comment
There was a problem hiding this comment.
Is it possible to write cypress test and test for the SVG in the DOM in order to support this complex 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.
Fixes #8145
Problem
When importing a single TNT illustration directly (e.g.,
import "@ui5/webcomponents-fiori/dist/illustrations/tnt/NoApplications.js"), the IllustratedMessage displayed V4 instead of V5 when using Horizon themes.Solution
Modified the illustration generation script to register V5/V5-HC loaders for V4 TNT illustrations that have corresponding V5 versions. The loaders use dynamic imports, so V5 SVGs load lazily only when a Horizon theme is active.
Key Points
UnableToLoadhave no V5)AllIllustrations.jsDesign Decisions
Why V4 is imported directly, but V5 is lazy-loaded?
The current approach loads V4 SVGs directly and registers V5 as a lazy loader:
Why not import V5 directly too?
Why not make both V4 and V5 lazy?
This would require moving V4 assets to a dedicated
illustrations-v4/folder and restructuring the illustration files to only register loaders. However:import { dialogSvg } from "...tnt/NoApplications.js")