Skip to content

fix(ui5-shellbar): fix badge misplacement of the ShellBar (2.15)#13864

Open
dobrinyonkov wants to merge 3 commits into
release-2.15.5from
downport/shellbar-badge-13212-2.15
Open

fix(ui5-shellbar): fix badge misplacement of the ShellBar (2.15)#13864
dobrinyonkov wants to merge 3 commits into
release-2.15.5from
downport/shellbar-badge-13212-2.15

Conversation

@dobrinyonkov

@dobrinyonkov dobrinyonkov commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Downport of #13212 to release-2.15.5.

Straight cherry-pick doesn't apply — the fix's selector .ui5-shellbar-action-button > [ui5-button-badge]… and ShellBarItem.css don't exist in 2.15. Reimplemented against 2.15's actual selectors (.ui5-shellbar-bell-button / .ui5-shellbar-custom-item) in ShellBar.css; badge offset / margin / notification-count-offset defined per theme.

Scope expanded to sap_horizon* variants — on 2.15 they exhibit the same misplacement, not just sap_fiori_3*.

Verified all 8 themes render the badge inside the shellbar bounds.

Fixes: #12962

Downport of #13212 adapted to the 2.15 ShellBar structure.

A plain cherry-pick was not possible: the fix's selector
(`.ui5-shellbar-action-button > [ui5-button-badge]…`) and its host file
`packages/fiori/src/themes/ShellBarItem.css` do not exist in 2.15 — the
ShellBar was refactored between 2.15 and the fix's era. The 2.15 badge is
positioned via `.ui5-shellbar-bell-button [slot="badge"]` and
`.ui5-shellbar-custom-item [slot="badge"]` in `ShellBar.css`.

Changes:

- `ShellBar.css`: add a `top` / `margin` override for the OverlayText badge
  on the bell button and the custom action items, driven by two new theme
  vars with Button-default fallbacks (`top: 0`, `margin: -0.5rem`) so themes
  without an override keep existing behavior. Also add a `0` fallback to
  the pre-existing `inset-inline-end` rules whose var was undefined.

- 4× sap_fiori_3* `ShellBar-parameters.css`: define the badge offset,
  margin and notification-btn-count-offset, matching #13212's values
  (`0.25rem` / `-0.25rem`; `-0.375rem` for hcb/hcw; count-offset `0`).

- 4× sap_horizon* `ShellBar-parameters.css`: same override applied — on
  2.15 the horizon shellbar exhibits the same misplacement (the badge sits
  outside the shellbar bounds with Button defaults), contrary to what
  issue #12962 reported for later versions. Same values as fiori_3.

Note on var names: the badge vars are authored with the v215-prefix
(`--_ui5-v2-15-5-shellbar-badge-*`) rather than plain names. This is
unusual — every other authored var in this package uses the plain form —
but `packages/fiori`'s theme parameter bundle does NOT apply the
version-prefix scoping pass that `packages/fiori`'s component CSS DOES
apply. Without the explicit prefix here, the compiled `ShellBar.css` rule
(which references the prefixed name) would not resolve the var and fall
back to Button defaults. Version-bound to 2.15.5, which is acceptable for
this frozen release.

Verified on all 8 themes at localhost:8080/…/ShellBarBadgeRepro.html
with `?sap-ui-theme=<theme>`: sap_horizon, sap_horizon_dark,
sap_horizon_hcb, sap_horizon_hcw, sap_fiori_3, sap_fiori_3_dark,
sap_fiori_3_hcb, sap_fiori_3_hcw. In each theme the notification-count
badge and custom-item count badge render fully inside the shellbar bounds.

Fixes: #12962
Refs: #13212
…oping

Revert the badge params from `--_ui5-v2-15-5-shellbar-badge-*` back to
`--_ui5-shellbar-badge-*`. The v215 version prefix is applied by the
framework's `scopeVariables` build step (packages/tools/lib/
css-processors/scope-variables.mjs) — hand-authoring the prefixed form
was unnecessary and would produce doubly-prefixed names in production.

No functional change from the previous commit: after the framework's
scoping pass the compiled output is identical. Only the authored source
is now consistent with every other var in the package (plain names).
…shellbar bounds

Guards against #12962: the OverlayText badge on the bell button and on
custom ShellBar items must sit inside the shellbar's vertical bounds
(no clipping at the top edge). Verifies both anchors that the fix
targets: .ui5-shellbar-bell-button and .ui5-shellbar-custom-item.
@PetyaMarkovaBogdanova
PetyaMarkovaBogdanova self-requested a review July 24, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants