22// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33// See the LICENSE file in the project root for more information
44
5- using System . Diagnostics . CodeAnalysis ;
65using Elastic . Documentation ;
76using Elastic . Documentation . AppliesTo ;
87using Elastic . Documentation . Configuration . Versions ;
@@ -159,8 +158,10 @@ private static string BuildTooltipText(
159158 {
160159 var tooltipText = "" ;
161160
162- tooltipText = applicability . Version is not null && applicability . Version != AllVersionsSpec . Instance
163- ? applicability . Version . Min <= versioningSystem . Current
161+ // Check if a specific version is provided
162+ if ( applicability . Version is not null && applicability . Version != AllVersionsSpec . Instance )
163+ {
164+ tooltipText = applicability . Version . Min <= versioningSystem . Current
164165 ? $ "{ lifecycleFull } on { applicabilityDefinition . DisplayName } version { applicability . Version . Min } and later unless otherwise specified."
165166 : applicability . Lifecycle switch
166167 {
@@ -174,8 +175,21 @@ or ProductLifecycle.TechnicalPreview
174175 ProductLifecycle . Removed =>
175176 $ "We plan to remove this functionality in a future { applicabilityDefinition . DisplayName } update. Subject to change.",
176177 _ => tooltipText
178+ } ;
179+ }
180+ else
181+ {
182+ // No version specified - check if we should show base version
183+ tooltipText = versioningSystem . Base . Major != AllVersionsSpec . Instance . Min . Major
184+ ? applicability . Lifecycle switch
185+ {
186+ ProductLifecycle . Removed =>
187+ $ "Removed in { applicabilityDefinition . DisplayName } { versioningSystem . Base . Major } .{ versioningSystem . Base . Minor } .",
188+ _ =>
189+ $ "{ lifecycleFull } since { versioningSystem . Base . Major } .{ versioningSystem . Base . Minor } ."
177190 }
178- : $ "{ lifecycleFull } on { applicabilityDefinition . DisplayName } unless otherwise specified.";
191+ : $ "{ lifecycleFull } on { applicabilityDefinition . DisplayName } unless otherwise specified.";
192+ }
179193
180194 var disclaimer = GetDisclaimer ( applicability . Lifecycle , versioningSystem . Id ) ;
181195 if ( disclaimer is not null )
@@ -246,8 +260,15 @@ private static string BuildBadgeLifecycleText(
246260 /// </summary>
247261 private static string GetBadgeVersionText ( VersionSpec ? versionSpec , VersioningSystem versioningSystem )
248262 {
263+ // When no version is specified, check if we should show the base version
249264 if ( versionSpec is null || versionSpec == AllVersionsSpec . Instance )
265+ {
266+ if ( versioningSystem . Base . Major != AllVersionsSpec . Instance . Min . Major )
267+ return $ "{ versioningSystem . Base . Major } .{ versioningSystem . Base . Minor } +";
268+
269+ // Otherwise, this is an unversioned product, show no version
250270 return string . Empty ;
271+ }
251272
252273 var kind = versionSpec . Kind ;
253274 var min = versionSpec . Min ;
0 commit comments