Skip to content

Expand the API Topics sidebar heading by default - #4629

Merged
akira28 merged 2 commits into
feature/api-topic-pages-decidefrom
feature/api-topics-expanded
Oct 29, 2026
Merged

akira28 merged 2 commits into
feature/api-topic-pages-decidefrom
feature/api-topics-expanded

Conversation

@akira28

@akira28 akira28 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The API Topics sidebar heading now starts expanded on every page, so the topic pages are visible without a click. A sidebar group opts in through a new marker interface; every other group renders exactly as before.

Affects: Site UI, API reference

Prompt summary: Expand the Topics heading of the API sidebar by default. The PR that adds the Topics heading, #4628, is already large, so this change comes as its own PR on top of it.

Stack: 2 of 2, on top of #4628. Merge #4628 first.

Why

A sidebar group only opens on pages inside it. On the product overview or an operation page, the Topics heading is collapsed, so readers do not see pages such as Authentication or Rate limiting unless they open it. There is no way for a group to start open.

What

Groups that start expanded

A navigation node that implements ISidebarExpandedNavigationItem renders with its toggle checked and its subtree open, in the default and the preview navigation. The API Topics heading is the only group that opts in.

Unchanged output for every other group

The new attributes are written only for an expanded group, on the same line as the toggle's previous attribute. The flag also enters the sidebar content hash only when it is set. A collapsed group and the sidebar tree id are therefore byte-identical to main.

Client-side collapse

Changing to another section collapses every folder in the sidebar. A group marked data-nav-default-open now stays open through that reset.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/
# Generate_XTopics_WritesTopicPagesWithoutRedirects — on the landing page only the Topics toggle is checked
cd src/Elastic.Documentation.Site && npm run test
# collapseAllFolders: keeps a default-open group expanded

To confirm the flag-off site is unchanged:

cd src/Elastic.Documentation.Site
npm run visual:seed
npm run visual:check

Check on the preview

The Topics heading now starts expanded on every page, not only on pages
inside it. A sidebar group opts in through ISidebarExpandedNavigationItem: the
sidebar templates render its toggle checked and its subtree open, and
collapsing all folders on a section change leaves it open. Groups that do not
opt in render byte-identical to before, and so does each sidebar's tree id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28
akira28 added this pull request to stack #4631 October 29, 2026 08:44
@akira28
akira28 merged commit 8c9aa32 into main Oct 29, 2026
36 checks passed
@akira28
akira28 deleted the feature/api-topics-expanded branch October 29, 2026 08:49
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