Skip to content

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Sep 17, 2025

Part of #1709

Changes

  • Combine applies_to badges with the same key into one badge
  • Show the lifecycle that is closest to the current version.
  • The tooltip text is combined from both lifecycles.

Follow-ups

  • This is done in preparation for the new applies_to popover.

@reakaleek reakaleek requested a review from Copilot September 18, 2025 12:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR combines applies_to badges with the same key into a single badge to reduce redundancy in the UI. The combined badge shows the lifecycle closest to the current version and combines tooltip text from all lifecycles.

  • Combines multiple applies_to badges with identical keys into a single badge display
  • Implements primary applicability selection logic that prioritizes available versions over future ones
  • Modifies tooltip text to include combined information from all lifecycles

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ApplicableToViewModel.cs Adds badge combination logic and primary applicability selection
ApplicabilityRenderer.cs Implements combined tooltip text generation and primary selection
ApplicabilityItem.cs Updates record structure to support primary applicability
ApplicableToComponent.cshtml Updates template to use primary applicability
Test files Updates test expectations for combined badge behavior
ApplicabilityMappings.cs Minor formatting change

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…ector utility class

- Created new ApplicabilitySelector class in Elastic.Documentation.AppliesTo namespace
- Removed duplicated GetPrimaryApplicability method from ApplicabilityRenderer and ApplicableToViewModel
- Updated both classes to use the new utility class
- Improves code reusability and reduces duplication
- Moved ApplicabilitySelector from Elastic.Documentation to Elastic.Markdown.Myst.Components
- Added missing using statements for AllVersions and SemVersion
- All tests now pass successfully
…o domain layer

- Changed parameter from VersioningSystem to SemVersion currentVersion
- Moved ApplicabilitySelector back to Elastic.Documentation.AppliesTo namespace
- Updated callers to pass versioningSystem.Current
- Simplified interface and improved domain separation
- All tests pass successfully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants