Skip to content

docs: use Fumadocs TypeTable on data model pages - #3791

Open
marcklingen wants to merge 4 commits into
mainfrom
cursor/simplify-typetable-pr-4994
Open

marcklingen wants to merge 4 commits into
mainfrom
cursor/simplify-typetable-pr-4994

Conversation

@marcklingen

@marcklingen marcklingen commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Simplified rebase of #3767 onto current main.

Uses Fumadocs TypeTable on two data-model pages:

  • /docs/evaluation/scores/data-model — Score and ScoreConfig fields
  • /docs/evaluation/experiments/data-model — Dataset, DatasetItem, DatasetItemMediaReference, DatasetRun, DatasetRunItem

Path/use-case tables stay markdown. Field names, types, required flags, and documented defaults match the previous tables.

What changed vs #3767

#3767 still includes the already-merged Fumadocs 16.15.4 upgrade, so the GitHub diff is 18 files and mixes upgrade fallout with TypeTable work.

This branch:

  • Replays only the TypeTable commits onto current main (7 files)
  • Replaces the ~150-line hand-rolled TypeTable field lexer with new Function evaluation of the authored object literal
  • Keeps the flat table chrome, MDX registration, and markdown/PDF export

TypeTable is registered in mdx-components.tsx. lib/markdown-component-renderers.js still exports each TypeTable as a markdown field table so .md / PDF / md-src keep the same attributes.

Styling is the flat table (no radius, 1px structure border, no card shadow). AGENTS.md recommends TypeTable for object/field data models.

Open in Web Open in Cursor 

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking recommendation to add regression coverage for TypeTable Markdown exports.

Summary

  • Adds and globally registers a Langfuse-styled TypeTable wrapper.
  • Converts the score and experiment object schemas to TypeTable definitions.
  • Adds Markdown serialization for TypeTable props.
  • Adds flat table styling and contributor guidance for future data-model pages.
  • The export renderer would benefit from focused regression coverage because it is responsible for preserving component-only documentation outside the rendered site.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Data-model MDX] --> B[Registered TypeTable wrapper]
  B --> C[Fumadocs web rendering]
  A --> D[TypeTable Markdown renderer]
  D --> E[Plain Markdown / md-src]
  E --> F[PDF output]
Loading

Reviews (1) · Last reviewed commit: "refactor: evaluate TypeTable literals in..."

cursoragent and others added 4 commits September 12, 2026 19:08
Convert Score/ScoreConfig and Experiments dataset object field tables to TypeTable, register the component for MDX, and keep the same fields in Markdown/PDF export.

Co-authored-by: Marc Klingen <marcklingen@users.noreply.github.com>
Add three switchable TypeTable variants (flat table default, CornerBox chrome, always-visible rows) and drop the Fumadocs rounded card. Toggle with ?typetable=1|2|3.

Co-authored-by: Marc Klingen <marcklingen@users.noreply.github.com>
Keep the rectangular table styling and drop the query-param variants.
Recommend TypeTable in AGENTS.md for object/field data models.

Co-authored-by: Marc Klingen <marcklingen@users.noreply.github.com>
The markdown/PDF export only needs the authored object literal, so evaluate
that expression and drop the hand-rolled field lexer.

Co-authored-by: marc.klingen <marc.klingen@clickhouse.com>
@vercel

vercel Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
langfuse-docs Ready Ready Preview Sep 12, 2026 7:14pm UTC

Request Review

@marcklingen
marcklingen marked this pull request as ready for review September 12, 2026 19:13
@github-actions

Copy link
Copy Markdown

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

No review was started: this request came from a bot account. Manual reviews can only be requested by someone with write access to this repository. Ask a maintainer to comment @claude review, or have your automation post the comment from a user account with write access.

Tip: disable this comment in your organization's Code Review settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-12T19:18:04.544373Z 5f9ad6c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this PR and didn't find any bugs. Because it introduces a new build-time JSX→Markdown export path (renderTypeTable in lib/markdown-component-renderers.js, using new Function to evaluate the TypeTable type literal) that two live docs pages now depend on, a quick human look would still be worthwhile.

What was reviewed:

  • renderTypeTable/extractJsxExpression in lib/markdown-component-renderers.js — scoped to plain JS object literals authored in-repo, not external input; throws clearly on non-literal expressions.
  • Pipe-escaping in code-span cells: the media field's object | null type (content/docs/evaluation/experiments/data-model.mdx:167) is escaped to \| and wrapped in backticks — CommonMark doesn't process backslash escapes inside code spans, so the exported .md/PDF table may show a literal backslash there; cosmetic only, table structure isn't broken.
  • Heading structure in both migrated .mdx pages — single H1, proper ##/###/#### nesting, explicit [#anchor] markers preserved.
  • src/overrides.css additions — scoped to the new .lf-type-table class, using existing CSS variables, no changes to other selectors.
Extended reasoning...

Overview

The PR adds a Fumadocs TypeTable convention (components/docs/type-table.tsx), registers it in mdx-components.tsx, migrates the Score/ScoreConfig and Dataset/DatasetItem/DatasetRun/DatasetRunItem data-model pages to it, adds matching CSS in src/overrides.css, and — critically for parity — adds a Markdown-export renderer (replaceTypeTablesWithMarkdown/renderTypeTable/extractJsxExpression) in lib/markdown-component-renderers.js so .md/PDF/md-src consumers still see the same attribute tables. A small shim file (.agents/AGENTS.md) is also synced to match root guidance already documenting this exact convention.

Security risks

Low. new Function is used to evaluate the type prop's object-literal source, but that source is always repository-authored MDX content compiled at build time, not user- or request-supplied input, so this isn't an injection vector in the traditional sense — it's equivalent in risk to existing hand-rolled JSX parsers already in this file (e.g. for CardGroup/Academy components). No auth, secrets, or data-exposure paths are touched.

Level of scrutiny

Medium. The page content and CSS changes are simple and mechanical, but the new renderTypeTable markdown-export logic is genuinely new parsing/rendering code with edge cases (non-literal expressions, JSX in descriptions, table-cell escaping) that a multi-round automated review already exercised without finding a bug it flagged. My own reading turned up one concrete, low-severity cosmetic case: the media field's "object | null" type value gets escaped to \| and wrapped in backticks, and per CommonMark, backslash escapes don't apply inside code spans — so the rendered .md/PDF output may literally show a backslash rather than a clean pipe. It doesn't corrupt table structure and is far from severe, but it's a concrete, currently-present instance in this exact diff rather than a purely hypothetical future risk, so I think it's worth a human glancing at the exported Markdown for that one page before merging.

Other factors

The overall design directly implements a convention the project's own AGENTS.md/CLAUDE.md already calls for (TypeTable for data models, with Score/Dataset pages named as the intended examples), and the CSS/heading/anchor conventions are all followed correctly. Given the change is well-scoped and no functional bug was found, but it does introduce new export-path code with at least one minor, real rendering nuance, deferring with a specific note feels more honest than an unqualified approval.

This branch was successfully deployed

1 active deployment
Preview — 5f9ad6c6 Deployed Sep 12, 2026 by vercel[bot]
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