feat(ui5-shellbar): enhance responsive behaviour for custom branding - #14015
Open
NakataCode wants to merge 2 commits into
Open
feat(ui5-shellbar): enhance responsive behaviour for custom branding#14015NakataCode wants to merge 2 commits into
NakataCode wants to merge 2 commits into
Conversation
NakataCode
temporarily deployed
to
netlify-preview
September 2, 2026 07:48 — with
GitHub Actions
Inactive
|
🚀 Deployed on https://pr-14015--ui5-webcomponents-preview.netlify.app |
NakataCode
temporarily deployed
to
netlify-preview
September 2, 2026 08:01 — with
GitHub Actions
Inactive
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.
Summary
The ShellBar previously hid the product identifier regardless of available space. Customers (e.g. Bayer) need the identifier visible as long as possible. This POC replaces that approach with a fully space-aware overflow loop that progressively hides branding elements only when there is no other option.
Overflow order
Actions (rightmost first) → content items → search button → branding stacks (
3500) → branding identifier (4000) → branding logo (5000).The logo is always the last element hidden.
Stacked mode (new)
When a long product identifier (natural width) causes overflow, a new virtual
branding-stackedhidable item (priority3500) triggers column layout — logo on top, title below — before the identifier is moved to overflow. Stacking is driven bytoggleAttribute("_stacked")on the branding host element (non-reactive) from inside the overflow loop. A synchronous layout flush (offsetWidthread) forces the browser to reflect the new width before the overflow loop continues measuring.Branding in overflow popover (new)
When the identifier or logo is hidden, a branding entry appears at the top of the overflow popover (
order: -1, always first). It renders only the hidden parts — logo as<img>, identifier as text following it. Clicking firesbrandingEl._fireClick()and closes the popover. Thearia-labelis"<title> Home", falling back for logo-only branding.Title wrapping
-webkit-line-clamp: 2replaceswhite-space: nowrap+text-overflow: ellipsis, allowing the title to wrap to two lines before stacking kicks in. Font changed from--_ui5_shellbar_menu_button_title_font_sizeto--sapFontHeader6Sizeper the spec token.Content slot priority (new)
data-hide-order="N": explicit numeric priority — these hide first. Items without it default to reverse insertion order (last added hides first).data-never-hide: item is never removed from the DOM but is still reported inhiddenItemsIdsand fires hide events, so products can show a compact alternative via an event handler.Branding DOM position
The branding area div was previously rendered outside the overflow container, making it invisible to the overflow loop's
offsetWidthmeasurement. It is now the first child inside.ui5-shellbar-overflow-inner, so hiding the identifier or logo actually reducesoverflowInner.offsetWidth.Actions alignment
justify-content: endremoved from the inner overflow container.margin-inline-end: autoadded to the branding element to push actions to the right while keeping branding left-aligned as a natural flex child.Removed
_isSBreakPointproperty onShellBarBrandingand the sync code inShellBar.onAfterRenderingthat set it._updateStackedState/_observeTitleSize/onEnterDOM/onExitDOM/onAfterRenderingfromShellBarBranding. Stacking is now fully controlled externally by the overflow loop via non-reactive host attributes (_stacked,_identifier-hidden,_logo-hidden,_measure-title-hidden,_measure-logo-hidden).Test page
Added
ShellBarBranding.htmlwith 12 spec scenarios covering: basic branding, branding + actions, long title stacking, content items, full cascade, badge behaviour, overflow popover, logo-only, and profile/product-switch always-visible cases. Includes a scenario reference table.No Cypress tests written — this is a POC branch