From c3eb2fe79fe25a6263a53041148994dfcbac39b4 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 28 May 2026 00:08:00 +0300 Subject: [PATCH] refactor(docs-infra): extract magic 27 in navigation-list tooltip threshold The matTooltip on navigation list items was disabled when the label was shorter than the literal `27`, repeated across four bindings in the template. Lift the value to a protected readonly field so the threshold has a name and lives in one place. --- .../navigation-list/navigation-list.component.html | 8 ++++---- .../navigation-list/navigation-list.component.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/adev/shared-docs/components/navigation-list/navigation-list.component.html b/adev/shared-docs/components/navigation-list/navigation-list.component.html index e37ae38ebf96..7e33f4b628a4 100644 --- a/adev/shared-docs/components/navigation-list/navigation-list.component.html +++ b/adev/shared-docs/components/navigation-list/navigation-list.component.html @@ -27,7 +27,7 @@ [href]="item.path" target="_blank" [matTooltip]="item.label" - [matTooltipDisabled]="itemLabel.length < 27" + [matTooltipDisabled]="itemLabel.length < labelTruncationThreshold" matTooltipPosition="after" [attr.aria-label]="item.label" [matTooltipClass]="'API-tooltip'" @@ -55,7 +55,7 @@ }" (click)="emitClickOnLink(item)" [matTooltip]="item.label" - [matTooltipDisabled]="itemLabel.length < 27" + [matTooltipDisabled]="itemLabel.length < labelTruncationThreshold" matTooltipPosition="after" [attr.aria-label]="item.label" [matTooltipClass]="'API-tooltip'" @@ -76,7 +76,7 @@
(); + protected readonly labelTruncationThreshold = 27; + private readonly navigationState = inject(NavigationState); private readonly crossCategoryOrigin = this.navigationState.crossCategoryOrigin;