Skip to content

API explorer: mark deprecated operations in the sidebar and in search - #4668

Merged
reakaleek merged 16 commits into
mainfrom
deprecate-ops-nav-search-84a4890c
Nov 6, 2026
Merged

reakaleek merged 16 commits into
mainfrom
deprecate-ops-nav-search-84a4890c

Conversation

@reakaleek

Copy link
Copy Markdown
Member

Why

What

  • A deprecated operation's sidebar row shows a struck-through, dimmed title and a grey method chip, in both the legacy and the design-system look. Screen readers hear "Deprecated" after the title.
  • A deprecated search result gets the same strike-through and grey chip, plus the page's outlined Deprecated badge beside the title.
  • The navigation search API returns deprecated for each hit, and one ApiOperation.Deprecated accessor feeds the page, the overview rows, the sidebar and the index.

Notes

  • Rows and results that are not deprecated render byte-identical to main. The visual check against main shows no diffs, and a nav tree's content hash only changes when the tree contains a deprecated leaf.
  • The sidebar row gets no extra chip on purpose: rows already wrap beside a single method chip at tablet width.
  • Search ranking is unchanged. A down-weight for deprecated operations is a possible follow-up.

🤖 Generated with Claude Code

reakaleek and others added 10 commits November 3, 2026 22:45
`ApiOperation.Deprecated` is now the one fact that the page badge, the
overview rows, the search exporter and the sidebar read. The renamed
`IApiOperationNavigationModel` exposes it, and `NavigationRenderNode`
projects it. The tree hash includes it only when set, so trees without a
deprecated leaf keep their cached `nav-tree-<hash>` id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A reader now sees that an operation is deprecated before opening it.
The row keeps its width: the title is struck through and dimmed like a
deprecated property, the method chip turns grey, and a hidden word keeps
the link name honest for screen readers. Rows that are not deprecated
render the same markup as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The design-system tree now marks a deprecated operation the same way as
the legacy sidebar. One `nav-tree__link--deprecated` modifier strikes the
title and greys the method badge through its tone tokens. A hidden word
names the state for screen readers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The index already stores `api.deprecated`, but the `_source` filter left
it out and the response had no field for it. Navigation search results
now carry `deprecated`, which is false for docs pages, so the search
card can mark a deprecated operation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A reader who finds a deprecated operation in search now sees the same
red "Deprecated" badge that its page shows, before clicking through.
The card reuses the global `.deprecated-badge` class. The schema keeps
`deprecated` optional, so an API and a frontend deployed at different
times still parse each other.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dge markup

The search card reused the filled chip the explorer draws on deprecated
parameters, so the same word looked different from the badge on the page
it links to. The card now emits the title badge's own classes and inherits
its outlined look from the same rules.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…o the chip's height

A search card now treats a deprecated operation like its sidebar row: the
title is struck through and dimmed and the method chip turns grey. The
page's outlined Deprecated badge stays beside the title, sized like the
method chip so it sits inside the title line instead of stretching the row.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The badge wrapper inherited the title's 24px line height and aligned its
content to the bottom of that box, so the badge sat 3.5px below the text
centre. As an atomic inline with its own line height it centres within 1px
and still stops the row's hover underline at the title text.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 3, 2026 22:46
@reakaleek
reakaleek requested a review from technige November 3, 2026 22:46
@reakaleek

Copy link
Copy Markdown
Member Author
image image

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

…rch-84a4890c

# Conflicts:
#	docs/data/openapi/api-explorer.md
#	src/Elastic.ApiExplorer/Export/OpenApiDocumentExporter.cs
#	src/Elastic.Documentation.Site/Assets/web-components/NavigationSearch/SearchResultsList.test.tsx
#	src/services/search/Elastic.Documentation.Search/DefaultSearchService.cs
#	src/services/search/Elastic.Documentation.Search/NavigationSearchService.cs
#	tests/Elastic.Documentation.Api.Tests/NavigationSearchServiceTests.cs
reakaleek and others added 3 commits November 6, 2026 13:18
…tion

