Skip to content

API pages: use the docs breadcrumb - #4216

Merged
reakaleek merged 5 commits into
mainfrom
simplify/api-breadcrumbs
Oct 6, 2026
Merged

reakaleek merged 5 commits into
mainfrom
simplify/api-breadcrumbs

Conversation

@reakaleek

@reakaleek reakaleek commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

API pages use the same breadcrumb as docs pages. The trail starts at the API catalog, names the spec, and sits outside the article so it keeps the docs styling.

Affects: API reference, Site UI

Prompt summary: API pages should use the docs breadcrumb, rendered from one shared partial. The trail should look and wrap the same way as on a docs page, including the space between the trail and the title. The trail should start with a link to the API catalog, the spec landing page should show a breadcrumb, and the spec root should use the spec name instead of Api Overview.

Why

API pages kept their own breadcrumb markup, including the current page and a collapse menu. After they switched to the shared partial, the trail still sat inside the article. Unlayered markdown list and link rules then painted it. On a short page the examples grid also stretched the breadcrumb row to fill the viewport, so the gap above the title grew. The spec landing page had no trail, deeper pages labeled the spec root "Api Overview", and a parent could link to the current page.

What

  • API, docs, and Codex pages render one shared breadcrumb partial.
  • The visible trail is the parent links only. The page head JSON-LD still includes the current page.
  • The trail sits outside the article, so markdown styles do not reach it.
  • The gap above the title stays the same on short and long pages.
  • The first crumb links to the API catalog. The spec root uses the spec title. The spec landing page shows that catalog crumb. A parent whose URL is the current page is left out.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/ --filter FullyQualifiedName~ApiBreadcrumb

API pages had a separate trail that collapsed with a resize observer. The same parent links as docs pages are enough.

Co-Authored-By: Grok <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek
reakaleek requested a review from a team as a code owner September 23, 2026 11:10
@reakaleek
reakaleek requested a review from itsalexcm September 23, 2026 11:15
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview (local build)

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

@reakaleek

Copy link
Copy Markdown
Member Author

@itsalexcm IMO it may still be valid to add the current item to the breadcurmbs, but we should align this and use the same for all.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable issues found.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@reakaleek
reakaleek marked this pull request as draft September 23, 2026 11:20
Markdown list and link rules were painting the shared trail, and short pages stretched the gap above the title.

Co-Authored-By: Grok 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek
reakaleek marked this pull request as ready for review September 23, 2026 11:52

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for the breadcrumb self-link regression noted inline.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

return [.. parents];
}

public INavigationItem[] BreadcrumbParents() => navigationItem.GetParents().Reverse().ToArray();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] Self-link can leak into parents-only breadcrumbs

BreadcrumbParents() now returns all ancestors verbatim, but API index leaves can have a parent with the same URL as the current page (for example landing/index nodes). In that case this includes a breadcrumb item that links to the current page, which violates the new "parents only" behavior and regresses the previous API filtering.

Please filter out ancestors whose URL matches the current item URL when building breadcrumb parents for rendering/JSON-LD.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 08958d5 — BreadcrumbParents() now omits a parent whose URL matches the current page.

@reakaleek
reakaleek marked this pull request as draft September 23, 2026 12:20
The spec landing page had no trail, and deeper pages labeled the spec root "Api Overview". The trail now starts at the catalog and uses the spec title. Parents that link to the current page are omitted.

Co-Authored-By: Grok 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek
reakaleek marked this pull request as ready for review October 1, 2026 08:07
@reakaleek

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	tests/Elastic.ApiExplorer.Tests/ApiBreadcrumbBuilderTests.cs
#	tests/Elastic.ApiExplorer.Tests/ApiBreadcrumbsRenderingTests.cs

Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>

Copilot AI commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 7fb249c. Merged main and kept this PR's breadcrumb implementation/tests, updated to the TUnit syntax main adopted in the meantime. Full Elastic.ApiExplorer.Tests suite (491 tests) passes, including the 14 breadcrumb tests.

@reakaleek

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	src/Elastic.ApiExplorer/Infrastructure/ApiViewModel.cs
#	src/Elastic.ApiExplorer/_Layout.cshtml
#	src/Elastic.Documentation.Site/Assets/api-docs.css

Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>

Copilot AI commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in b3f249d. Merged main and reconciled this PR's breadcrumb-outside-article design with main's unrelated restructuring (examples panel moved inside the article in #4283, code-block CSS consolidated into a shared stylesheet in #4295). Full Elastic.ApiExplorer.Tests suite (513 tests) passes.

@reakaleek
reakaleek merged commit f61435f into main Oct 6, 2026
37 checks passed
@reakaleek
reakaleek deleted the simplify/api-breadcrumbs branch October 6, 2026 12:07
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.

3 participants