Repository navigation
API pages: use the docs breadcrumb - #4216
Conversation
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>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4216/ |
|
@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. |
There was a problem hiding this comment.
No actionable issues found.
What is this? | From workflow: PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
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>
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
Fixed in 08958d5 — BreadcrumbParents() now omits a parent whose URL matches the current page.
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>
|
@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 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>
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 |
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
Verify
dotnet test tests/Elastic.ApiExplorer.Tests/ --filter FullyQualifiedName~ApiBreadcrumb