Skip to content

fix(docs): emit catalog source accordion titles as plain strings - #4006

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/docs-accordion-title-string
Sep 16, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/docs-accordion-title-string

Conversation

@miga-heygen

Copy link
Copy Markdown
Contributor

Root cause

scripts/generate-catalog-pages.ts emitted the "Source" section heading of every catalog page as a JSX expression:

<Accordion title={`name.html`}>

Mintlify's search indexer stringifies expression attribute nodes instead of evaluating them, so the section title showed up in docs search as [object Object] (reproducible on the Scroll Feed page, but the same line is on all 399 pages under docs/catalog/**).

Git history (git log -S 'title={') shows the template literal arrived with the #3090 catalog port and was never motivated by an escaping need: every value is a single-segment name.html` path, so a plain double-quoted string is the correct form — the same form the generator already used for the "The prompt this was built from" accordion.

Fix

  • New mdxStringAttribute(name, value) helper emits name="value" and escapes & " < { } as HTML character references (MDX decodes references inside quoted attribute values; JSON.stringify was not an option because JSX strings do not honour backslash escapes).
  • Both data-driven title emitters now go through it: the Source <Accordion> and the preview <iframe title=...> (which previously used JSON.stringify; its output is byte-identical for every existing item, so no iframe lines changed).
  • Three unit tests cover the helper: plain output, escaping of & " < { }, and backticks passing through untouched.

Regeneration

bun install --frozen-lockfile && npx tsx scripts/generate-catalog-pages.ts. Running the generator on an unmodified checkout first produced zero changes, so everything in this diff is attributable to the generator change.

Verification

  • grep -rlE 'title=\{' docs --include=*.mdx | wc -l`: 399 before → 0 after
  • grep -rl '<Accordion title="[a-z0-9-]*\.html">' docs --include=*.mdx | wc -l: 0 before → 399 after
  • git diff --stat -- docs: 399 files, 399 insertions, 399 deletions — exactly one Accordion title line per page, nothing else
  • node --import tsx --test scripts/generate-catalog-pages.test.ts: new tests pass; the one failing case (explorer producer) fails identically on main and is unrelated to this change
  • oxfmt --check and oxlint clean on both touched scripts; scripts/check-docs-snippet-motion.mjs passes
  • Swept docs/**/*.mdx for any other title={ / label={ expression attributes: none remain besides this pattern. Component props inside docs/snippets/*.jsx (title={title}) are React runtime props, not MDX attributes, and are not indexed.

The generated catalog pages rendered the "Source" accordion title as a
JSX expression, `<Accordion title={`name.html`}>`. Mintlify's search
indexer stringifies expression attribute nodes rather than evaluating
them, so every one of the 399 catalog pages surfaced its Source section
in search results as "[object Object]" (visible on the Scroll Feed page,
among others).

The template literal carried no escaping benefit: every title is a
single-segment `name.html` path, and a double-quoted JSX string handles
it directly. Introduce `mdxStringAttribute`, which emits a plain
`name="value"` attribute and escapes `& " < { }` as HTML character
references (MDX decodes references inside quoted attribute values, and
unlike JSON.stringify it does not rely on backslash escapes, which JSX
strings do not honour). Use it for both the Source accordion title and
the preview iframe title, and regenerate the catalog pages.

Regenerated with `npx tsx scripts/generate-catalog-pages.ts`; the only
change across the 399 pages is the one Accordion title line each.

Co-Authored-By: Miguel Ángel <miguel.sierra@heygen.com>
@mintlify

mintlify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Sep 16, 2026, 4:00 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@miguel-heygen
miguel-heygen merged commit 7b5fdb1 into main Sep 16, 2026
44 checks passed
@miguel-heygen
miguel-heygen deleted the fix/docs-accordion-title-string branch September 16, 2026 15:55
miga-heygen added a commit that referenced this pull request Sep 16, 2026
- Portrait compositions render the full frame when the project was
  scaffolded at a different size: html/body are sized to the composition
  root at runtime; new lint warning root_dimensions_mismatch (#4005,
  fixes #4001)
- render_complete telemetry adds composition_element_tags,
  aroll_video_count, heygen_video_count; render_error adds error_name and
  failed_stage_code (#4004)
- Catalog docs "Source" accordion titles are plain strings, so docs
  search no longer shows [object Object] (#4006)

Co-Authored-By: Miguel Ángel <miguel.sierra@heygen.com>
miguel-heygen added a commit that referenced this pull request Sep 16, 2026
- Portrait compositions render the full frame when the project was
  scaffolded at a different size: html/body are sized to the composition
  root at runtime; new lint warning root_dimensions_mismatch (#4005,
  fixes #4001)
- render_complete telemetry adds composition_element_tags,
  aroll_video_count, heygen_video_count; render_error adds error_name and
  failed_stage_code (#4004)
- Catalog docs "Source" accordion titles are plain strings, so docs
  search no longer shows [object Object] (#4006)

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.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