Repository navigation
fix(portal): keep the Markdown copies and llms-full.txt as authored, images included - #437
Conversation
…rect URI Upgrades fumadocs-core and fumadocs-ui to 16.17.1, fumadocs-mdx to 15.4.7 and fumadocs-openapi to 12.4.1, which carry the fixes for fuma-nama/fumadocs#3661, #3662 and #3663. shiki and lucide-react move to the versions Fumadocs now requires, so each keeps a single copy. - An image in an operation's description no longer crashes the page in Fumadocs' own renderer. ApiMarkdown stays, for the base path. - The Markdown twins and llms-full.txt keep images as written instead of <img src="__img0" />; the subpath e2e checks them. - The playground's OAuth panel shows the redirect URI it sends. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
saeedjamshaid
left a comment
There was a problem hiding this comment.
The image fix works. In a build under a path, the Markdown copies and llms-full.txt keep inline and reference-style images as written, [flow]: /images/diagram.png included. ApiMarkdown still adds the base to every description image Fumadocs renders. On the e2e default fixture, per-page JS also drops from 431 KB to 402 KB gzipped.
Before merge: the upgrade redesigns the API pages, and the portal automation tests will fail
fumadocs-openapi 12.1.1 → 12.4.1 brings more than the three fixes:
- 12.2.0 moves the playground into a dialog behind a Try in Playground button and removes
CollapsiblePanel. - 12.3.0 puts the schema UI in cards: responses as tabs, callbacks in dialogs, parameters in cards, enum values as tags.
- 12.4.0 adds auth providers and changes the code samples (cURL now quotes with
').
On the default fixture, dev's endpoint page has one <form> and a Send button. On this branch it has neither until the button is clicked.
portal_tests.yml runs only on pushes to dev, so this PR's checks don't include it. In apimatic/v4-test-automation:
pages/ApiReferencePage.tsfinds the playground withlocator("form").first(). Every test intests/functional/auth/auth.functional.test.tsdrives that form and screenshots it, so the functional run will fail.- The visual baseline
api-add-pet.pngwill differ.search-results.pnglooked the same on both branches when I checked, so it may still pass.
Could you:
- Run
gh workflow run portal_tests.yml --ref fix/portal-fumadocs-image-fixes, and update the page object and baselines inv4-test-automationalongside this PR, so dev's run stays green? - Name the redesign in the PR title? The release notes are built from the squash title alone (
parserOptsreads headers only). The description says the PR "changes no portal code", so it should name the redesign too. Whether this makes it afeatis a judgement call.
The redirect-URI fix needs 12.4, so it can't ship without the redesign. The image fix comes from fumadocs-core 16.17 and fumadocs-mdx 15.4.7, and openapi 12.1.1 accepts core and ui ^16.15.0. So if you'd rather hold the redesign back, the image fix could ship alone. I haven't tested that combination.
Also changed by pnpm dedupe (low risk)
@semantic-release/github'sundicigoes from 7.27.0 to 7.29.1, and the next release run will use it.micromark-util-typesgoes from 2.0.2 to 2.0.3.
A line in the description would make both visible.
Checked and fine
- The playground still reads
storageKeyPrefix,mediaAdapters,oauthRedirectUrl,codeUsagesand both example-layout hooks. - The OAuth cookie and sessionStorage key that
/oauth/callbackrelies on are unchanged. withoutImagesin the search index is still needed, because 12.4.1 still indexes raw operation descriptions.- Under
portal serve, the pages, the playground dialog and search render with no console errors. CI doesn't render a page there. - The lockfile has one copy each of shiki and lucide-react.
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>
saeedjamshaid
left a comment
There was a problem hiding this comment.
Approving. With the openapi upgrade split out to #441, this PR is just the copy fix. Merged with current dev (#440, #434), build, lint and the full suite with e2e all pass.
I also diffed the llms-full-actual.txt from your portal-tests run against the baseline, and nothing is lost. Every word that drops out is one of:
- an autolink the old copy printed twice;
- an
__imgplaceholder; - an entity the old copy rewrote.
defaultOpen also survives now.
Before merge: v4-test-automation has no PR yet for the llms-full.txt baseline. Could you open one now and merge it together with this one? Otherwise dev's first portal run after the merge fails.
Two small points inline. The OperationParameter nit from my last review moved with the openapi upgrade, so it applies to #441 now.
| - The `image` and `definition` handlers of the alternative above would prefix them along with | ||
| the links. |
There was a problem hiding this comment.
16.17.1 removes what this relies on. remarkLLMs no longer takes handlers or stringify; 16.15.17 took both. It now slices the copy from the source, and a plugin changes the copy with replaceSource() from fumadocs-core/mdx-plugins/stringifier.
Since this PR is the upgrade that removes them, could this line and the alternative at 809–812 describe that approach instead? It would be a remark plugin that calls replaceSource() on root-relative link, image and definition nodes.
| const full = read('llms-full.txt'); | ||
|
|
||
| expect(read('index.md')).to.contain(''); | ||
| expect(read('authentication.md')).to.contain('![The flow, by reference][flow]'); |
There was a problem hiding this comment.
Could this also check for [flow]: /images/diagram.png? Without that definition, the reference prints as plain text, and this check would still pass.
|



Summary
Upgrades
fumadocs-core,fumadocs-uiandfumadocs-mdxfor the fix to fuma-nama/fumadocs#3662, which we reported upstream. It changes no portal code.llms-full.txtkeep each page as its author wrote it. Images keep their address instead of<img src="__img0" />The
fumadocs-openapiupgrade, with the fixes for #3661 and #3663 and the API page redesign, moved to #441. This PR keepsfumadocs-openapiat 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:
[url](url);- [X]keeps its capital X;©stay as written;<Tab>keeps its indentation;items={[…]}keep their braces, where the old copy printeditems="[…]".Comparing the old and new
llms-full.txtof 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-mdfrom callouts andshadow-smfrom code blocks. That is visible in light mode only. Pixel diffs againstdevfound no other visual change, in light, dark or at phone width.Before merge
portal_tests.ymlrun on this branch: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.txtbaseline inapimatic/v4-test-automationneeds updating alongside this PR, so dev's run stays green.Changes
fumadocs-coreandfumadocs-ui16.15.17 → 16.17.1, andfumadocs-mdx15.4.0 → 15.4.7.shiki4.4.3 → 4.5.0 andlucide-react1.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. feat(portal): redesign the API reference pages and show the OAuth redirect URI in the playground #441 makes the same change.pnpm dedupealso merged a few other duplicate copies:@semantic-release/github'sundicigoes from 7.27.0 to 7.29.1. The next release run will use it.micromark-util-typesgoes from 2.0.2 to 2.0.3.zodgoes from 4.5.4 to 4.6.5.llms-full.txtkeepand the reference-style![…][flow], and contain no__img..ai/plans/portal-subpath-hosting.mdrecords #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 withdevat 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
defaultfixture at the root and thesubpathfixture under/api/, both with an OAuth2 scheme added, on this branch and ondev. I drove each with headless Chrome. Every check below gave the same result on both branches, except for the image fix./api/portal serveredirect_uri, then the callback page/oauth/callback, then the token request/api/oauth/callback, then the token requestGET /SUM)200, body0.2200, body0.2![…][flow];devcopies<img … src="__img…">/api//api/Follow-ups
useDocsSearch, which 16.17 deprecates in favour ofuseStaticSearch.package.json, the lockfile and the plan. Whichever merges second needs a rebase.🤖 Generated with Claude Code