Automate ordering of applies-switch tabs and badges#2437
Draft
Automate ordering of applies-switch tabs and badges#2437
Conversation
- Created ApplicableToOrderComparer to sort ApplicableTo objects - Updated AppliesSwitchBlock to automatically sort applies-items - Updated ApplicableToViewModel to sort badges with unavailable last - Updated deployment mappings to follow correct order - Ordering rules: serverless first, then stack (latest to oldest), then deployments (ech, ece, eck, self-managed), unavailable last Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>
- Added ApplicabilitySwitchOrderingTests to verify serverless first, then stack latest to oldest - Added UnavailableLastOrderingTests to verify unavailable lifecycle items appear last - Added DeploymentOrderingTests to verify deployment order (ech, ece, eck, self-managed) - All 17 ApplicabilitySwitch tests pass Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>
|
Label error. Requires exactly 1 of: automation, breaking, bug, changelog:skip, chore, ci, dependencies, documentation, enhancement, feature, fix, redesign. Found: |
- Updated expected HTML in ApplicableToComponent.fs tests - Deployment badges now ordered: ECE before ECK (matching ech, ece, eck, self order) Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automation for ordering applies-switch tabs and badges
Automate ordering of applies-switch tabs and badges
Jan 8, 2026
Member
|
@copilot Also reflect these changes in the appropriate docs |
- Added "Automatic ordering" section to applies-switch.md explaining ordering rules - Updated "Rendering order" section in applies.md to reflect new ordering (serverless first, stack latest-to-oldest, deployment order, unavailable last) - Added examples showing how tabs reorder automatically - Added cross-references between docs Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>
Contributor
Author
Documentation has been updated in commit 4cc5445:
Both files now explain the automatic ordering feature with clear examples showing how tabs reorder regardless of source file order. |
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
🔍 Preview links for changed docs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writers must manually order applies-switch tabs and badges according to documentation standards (serverless first, stack latest-to-oldest, specific deployment order). This is error-prone and inconsistent.
Changes
Core sorting logic (
src/Elastic.Documentation/AppliesTo/ApplicableToOrderComparer.cs)IComparer<ApplicableTo?>implementing standard ordering:Automatic tab ordering (
src/Elastic.Markdown/Myst/Directives/AppliesSwitch/AppliesSwitchBlock.cs)FinalizeAndValidate()now sortsapplies-itemchildren viaSortAppliesItems()Badge ordering (
src/Elastic.Markdown/Myst/Components/ApplicableToViewModel.cs)GetApplicabilityItems()orders badges with unavailable lastTests
Documentation (
docs/syntax/applies-switch.md,docs/syntax/applies.md)Example
Before (manual ordering required):
:::::{applies-switch} ::::{applies-item} stack: ga 8.11 Old version :::: ::::{applies-item} serverless: ga Should be first :::: ::::{applies-item} stack: preview 9.1 Newer version :::: :::::After (automatic reordering):
Renders as: Serverless → Stack 9.1 → Stack 8.11
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.