Skip to content

fix(ui5-shellbar-item): render overflow badge as inline span after item text#13849

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

fix(ui5-shellbar-item): render overflow badge as inline span after item text#13849
plamenivanov91 wants to merge 3 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 dedicated shadow DOM span placed
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; the badge span lives in ShellBarItem's own shadow DOM
    so ListItem.css active-state color overrides cannot reach it — no
    !important needed, no cross-package changes required
  • 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
  • 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: add two tests covering overflow badge span rendering and
    count update propagation

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
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