Skip to content

feat: add the API docs page - #1643

Draft
jubianchi wants to merge 2 commits into
dev-null-sh:productionfrom
jubianchi:feat/api-docs-shell
Draft

jubianchi wants to merge 2 commits into
dev-null-sh:productionfrom
jubianchi:feat/api-docs-shell

Conversation

@jubianchi

@jubianchi jubianchi commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Depends on #1642, still open. Until it merges, this diff also shows its changes; this pull request's own changes.

Summary

The v1 API had no public page. This adds /docs/api, readable by everyone, on the console shell from #1642, with its first guide: the Introduction. Part of #857 (it documents the v1 API, not /api/cli), and second of five pull requests splitting #1533.

Changes

  1. Page. /docs/api redirects to /docs/api/introduction; a section the docs don't have is the not found page. ApiDocsSection lists the sections, ApiDocsController renders one with its preview metadata.
  2. Introduction. What the API is for, its base URL, format and Accept: application/json, and a first request. Its code is highlighted on the server (ApiGuideSnippets) and shown in the site's code blocks.
  3. Links. API is linked from the aside, after Apps, and from the user menu.
# Pull request Depends on
0 #1642 the console layout production
1 this one 0
2 #1644 the guides 1
3 #1645 the OpenAPI spec 2
4 #1646 the endpoint reference and search 3

Validation

Check Result
pest --parallel --coverage --exactly=100.0 (full suite) 6461 passed, 100.0%
pest --type-coverage --min=100 100.0%
pint --test, rector --dry-run, phpstan clean
TSX tests, tsc 1120 passed, clean

Visual evidence

Playwright (Chromium) against a local dev server on this branch, emulated viewports, Inertia SSR off. The Introduction was captured at 1440×900, 1366×650 and 390×844, light and dark: layout shift (CLS) 0 on load, no horizontal overflow, no console error.

Introduction, 1440 light 1366 dark 390 dark 390 light
Introduction, desktop, light Introduction, laptop, dark Introduction, mobile, dark Introduction, mobile, light

The API link, before and after, in the aside's footer links and in the user menu (captured while this change was part of #1533; the links are unchanged), and a guest's mobile header with its way back to /dev/null.

Before, 1440 light After, 1440 light Before, 390 light After, 390 light Guest header, 390 light
Aside before, desktop, light Aside after, desktop, light User menu before, mobile, light User menu after, mobile, light Guest header with the way back, mobile, light

Device verification

Emulation only (390×844, DPR 2, touch): no hardware or simulator.

Independent review

Fresh read-only reviewers, given the guidelines, the stack, the validation results and the captures. A first round on the previous heads found should-fix points (fixtures and options ahead of their PR, the Errors table hiding its meanings on a phone, the Guilds preview, captures from before production's guild fields), all fixed. Re-review on base 1aa85cf4, head 6b4aee82: CODE: PASS, VISUAL: PASS, no blocker or should-fix.

Limitations

The sidebar lists the Introduction alone until #1644.

The API docs page reuses the operations console's shell: the sidebar of
grouped pages, the header naming the current one, the mobile nav that
scrolls sideways, the theme switch and the way back to /dev/null.

ConsoleLayout now draws that shell from its props: the brand chip and
label, the nav landmark's own label, whether its links prefetch, and a
title that falls back to the console's name. OperationsLayout keeps
what only operations does (polling, refreshing, the remotes dock) and
passes its pages in, with Moderation as an item elsewhere and prefetch
off, as before. Nothing changes on screen: captures before and after
differ only in the pulsing live dot.

Two things only the API docs will use come with it, as part of the
shell: links that prefetch, which operations leaves off, and the way
back for a guest on a phone, since operations only has signed-in
admins.
/docs/api opens the API docs, readable by everyone, on the console
layout: the guides in the sidebar, the section named in the header,
and the way back to /dev/null. A section the docs don't have is the
not found page.

This first step brings the page and its Introduction: what the API is
for, its base URL and format, and a first request anyone can send. Its
code is highlighted on the server and shown in the site's own code
blocks. The other guides, the OpenAPI spec and the endpoint reference
follow in their own pull requests.

The docs are linked as API from the aside, after Apps, and from the
user menu where the aside is hidden.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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