Skip to content

Strike deprecated API operations everywhere and list them last - #4988

Merged
reakaleek merged 3 commits into
mainfrom
api-docs-strikethrough-c1457b4d
Nov 20, 2026
Merged

reakaleek merged 3 commits into
mainfrom
api-docs-strikethrough-c1457b4d

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

A deprecated API operation now looks the same on every list that links to it, and deprecated operations sort to the end of their group. A group whose every operation is deprecated is struck too, and its page shows the Deprecated badge.

Affects: API reference, Site UI

Prompt summary: An operation's name appears in search, the sidebar, the group and API landing pages, and on the operation page itself. It is struck through on some of those surfaces and not on others, and the ask is to make it consistent. The scope then grows to strike a group when all its operations are deprecated and to move deprecated operations to the bottom.

Why

The sidebar and search strike a deprecated operation's title, but the API landing page and the group pages do not. The same operation reads as retired in one list and current in the next. A fully deprecated group, such as Behavioral analytics, looks as current as any other while its sidebar folder is collapsed. Deprecated operations also sit in route order among current ones, so a reader scans past them to find what to use.

What

One rule for deprecated rows

Every row that links to a deprecated operation shows a struck, dimmed title and a method chip at lower saturation. This now covers the landing page list and the group page rows, which had the badge but no strike. The operation page keeps the badge only, with no strike on its title. API titles strike their own <s class="api-deprecated-title">. A row's hover underline then adds to the strike instead of replacing it. Rows without a visible badge also carry hidden "Deprecated" text for screen readers.

Retired groups

A group is deprecated when it has operations and every one of them is deprecated. One current operation keeps the group current. Such a group is struck in the sidebar folder and as its heading on the landing page, and its group page shows the Deprecated badge beside the title. OpenAPI tags have no deprecated field, so TagNavigationItem.Deprecated derives the state from the operations. The new IDeprecatableNavigationItem carries it to the sidebar renderers.

Deprecated operations list last

Within a group, current operations come first, then deprecated ones, each in route and method order. ApiOperationOrder.InListOrder holds the rule, so the sidebar, the group page and the landing page agree. Groups stay alphabetical, because readers find a group by its name.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
# ApiGroupDeprecationTests — order, group rule, sidebar folder, landing page and group pages
mise run serve

With mise run serve, open /api/elasticsearch/group/endpoint-analytics and hover a struck row. Both the strike and the underline show.

Check on the preview

The sidebar and search struck a deprecated operation's title, but the API
landing and group pages did not, so the same operation looked current in
one list and retired in another. Every row that links to a deprecated
operation is now struck and dimmed with a desaturated method chip, a group
whose every operation is deprecated is struck too, and deprecated
operations sort after current ones within a group.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 20, 2026 12:36
@reakaleek
reakaleek requested a review from akira28 November 20, 2026 12:36
@github-actions

Copy link
Copy Markdown
Contributor

reakaleek and others added 2 commits November 20, 2026 13:47
With NAVIGATION_PREVIEW on, pages load ds.css instead of api-docs.css, so a
deprecated row kept only the browser's strike on its title, at full opacity
and with a fully saturated method chip. Raised in review on #4988.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test rendered _TocTreeNav directly, which no page renders. It now goes
through _TocTree with the preview flag off (legacy sidebar) and on (the
design-system nav tree). The unused _TocTreeNav keeps its main-branch
markup. Raised in review on #4988.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek merged commit 7945b4a into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the api-docs-strikethrough-c1457b4d branch November 20, 2026 14:04
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.

1 participant