Skip to content

fix(ui5-shellbar-item): render overflow badge via additionalText with text wrapping - #13849

Draft
plamenivanov91 wants to merge 5 commits into
mainfrom
badge-visual-update-in-shellbar
Draft

fix(ui5-shellbar-item): render overflow badge via additionalText with text wrapping#13849
plamenivanov91 wants to merge 5 commits into
mainfrom
badge-visual-update-in-shellbar

Conversation

@plamenivanov91

@plamenivanov91 plamenivanov91 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Replace the CSS ::after pseudo-element approach for the count badge on
ShellBarItem overflow list items with a proper API-based implementation.

  • ShellBarItemTemplate: use text prop and wrappingType="Normal" on
    ListItemStandard so long item labels wrap correctly; pass count as
    additionalText — an internal implementation detail within ShellBarItem
    that can be revisited if ListItemStandard gains a dedicated trailing slot
  • ShellBarItem.css: style [ui5-li]::part(additional-text) as a badge
    pill using SAP badge design tokens; !important on background, color,
    and text-shadow overrides ListItemStandard's active-state rule which
    targets the internal class with higher specificity; align-self: center
    keeps the badge vertically centered against multi-line text
  • ShellBarPopover.css: remove duplicate [ui5-li]:after block — dead code
    since ShellBar's shadow root cannot pierce two shadow levels into
    ListItemStandard's internals through ShellBarItem
  • ShellBar.html: add three Figma badge scenario samples — badge visible in
    bar, one badged item overflowed (counter on overflow button), multiple
    badged items overflowed (attention dot on overflow button)
  • ShellBar.cy.tsx: update overflow badge tests to assert on the
    additional-text attribute instead of the removed badge span class

Fixes: #12490
JIRA: BGSOFUIPIRIN-7082

…ead of CSS ::after

Replace the fragile CSS pseudo-element approach for the count badge on
ShellBarItem overflow list items with a proper semantic implementation:

- ShellBarItemTemplate: pass `count` as `additionalText` on ListItemStandard
  instead of `data-count`; the component renders it inline after the title
  text, exactly matching the Figma spec placement (before the trailing arrow)
- ShellBarItem.css: drop `[ui5-li]:after` / `[ui5-li][data-count]:after` rules;
  add `[ui5-li]::part(additional-text)` to style the badge pill using SAP
  design tokens (sapContent_BadgeBackground, sapFontBoldFamily,
  _ui5_shellbar_button_badge_border)
- ShellBarPopover.css: remove duplicate `[ui5-li]:after` block ? it was dead
  code because ShellBar's shadow root cannot pierce two shadow levels into
  ListItemStandard's internals through ShellBarItem
- ShellBar.html: add three Figma badge scenario samples ? badge visible in
  bar, one badged item overflowed (counter on overflow button), multiple
  badged items overflowed (attention dot on overflow button)
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

…em text

Replace the CSS ::after pseudo-element approach for the count badge on
ShellBarItem overflow list items with a dedicated shadow DOM span that
sits immediately after the item text ? matching the Figma spec placement.

- ShellBarItemTemplate: render <span class="ui5-shellbar-item-text"> and
  <span class="ui5-shellbar-item-badge"> as slotted children of
  ListItemStandard instead of using additionalText; the badge span lives
  in ShellBarItem's shadow DOM so ListItem.css active-state color overrides
  cannot reach it ? no !important needed
- ShellBarItem.css: replace [ui5-li]:after / [ui5-li][data-count]:after
  rules with ::part(title) flex layout and .ui5-shellbar-item-badge pill
  styles using SAP badge design tokens
- ShellBar.html: add three Figma badge scenario samples ? badges visible
  in bar, one badged item overflowed (counter on overflow button), multiple
  badged items overflowed (attention dot on overflow button)
- ShellBar.cy.tsx: add two tests covering overflow badge span rendering
  and count update propagation; mount ShellBarItem standalone to prevent
  ShellBar overflow logic from resetting inOverflow mid-test
@plamenivanov91 plamenivanov91 changed the title fix(ui5-shellbar-item): render overflow badge via additionalText instead of CSS ::after fix(ui5-shellbar-item): render overflow badge as inline span after item text Jul 21, 2026
… text wrapping

Replace the CSS ::after pseudo-element approach for the count badge on
ShellBarItem overflow list items with a proper API-based implementation:

- ShellBarItemTemplate: use `text` prop + `wrappingType="Normal"` on
  ListItemStandard for proper text wrapping on long item labels; pass
  `count` as `additionalText` ? an internal implementation detail of
  ShellBarItem that can be revisited if ListItemStandard gains a
  dedicated trailing slot
- ShellBarItem.css: style `[ui5-li]::part(additional-text)` as a badge
  pill using SAP badge design tokens; use `!important` on background,
  color, and text-shadow to override ListItemStandard's active-state
  color rule which targets the internal class directly; `align-self:
  center` keeps badge vertically centered against multi-line text
- ShellBarPopover.css: remove duplicate `[ui5-li]:after` block ? was
  dead code since ShellBar's shadow root cannot pierce two shadow levels
  into ListItemStandard
- ShellBar.cy.tsx: update overflow badge tests to assert on
  `additional-text` attribute instead of the removed badge span class
- ShellBar.html: add three Figma badge scenario samples

Fixes: #12490
JIRA: BGSOFUIPIRIN-7082
@plamenivanov91 plamenivanov91 changed the title fix(ui5-shellbar-item): render overflow badge as inline span after item text fix(ui5-shellbar-item): render overflow badge via additionalText with text wrapping Jul 28, 2026
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.

[Shellbar]: Notifications in the overflow menu doesn't appear correct

1 participant