Skip to content

feat(docs-ui): OpenAPI overview at docs root + open active protocol#157

Merged
filipeforattini merged 2 commits into
mainfrom
feat/docs-root-overview
Jun 25, 2026
Merged

feat(docs-ui): OpenAPI overview at docs root + open active protocol#157
filipeforattini merged 2 commits into
mainfrom
feat/docs-root-overview

Conversation

@filipeforattini

Copy link
Copy Markdown
Member

What

The docs root (/docs) is ours to define but was showing "Page not found" (the root path / is truthy, so it hit the 404 surface and the sidebar early-returned).

Now the root:

  • renders an OpenAPI overview (ReDoc-style): title + version badge, contact/license, servers list from spec.servers, and info.description as markdown — then the endpoint list.
  • opens on the logical protocol (http > graphql > websocket > jsonrpc > grpc > streams > tcp > udp) and lists its endpoints in the sidebar expanded, with the active protocol tab highlighted.

A genuine non-root missing path still shows "Page not found".

renderDocsOverview() reads only from the in-page spec (no new module imports → inline + external delivery unaffected).

Tests

test/docs/root-overview.int.test.ts evals the bundled runtime in jsdom: root shows the overview, lists HTTP endpoints (not collapsed), HTTP tab active, tabs ordered by priority, and real missing paths still 404. Full suite 3388/3388, tsc clean.

🤖 Generated with Claude Code

… found'

The docs root (/docs) is ours to define, but it was routing to the
404 surface ('/ does not exist') because parseRouteHash returns the
canonical '/' for the root and renderContent treated any non-empty
activePagePath as a page lookup that missed.

Now the root renders an OpenAPI-driven landing (ReDoc-style):
- title + version badge
- contact / license line (when present)
- servers list straight from spec.servers
- info.description rendered as markdown
followed by the existing endpoint list. A genuine non-root path with
no matching page still shows 'Page not found'.

renderDocsOverview() reads only from the in-page spec (no new module
imports, so inline + external delivery are both unaffected). Adds
.docs-overview* styles to the content style-section.

Regression test in test/docs/root-overview.int.test.ts evals the
bundled runtime in jsdom and asserts the root shows the overview
(title/version/servers/description/contact), degrades to just a title
when info/servers are absent, and still 404s a real missing path.
…xpanded nav

Two UX fixes for the docs root (/docs):

1. The sidebar was empty at root because renderSidebar early-returned
   on any truthy activePagePath — and the root path is '/' (truthy).
   Now the root renders the active protocol's endpoint groups, expanded
   (appendSidebarGroup already defaults to expanded). The same '/'
   truthiness left the protocol tab un-highlighted; fixed via isRoot.

2. Protocol order is now a logical priority — http > graphql > websocket
   > jsonrpc > grpc > streams > tcp > udp — so the docs open on what a
   consumer most likely came to read (HTTP when present), and the tab
   order follows the same priority instead of detection order.

Extends test/docs/root-overview.int.test.ts: at root the HTTP endpoints
are listed and not collapsed, the HTTP tab is active, and tabs order by
priority (http first, graphql before udp).
@filipeforattini filipeforattini merged commit 46223d0 into main Jun 25, 2026
2 checks passed
@filipeforattini filipeforattini deleted the feat/docs-root-overview branch June 25, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant