Skip to content

Restore tooltips on si-navbar-vertical and si-content-action-bar#2034

Open
fabrice-aeschbacher wants to merge 1 commit into
siemens:mainfrom
fabrice-aeschbacher:feat/menuitem-tooltip
Open

Restore tooltips on si-navbar-vertical and si-content-action-bar#2034
fabrice-aeschbacher wants to merge 1 commit into
siemens:mainfrom
fabrice-aeschbacher:feat/menuitem-tooltip

Conversation

@fabrice-aeschbacher

Copy link
Copy Markdown

MenuItem from @simpl/element-ng/menu has been deprecated in v47.0.0, but the new implementation removed the tooltips. This patch restores the feature, while fully respecting the new implementation in case no optional tooltip is given.

@fabrice-aeschbacher fabrice-aeschbacher requested review from a team as code owners May 11, 2026 09:30
@CLAassistant

CLAassistant commented May 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a tooltip property to menu and navbar models and updates the content action bar and vertical navbar components to display these tooltips. Documentation was also added to outline best practices for tooltip accessibility. Feedback focuses on improving documentation phrasing and optimizing the siTooltip implementation in the content action bar by using the [isDisabled] input to prevent redundant ARIA attributes and tooltip instances.

Comment thread docs/components/buttons-menus/content-actions.md Outdated
Comment thread docs/components/buttons-menus/menu.md Outdated
[attr.data-id]="primaryAction.id"
[attr.aria-label]="primaryAction.label | translate"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : ''"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the general rules, the siTooltip directive should be disabled using the [isDisabled] input instead of setting the content to an empty string. This prevents the creation of unnecessary tooltip instances and ARIA attributes.

Suggested change
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"
[siTooltip]="(primaryAction.iconOnly ? primaryAction.label : (primaryAction.tooltip ?? '')) | translate"
[isDisabled]="!primaryAction.iconOnly && !primaryAction.tooltip"
References
  1. To disable the siTooltip directive, use the [isDisabled] input. Avoid setting the content to an empty string, as this still creates a tooltip instance with ARIA attributes.

[attr.data-id]="primaryAction.id"
[attr.aria-label]="primaryAction.label | translate"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : ''"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the general rules, the siTooltip directive should be disabled using the [isDisabled] input instead of setting the content to an empty string.

Suggested change
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"
[siTooltip]="(primaryAction.iconOnly ? primaryAction.label : (primaryAction.tooltip ?? '')) | translate"
[isDisabled]="!primaryAction.iconOnly && !primaryAction.tooltip"
References
  1. To disable the siTooltip directive, use the [isDisabled] input. Avoid setting the content to an empty string, as this still creates a tooltip instance with ARIA attributes.

[attr.data-id]="primaryAction.id"
[attr.aria-label]="primaryAction.label | translate"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : ''"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the general rules, the siTooltip directive should be disabled using the [isDisabled] input instead of setting the content to an empty string.

Suggested change
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"
[siTooltip]="(primaryAction.iconOnly ? primaryAction.label : (primaryAction.tooltip ?? '')) | translate"
[isDisabled]="!primaryAction.iconOnly && !primaryAction.tooltip"
References
  1. To disable the siTooltip directive, use the [isDisabled] input. Avoid setting the content to an empty string, as this still creates a tooltip instance with ARIA attributes.

[attr.data-id]="primaryAction.id"
[attr.aria-label]="primaryAction.label | translate"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : ''"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the general rules, the siTooltip directive should be disabled using the [isDisabled] input instead of setting the content to an empty string.

Suggested change
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"
[siTooltip]="(primaryAction.iconOnly ? primaryAction.label : (primaryAction.tooltip ?? '')) | translate"
[isDisabled]="!primaryAction.iconOnly && !primaryAction.tooltip"
References
  1. To disable the siTooltip directive, use the [isDisabled] input. Avoid setting the content to an empty string, as this still creates a tooltip instance with ARIA attributes.

[attr.data-id]="primaryAction.id"
[attr.aria-label]="primaryAction.label | translate"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : ''"
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the general rules, the siTooltip directive should be disabled using the [isDisabled] input instead of setting the content to an empty string.

Suggested change
[siTooltip]="primaryAction.iconOnly ? (primaryAction.label | translate) : (primaryAction.tooltip ?? '' | translate)"
[siTooltip]="(primaryAction.iconOnly ? primaryAction.label : (primaryAction.tooltip ?? '')) | translate"
[isDisabled]="!primaryAction.iconOnly && !primaryAction.tooltip"
References
  1. To disable the siTooltip directive, use the [isDisabled] input. Avoid setting the content to an empty string, as this still creates a tooltip instance with ARIA attributes.

@spliffone

spliffone commented May 16, 2026

Copy link
Copy Markdown
Member

@panch1739 Can you have a look here, if we want to have a tooltip in the components I can support Fabrice here

@spliffone spliffone added the core-team-discussion Topics that should be discussed in the core team meeting label May 18, 2026
@kfenner kfenner removed the core-team-discussion Topics that should be discussed in the core team meeting label May 18, 2026
MenuItem from @simpl/element-ng/menu has been deprecated in v47.0.0, but
the new implementation removed the tooltips. This patch restores the
feature, while fully respecting the new implementation in case no optional
tooltip is given.

Closes siemens#1259

Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher@siemens.com>
Reviewed-by: Gwendoline Goetz <gwendoline.goetz@siemens.com>
@spike-rabbit spike-rabbit added this to the 51.x milestone Jul 8, 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.

5 participants