Skip to content

feat(portal): redesign the API reference pages and show the OAuth redirect URI in the playground - #441

Open
mehnoorsiddiqui wants to merge 4 commits into
devfrom
fix/portal-fumadocs-openapi-12.4
Open

mehnoorsiddiqui wants to merge 4 commits into
devfrom
fix/portal-fumadocs-openapi-12.4

Conversation

@mehnoorsiddiqui

@mehnoorsiddiqui mehnoorsiddiqui commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upgrades fumadocs-openapi from 12.1.1 to 12.4.1 for two fixes we reported upstream. The upgrade also brings Fumadocs' redesign of the API reference pages.

Issue Fixed in What changes in a portal
fuma-nama/fumadocs#3663 fumadocs-openapi 12.4.0 The playground's OAuth panel shows the redirect_uri it sends, with a copy button. It includes the portal's base path
fuma-nama/fumadocs#3661 fumadocs-openapi 12.4.0 Nothing visible. ApiMarkdown already kept a description image from crashing the page. It stays, because Fumadocs still doesn't add the base path to the image

This PR leaves out the image fix for the Markdown copies (#3662), which comes from fumadocs-core and fumadocs-mdx. Those stay at 16.15.17 and 15.4.0 here. fumadocs-openapi 12.4.1 accepts core and ui ^16.15.0.

The API page redesign (fumadocs-openapi 12.2 to 12.4)

  • 12.2.0: The playground moves into a dialog that opens from a Try in Playground button. Until the button is clicked, the page has no <form>. The dialog is rendered in a portal, outside the page's article.
  • 12.3.0: The schema UI moves into cards. Responses become tabs, callbacks open in dialogs, parameters sit in cards, and enum values show as tags.
  • 12.4.0: Adds auth providers. cURL samples now quote with '.

QA: portal automation tests need updating before merge

cc @WasifIsrar @razazarif

The portal tests in apimatic/v4-test-automation were written against the old inline playground. Most of the auth functional tests and one visual baseline will fail against this build. portal_tests.yml runs only on pushes to dev, so this PR's checks don't show the failures. They would first appear after the merge.

What changed in the markup (fumadocs-openapi 12.4.1)

  • The playground is a dialog. It opens from a Try in Playground button next to the endpoint bar. It's a Base UI Dialog, rendered in a portal outside #nd-page. Its title is the operation's title.
  • The <form> now holds only the URL bar (method, path, Send). The request sections and the response are separate panels beside it, both still inside the dialog:
    • The request panel has Path, Query, Header, Cookies, Body and Authorization.
    • The response panel shows "Send a request to see its response." until a request is sent.
    • Below the md breakpoint, a Request / Response switch shows one panel at a time.
  • OAuth is an inline panel inside Authorization. It has Client ID, Client Secret, Scopes, the "Send as Basic Auth header" / "Send client credentials in body" choice, a new Redirect URI field with a copy button, and an Authorize button. The test's separate "Authorization" dialog with a Submit button is gone.
  • The endpoint page itself now uses cards for parameters and schemas, tabs for responses, and tags for enum values.

What needs updating

  • pages/ApiReferencePage.ts
    • Click Try in Playground in open(), or add a step that does.
    • Scope playground to the dialog (page.getByRole("dialog")) instead of pageContent.locator("form"). Then re-check sendButton, responseStatus, responseBody, authorizationToggle, authSchemeSelect, parameterField(), authField() and openSection().
    • Rework oauthDialog, oauthSubmitButton and authorizeWithOAuth() for the inline OAuth panel.
  • tests/functional/auth/auth.functional.test.ts: check each test still passes, and decide whether to assert on the new Redirect URI field. It should include the portal's base path.
  • Re-capture the functional screenshots in portal-snapshots/functional/auth/. They show the playground's layout, which has changed.
  • Re-capture portal-snapshots/visual/petstore/api-add-pet.png.
  • Run the suite against this branch: gh workflow run portal_tests.yml --ref fix/portal-fumadocs-openapi-12.4. Its playwright-report and the diff PNGs show what moved.

The other visual tests and the artifact tests shouldn't change, because this PR only touches the API reference pages.

This PR stays a draft until the test changes are ready to merge alongside it.

Changes

  • fumadocs-openapi 12.1.1 → 12.4.1.
  • shiki 4.4.3 → 4.5.0 and lucide-react 1.47.0 → 1.54.0: the versions fumadocs-openapi 12.4 requires (^4.5.0, ^1.50.0), so each has a single copy.
  • pnpm dedupe also merged two other duplicate copies:
    • @semantic-release/github's undici goes from 7.27.0 to 7.29.1. The next release run will use it.
    • micromark-util-types goes from 2.0.2 to 2.0.3.
  • request-examples.ts and its test type a parameter as OperationParameter, which Fumadocs passes. ParameterObject.name is now optional.
  • ApiMarkdown's doc comment and the e2e comment now say why it stays: for the base path, not the crash.
  • .ai/plans/portal-subpath-hosting.md records #3661 and #3663 as fixed (5.10 and the upstream table).

Release age: fumadocs-openapi 12.4.1 was published on 2026-10-09, 10 days ago. That clears the 7-day minimumReleaseAge.

Test results

Full suite with e2e builds (APIMATIC_E2E=1 pnpm test): 1921 passing, 0 failing. ESLint clean.

In the browser: I built a portal from the subpath fixture plus an OAuth2 authorization-code scheme, served it under /api/, and drove it with headless Chrome.

Check Result
Operation page with an image in its description Renders. The image loads from /api/images/diagram.png. No console errors
Try in Playground Opens the dialog with the form, Send, the auth section and the cURL sample
OAuth panel Shows redirect_uri: http://127.0.0.1:4719/api/oauth/callback with a copy button. Authorize sent the same value (redirect_uri=http%3A%2F%2F127.0.0.1%3A4719%2Fapi%2Foauth%2Fcallback)

Related

#437 upgrades all four Fumadocs packages. Once this PR merges, #437 can drop fumadocs-openapi and keep the image fix alone (core and ui 16.17, mdx 15.4.7).

🤖 Generated with Claude Code

…irect URI in the playground

Upgrades fumadocs-openapi from 12.1.1 to 12.4.1, which carries the fixes for
fuma-nama/fumadocs#3661 and #3663, and the API page redesign of 12.2 to 12.4.
shiki and lucide-react move to the versions it requires, so each keeps a
single copy.

- The playground's OAuth panel shows the redirect URI it sends, base path
  included, with a copy button.
- An image in an operation's description no longer crashes Fumadocs' own
  renderer. ApiMarkdown stays, because that image still gets no base path.
- The playground opens in a dialog from a "Try in Playground" button, and the
  schemas, responses and parameters are shown in cards.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mehnoorsiddiqui added a commit that referenced this pull request Oct 19, 2026
fumadocs-openapi goes back to 12.1.1, with the request-examples types, the
ApiMarkdown comment and the plan rows for fuma-nama/fumadocs#3661 and #3663,
which #441 carries. This PR keeps the image fix alone: fumadocs-core and
fumadocs-ui 16.17.1 and fumadocs-mdx 15.4.7, for fuma-nama/fumadocs#3662.

The plan no longer calls #3662 open: section 9 records that root-relative
images stay unprefixed in the Markdown copies instead, and the follow-up
ticket for the placeholders is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mehnoorsiddiqui mehnoorsiddiqui self-assigned this Oct 19, 2026
@mehnoorsiddiqui
mehnoorsiddiqui marked this pull request as ready for review October 19, 2026 11:48
@sonarqubecloud

Copy link
Copy Markdown

mehnoorsiddiqui added a commit that referenced this pull request Oct 20, 2026
…images included (#437)

## Summary

Upgrades `fumadocs-core`, `fumadocs-ui` and `fumadocs-mdx` for the fix
to
[fuma-nama/fumadocs#3662](fuma-nama/fumadocs#3662),
which we reported upstream. It changes no portal code.

| Issue | Fixed in | What changes in a portal |
|---|---|---|
|
[fuma-nama/fumadocs#3662](fuma-nama/fumadocs#3662)
| fumadocs-core 16.17.0, fumadocs-mdx 15.4.7 | "View as Markdown", Copy
Markdown, the AI page actions and `llms-full.txt` keep each page as its
author wrote it. Images keep their address instead of `<img src="__img0"
/>` |

The `fumadocs-openapi` upgrade, with the fixes for #3661 and #3663 and
the API page redesign, moved to #441. This PR keeps `fumadocs-openapi`
at 12.1.1, which accepts core and ui `^16.15.0`.

## What else changes in a portal

- **The Markdown copies are the authored source.** Fumadocs 16.17 slices
each page's copy from its MDX instead of re-serializing the parsed tree.
So a copy keeps the author's text exactly as written:
  - bare autolinks stay bare instead of becoming `[url](url)`;
  - `- [X]` keeps its capital X;
  - entities such as `&copy;` stay as written;
  - code inside `<Tab>` keeps its indentation;
- JSX props such as `items={[…]}` keep their braces, where the old copy
printed `items="[…]"`.

Comparing the old and new `llms-full.txt` of the test petstore portal
found no lost content. Every difference was formatting or the image fix.
- **No drop shadow on callouts and code blocks.** fumadocs-ui 16.17
removed `shadow-md` from callouts and `shadow-sm` from code blocks. That
is visible in light mode only. Pixel diffs against `dev` found no other
visual change, in light, dark or at phone width.

## Before merge

`portal_tests.yml` [run on this
branch](https://github.com/apimatic/apimatic-cli/actions/runs/39219964368):
- **Visual:** passes.
- **Functional:** passes.
- **Artifacts:** fails only `llms-full.txt matches the baseline`,
because of the copy change above. 11 of its 12 tests pass.

The `portal-snapshots/artifacts/petstore/llms-full.txt` baseline in
`apimatic/v4-test-automation` needs updating alongside this PR, so dev's
run stays green.

## Changes

- `fumadocs-core` and `fumadocs-ui` 16.15.17 → 16.17.1, and
`fumadocs-mdx` 15.4.0 → 15.4.7.
- `shiki` 4.4.3 → 4.5.0 and `lucide-react` 1.47.0 → 1.54.0: the versions
core and ui 16.17 require (`^4.5.0`, `^1.50.0`), so each has a single
copy. #441 makes the same change.
- `pnpm dedupe` also merged a few other duplicate copies:
- `@semantic-release/github`'s `undici` goes from 7.27.0 to 7.29.1. The
next release run will use it.
  - `micromark-util-types` goes from 2.0.2 to 2.0.3.
  - `zod` goes from 4.5.4 to 4.6.5.
- New subpath e2e test: the Markdown copies and `llms-full.txt` keep
`![…](/images/diagram.png)` and the reference-style `![…][flow]`, and
contain no `__img`.
- `.ai/plans/portal-subpath-hosting.md` records #3662 as fixed and drops
the follow-up ticket it needed. Section 9 now records the limitation
that remains: root-relative images in the copies don't carry the base
path, the same as links.

**Release age:** these versions were published on 2026-10-09, 11 days
ago. That clears the 7-day `minimumReleaseAge`.

## Test results

**Unit and integration suite** (`pnpm test`, merged with `dev` at
0e9052c, after #427): 1852 passing, 69 pending, 0 failing. Build and
lint pass.

**Full suite with e2e builds** (`APIMATIC_E2E=1 pnpm test`, before #427
was merged in): 1922 passing, 0 failing.

**In the browser.** fumadocs-openapi 12.1.1 with core and ui 16.17.1 is
a new combination. I built the `default` fixture at the root and the
`subpath` fixture under `/api/`, both with an OAuth2 scheme added, on
this branch and on `dev`. I drove each with headless Chrome. Every check
below gave the same result on both branches, except for the image fix.

| Check | Root | `/api/` | `portal serve` |
|---|---|---|---|
| Content components from #439: Tabs, code tabs, composed tabs,
Accordions (single and multiple), Files, TypeTable, InlineTOC, the code
copy button | All open, switch and copy as expected | – | Same |
| Playground OAuth: Authorize sends `redirect_uri`, then the callback
page | `/oauth/callback`, then the token request |
`/api/oauth/callback`, then the token request | Same |
| Playground Send (`GET /SUM`) | `200`, body `0.2` | `200`, body `0.2` |
Same |
| Copy Markdown and View as Markdown | Copy as written | Keeps
`![…][flow]`; `dev` copies `<img … src="__img…">` | Same |
| The Open menu's AI links | Page URL | Page URL under `/api/` | – |
| Search, opened with Enter | Right page | Right page under `/api/` | –
|
| Hot reload of an edited page | – | – | Reloads |
| Console errors | None | None | None |

## Follow-ups

- The search dialog still uses `useDocsSearch`, which 16.17 deprecates
in favour of `useStaticSearch`.
- Root-relative image paths in the Markdown copies don't carry the base
path (plan, section 9).
- #441 and this PR both change `package.json`, the lockfile and the
plan. Whichever merges second needs a rebase.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants