-
Notifications
You must be signed in to change notification settings - Fork 34
Automate ordering of applies-switch tabs and badges #2437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 <[email protected]>
- 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 <[email protected]>
|
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 <[email protected]>
|
@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 <[email protected]>
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 |
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.