Skip to content

Share one base class for API page sidebar entries - #4630

Merged
akira28 merged 1 commit into
feature/api-topics-expandedfrom
feature/api-page-nav-item-base
Oct 29, 2026
Merged

akira28 merged 1 commit into
feature/api-topics-expandedfrom
feature/api-page-nav-item-base

Conversation

@akira28

@akira28 akira28 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The sidebar entries of API operation, type, topic, and Authentication or Servers pages now extend one base class and only decide their own URL. Nothing renders differently.

Affects: Internals only

Prompt summary: Share more code between the Topics and Types parts of the API sidebar. Most of what the two still repeat is in the sidebar entry of each page, which every API page kind wrote out by hand. That refactor touches classes from before the topics work, so it comes as its own PR on top of the stack.

Stack: 3 of 3, on top of #4629, which is on top of #4628. Merge those first.

Why

Four sidebar entry classes repeat the same eight members: the navigation root, the model, the URL, the title, whether the entry is hidden, the parent, the navigation index, and an id derived from the URL. Only the URL differs between them. A change to how API page entries behave has to be made four times.

What

One base for page entries

ApiPageNavigationItem<TModel> holds the shared members. Operation, type, topic, and Authentication or Servers entries extend it and pass in their URL and title. Their public constructors keep their signatures, so no caller changes.

Hidden stays where it was

Entries are visible unless they say otherwise. The Authentication and Servers entry stays hidden by default, and the Authentication page built from a topic stays listed. Hidden is now set only at construction, which matches how every caller already used it.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/

A build of all API products from the live specs with this branch and with #4629 produces byte-identical output.

The sidebar entries of operation, type, topic, and Authentication or Servers
pages each wrote out the same leaf members, with Id derived from the URL. They
now extend ApiPageNavigationItem and only decide their URL. The generated API
output is byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28 akira28 added the chore label Oct 28, 2026
@akira28
akira28 requested a review from a team as a code owner October 28, 2026 18:08
@akira28
akira28 requested a review from theletterf October 28, 2026 18:08
@akira28
akira28 added this pull request to stack #4631 October 29, 2026 08:44
@akira28
akira28 merged commit 3472c8d into main Oct 29, 2026
42 checks passed
@akira28
akira28 deleted the feature/api-page-nav-item-base branch October 29, 2026 08:49
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.

2 participants