Skip to content

Show open API nodes as nested boxes instead of guide lines - #4493

Draft
akira28 wants to merge 8 commits into
mainfrom
api-explorer-nested-boxes
Draft

akira28 wants to merge 8 commits into
mainfrom
api-explorer-nested-boxes

Conversation

@akira28

@akira28 akira28 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Open nodes in an API schema now sit in nested outlined boxes, so the open path through a deep schema reads from the outlines.

Affects: API reference

Prompt summary: Work on elastic/docs-eng-team#1072. In deeply nested oneOf/anyOf and object schemas, it is hard to tell which nodes are open and where you are. Prototype boxes with outlines only, in the greys the other panels use, and put the result on a draft PR for the preview.

Why

An open node draws a thin guide line that ends at its last child. With five or six levels open, the lines run together and nothing marks which node you are inside.

What

Boxes replace guide lines

An open object row or union variant is outlined in --color-grey-20, and its "hide properties" toggle is the header of that box. The guide lines and L-connectors are hidden. Each level indents by 0.25rem plus its border and padding, less than the old 1.25rem per level.

Innermost open box

The deepest open box in a chain gets a darker --color-grey-60 outline. It marks where the reader is.

Verify

npm ci && npm run build   # in src/Elastic.Documentation.Site
dotnet run --project src/tooling/docs-builder -- serve
# open an operation, open a section, then open nested properties

Check on the preview

  • Elasticsearch: Run a search — open the request body, then inner_hits and docvalue_fields: each open node is a box, the innermost has the darker outline.
  • Kibana: Create a case — union variants behind chips fold into boxes the same way.

The guide line stops at each open node, so the open path through a deep schema is hard to follow. An open node now sits in an outlined box headed by its toggle, and the innermost open box gets a darker border.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A folded toggle now has the box's margin, padding and border under a transparent border, so opening it no longer nudges the toggle sideways.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4493/

The toggle label now interrupts the top line of its box, like a fieldset legend, instead of sitting in a header row above the contents. The row keeps one height folded or open, so the toggle stays put.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The first row's own top padding left about 20px under the top edge against 9px above the bottom edge. The gap under the top edge is now 13px and the bottom gap 12px.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reference link still drew the old L-shaped branch, which leads nowhere now that open nodes sit in boxes. It stays above the toggle and lines up with the toggle's icon.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
akira28 and others added 2 commits October 16, 2026 15:43
Measured from the line the toggle sits on, the first row started 26px below it and the last ended 12px above the bottom edge. Both gaps are now 16px.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The gap between a box's top edge and its first row, and between its last row and the bottom edge, grows from 16px to 20px.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A reference link with no toggle below it sat indented as if it hung from the toggle. It now starts at the description's left edge.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lcawl

lcawl commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

This kind of reminds me of what we used to do in the manually-maintained API docs (e.g. https://www.elastic.co/guide/en/elasticsearch/reference/8.15/ml-put-job.html). Which I think we eventually had a problem with where something becomes so deeply nested that you can't represent it any more (i.e. you run out of room for the boxes). So as long as there's some way of automating / controlling when you point to objects in the "Types" section instead, this is seems fine to me.

@akira28

akira28 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

This kind of reminds me of what we used to do in the manually-maintained API docs (e.g. https://www.elastic.co/guide/en/elasticsearch/reference/8.15/ml-put-job.html). Which I think we eventually had a problem with where something becomes so deeply nested that you can't represent it any more (i.e. you run out of room for the boxes). So as long as there's some way of automating / controlling when you point to objects in the "Types" section instead, this is seems fine to me.

do you have some extreme nesting example?

This branch was successfully deployed

2 active deployments
docs-preview — c347419b Deployed Oct 16, 2026 by github-actions[bot]
assembler-preview — c347419b Deployed Oct 16, 2026 by github-actions[bot]
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.

2 participants