Grey hid which method a retired operation used and made a deprecated GET
look like OPTIONS. A saturation filter keeps the hue readable while the
chip still reads as retired beside the struck title, on the sidebar in
both looks and on the search card. The docs page also gets back the
sidebar paragraph the merge resolution dropped.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… dialog

The header search and the design-system search dialog read the same
navigation-search endpoint as the sidebar search but dropped the
deprecated flag, so an operation found there still looked current. Both
now strike the title and show the page's Deprecated badge beside it, from
one shared badge component for the React lists and a data attribute plus
a hidden badge in the dialog's row template.

Per the Libra review on the pull request.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The badge primitive sets display: inline-flex, which outranks the hidden
attribute's default styling, so every search dialog row showed the badge.
A [hidden] rule on the badge, the same pattern the dialog's loading state
uses, keeps it hidden until drawResults removes the attribute.

Per the Libra review on the pull request.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The CloudFront host the test downloaded the Elasticsearch and Kibana
specs from stopped resolving on 2026-11-06, which fails CI on every
branch. The test now fetches the same object keys VersionIndexClient
builds from index.json, under its default base URI, and reads them
through the production reader so the Kibana YAML spec loads.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@reakaleek
reakaleek merged commit 1e61126 into main Nov 6, 2026
36 checks passed
@reakaleek
reakaleek deleted the deprecate-ops-nav-search-84a4890c branch November 6, 2026 13:10
reakaleek added a commit that referenced this pull request Nov 19, 2026
* Delete the unused _NavSelect partial and its menu styles

Nothing renders `_NavSelect.cshtml` or builds `NavigationSelectModel`. The
`.nav-select-dropdown`, `.nav-select-menu` and `.nav-select-option` rules only
styled that partial. The React `VersionDropdown` keeps the `.nav-select`
trigger rules it uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Delete the unreachable top-bar section dropdown

`_SecondaryNav.cshtml` renders its section dropdown only when
`NAVIGATION_PREVIEW` is on. With the flag on, every layout renders the
design-system header instead of `_AssemblerHeader`, and the page loads
`ds.js`, not `main.js`. So no page shows the dropdown, and its close-on-
outside-click, Escape and motion code in `secondary-nav.ts` never runs.

This removes the dropdown branch, its motion and overflow CSS, and that
code. `secondary-nav.ts` keeps the active-tab sync, and
`secondary-nav-dropdown.css` keeps the link rows the API hub menu uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Open data-hover menus on mouse hover and close menus after a link

A popover marked `data-hover` opens while a mouse rests on its button or
on the menu, and closes 150ms after the mouse leaves both. Touch and
keyboard still use the click. The design-system deployment info needs
this to leave its `details` element.

Choosing a link now closes the menu it is in. A boosted link already
closed it through the htmx swap, but a download or a new-tab link left
it open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Open the sidebar section menu as a popover beside its box

The legacy sidebar's section menu opened while its box had focus. It
hung below the box with `position: absolute` and put a link inside a
button. The link and the chevron are now separate controls: the
chevron opens a popover that `floating.ts` places under the whole box.
Escape, outside click and htmx navigation close it. The mousedown and
mouseup focus workaround in `pages-nav.ts` goes with the focus trick.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show the page jumper's results in a popover under its field

The results panel hung under the field with `position: absolute`, so
an ancestor's overflow could clip it. It is now a manual popover that
`floating.ts` places under the field through `data-anchor`, as wide as
the field. Focus stays in the field while the reader types, so the
script keeps closing the panel on Escape and on a click outside the
form. Without the Popover API the field stays a plain search form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Open every design-system menu as a popover placed by floating.ts

The docs bar dropdowns, link menus, deployment info, theme menu, split
button and applies-to badge were `details` elements or a checkbox. Each
hung its panel below with `position: absolute`, and `ds/menu.ts`,
`ds/popover.ts` and `ds/preferences.ts` each closed them in their own
way. They are now buttons that open popovers. The browser closes them
on Escape and a click outside, and `floating.ts` places them and keeps
them on screen.

