Repository navigation
Make Expand all and Collapse all drive the API responses accordion - #4999
Merged
Merged
Conversation
Collapse all now closes every response. Expand all opens one response with all its fields: the open one, or the one the page opens on load. Hovering a response header greys the whole response in the colour of its open body. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t (per review by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
||
| .response-summary:hover { | ||
| /* Hovering the header greys the whole response, in the colour of its open body. */ | ||
| .response-panel:has(> .response-summary:hover) { |
There was a problem hiding this comment.
Severity: P3 (Low)
Add a browser test for the response hover state with NAVIGATION_PREVIEW enabled. The accordion tests only check clicks and expansion state, so they would pass if hovering the header still highlighted only the header, or if hovering the response body also highlighted the whole panel.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4999/ |
akira28
approved these changes
Nov 23, 2026
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.
On API operation pages, Collapse all now closes every response. Expand all opens one response with all its fields. Hovering a response header greys the whole response.
Affects: API reference, Site UI
Prompt summary: Jan asks for the API docs responses to behave as a strict accordion. Only one response is open at a time, and clicking an open one closes it. Collapse all closes everything. Expand all opens only the first response, or the open one, with all its children. The hover state also moves from the header to the whole response, in the colour of the response body.
Why
The page's Expand all / Collapse all button skips responses. Collapse all leaves the open response open. Expand all opens the fields inside every response, including the closed ones, so a later click on a closed response shows fields that were opened behind the scenes. Hovering greys only the header row, in a colour that matches nothing else in the response.
What
Which disclosures the button acts on
Collapse all acts on every disclosure on the page, responses included. Expand all acts on a smaller set that leaves out every closed response except one target. The target is the open response, or else the one the page opens on load. The button label checks the smaller set, so it reads "Collapse all" once the target response and its fields are open.
The response the page opens on load
The server opens the response whose status sorts first, which can differ from spec order.
_ResponsesBlock.cshtmlmarks that panel withdata-api-response-default="true", so the client does not have to copyStatusSortKey. RazorSlices renders anullattribute value as an empty attribute here, so the marker uses explicit"true"and"false"values.Hover
Hovering a response header greys the whole response, body included, in the open body's colour. The colour is one custom property,
--response-body-bg, shared by the hover state, the open body and the expand toggle's label. Hovering only inside an open body does not grey it, because clicking there does not toggle the response. The navigation-preview layout gets the same hover inapi-reference.css, using--color-surface-sunken, its own token for the open body.Verify
mise run site:test dotnet test --project tests/Elastic.ApiExplorer.Tests mise run serveOn an operation with several responses, open a response other than the first and press Expand all. That response stays open with all its fields, and the others stay closed. Press Collapse all, then Expand all, and the first response opens.
Check on the preview
🤖 Generated with Claude Code