- `LinkMenuModel` and the components that can appear more than once
  take an id, so each button opens its own menu.
- The deployment info opens on mouse hover through `data-hover`.
- The applies-to badge renders on many unrelated paths with no shared
  counter, so `ds/applies-popover.ts` gives each panel its id at bind
  time. Unbound, the panel still shows while its badge has focus.
- Without the Popover API the link menu shows its links inline.

`ds/menu.ts` and `ds/popover.ts` are deleted, and so are the theme
switch's checkbox and its dismissal code. The docs bar snapshots also
pick up the deprecated badge in the search result template, which
changed in #4668.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Describe the one menu pattern in the design-system docs

The style guide's decisions and `design-system.md` still said menus
were `details` elements. They now describe the popover button that
every menu uses, what `floating.ts` adds, and what a browser without
the Popover API shows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep a hovered menu open when its button is clicked

A mouse that rests on a `data-hover` button opens its menu, and the
click that usually follows toggled it shut again. The click now keeps
the menu open, and the menu then stays open after the mouse leaves,
until Escape or a click outside closes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Target the version menu button in the API browse journey

The version switcher is a LinkMenu button now, so the navigation-preview branch waited for a `summary` that no longer exists. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Rebind applies-to badges in the fullscreen table copy

The copy kept the original badge's panel id and popovertarget, so clicking it in the dialog opened the panel behind the dialog. Unbind the clone and bind it again once it is in the page. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Hold hover timers and hover state weakly in floating.ts

Neither collection ever dropped its menu keys, so menus an htmx swap detached stayed in memory for the page session. A WeakMap and a WeakSet release them with the element. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Reopen a hover menu only when the pointer arrives from outside

pointerover fires between the children of the button, so a click that closed a hover menu was undone by the next small mouse move. Skip the open when the pointer comes from the button or the menu. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Close a menu when one of its links is middle-clicked

A middle click opens the link in a new tab through auxclick, which the click listener never saw, so the menu stayed open on the original page. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Drop aria-haspopup="menu" from the link-list disclosures

The LinkMenu, DocsBar dropdowns and the legacy section picker open a plain list of links with no menu roles or arrow-key behaviour, so announcing a menu misled screen readers. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Let a click focus the unbound applies-to badge in Safari

Without the Popover API or script the panel shows only while the badge button has focus, and Safari does not focus a button on click. An explicit tabindex makes a mouse click open the panel there. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Reset aria-expanded on an unbound applies-to clone

A badge copied into the fullscreen table while open kept aria-expanded="true" although its panel starts closed. Unbinding now sets it back to false. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Release popover tracking when the fullscreen table closes

Removing an open popover fires no toggle, so a badge left open in the dialog kept Floating UI tracking a detached element until the next page swap. floating.ts now exports closePopoversWithin and the dialog calls it before removing itself. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Release removed popovers in the swap-time sweep again

closePopoversWithin skipped any tracked popover that was no longer in the page, so closeAll stopped releasing the ones a code path had removed while open. Removed popovers are now released whatever the root. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Cancel the hover-close timer when a popover closes

A timer started by leaving the button still ran after Escape closed the menu, so reopening it from the focused button within 150ms closed it again. The toggle handler now clears the timer. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Drop aria-haspopup="menu" from deployment info and the split button

Their panels are plain text and links with no menu roles or arrow-key behaviour, so announcing a menu misled screen readers. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Drop aria-haspopup="dialog" from the theme switch cog

The panel is a plain popover of radio groups with no dialog role or name, so announcing a dialog promised semantics it does not have. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Leave aria-expanded on popover buttons to the browser

A static aria-expanded="false" overrides the state the browser reports for a popovertarget button, so without script an open menu was announced as collapsed. The markup no longer carries it, and floating.ts sets it from the first toggle on. Addresses Libra review feedback on #4968.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Stop announcing the applies-to panel as a dialog

The panel is a plain popover with no dialog role or name, the same case as the theme switch cog. Follows the Libra review feedback on #4968.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

---------

Co-authored-by: Jan Calanog <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant