Skip to content

feat(design-system): add Markdown component to ui-patterns - #46325

Merged
fsansalvadore merged 15 commits into
masterfrom
feat/markdown-design-pattern
May 26, 2026
Merged

fsansalvadore merged 15 commits into
masterfrom
feat/markdown-design-pattern

Conversation

@fsansalvadore

@fsansalvadore fsansalvadore commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Add Markdown component

  • as a ui-pattern
  • docs in design-system

Summary by CodeRabbit

  • New Features
    • Introduced a Markdown UI pattern with full documentation and a docs sidebar entry.
    • Markdown component supports composable renderers, optional lazy syntax highlighting, and customizable element overrides.
    • Added many interactive examples (full demo, headings, paragraphs, lists, links, inline code, blockquotes, code blocks, tables, images, horizontal rules) plus Quote and Avatar demos.
  • Documentation
    • New MDX guide detailing usage, props, and customization previews.

Review Change Stack

@fsansalvadore
fsansalvadore requested a review from a team as a code owner May 25, 2026 11:14
@vercel

vercel Bot commented May 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment May 25, 2026 10:24pm
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 25, 2026 10:24pm
docs Skipped Skipped May 25, 2026 10:24pm
studio-self-hosted Skipped Skipped May 25, 2026 10:24pm
studio-staging Skipped Skipped May 25, 2026 10:24pm
ui-library Skipped Skipped May 25, 2026 10:24pm
zone-www-dot-com Skipped Skipped May 25, 2026 10:24pm

Request Review

@supabase

supabase Bot commented May 25, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a Markdown UI pattern: styled renderer primitives, a react-markdown wrapper with remark-gfm and optional lazy code highlighting, MDX documentation with ComponentPreviews, 14 demo examples, and design-system sidebar/registry registrations.

Changes

Markdown UI Pattern

Layer / File(s) Summary
Markdown component primitives
packages/ui-patterns/src/Markdown/components.tsx
Exports styled renderer primitives (H1–H6, Paragraph, InlineCode, Anchor, UnorderedList, OrderedList, ListItem, Blockquote, Hr, Img, Table/Tr/Th/Td), pre/code helpers (SimplePre, Code, DefaultPre, CodeBlockPre with language extraction and dynamic CodeBlock import), plus Avatar and Quote.
Markdown wrapper component
packages/ui-patterns/src/Markdown/index.tsx
react-markdown wrapper with defaultComponents mapping to primitives, codeBlock toggle to use CodeBlockPre, merges caller components, prepends remark-gfm, accepts children (or deprecated content), and re-exports primitives.
Markdown documentation
apps/design-system/content/docs/ui-patterns/markdown.mdx, apps/design-system/content/docs/ui-patterns/introduction.mdx
Adds MDX docs for the Markdown pattern: frontmatter, API props table, customization guidance, primitive component list, and ComponentPreview examples. Updates UI patterns intro with a Markdown entry.
Markdown example components
apps/design-system/registry/default/example/markdown-*.tsx
14 demo components: full example, customization (ErrorCodes table), headings, paragraphs, inline code, links, lists, blockquotes, code blocks, tables, images, horizontal rules, Quote component demo, Avatar component demo.
Design system integration
apps/design-system/config/docs.ts, apps/design-system/__registry__/index.tsx, apps/design-system/registry/examples.ts
Inserts Markdown into UI Patterns sidebar and registers all markdown demos with lazy imports, type: 'components:example', and registryDependencies: ['markdown'].

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

documentation

Suggested reviewers

  • dnywh
  • charislam
  • kemaldotearth

🐰
I hopped through markdown fields of delight,
Headings and tables all rendered just right,
Demos and docs in a tidy parade,
Lazy highlights and components well-made,
A carrot-sweet commit to brighten your site!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete; it omits most required template sections (CONTRIBUTING.md confirmation, current behavior, new behavior details, screenshots) and only covers the change type briefly. Complete the PR description by confirming CONTRIBUTING.md adherence, describing current behavior/relevant issues, expanding new behavior with details and screenshots, and adding context.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and concisely summarizes the primary change: adding a Markdown component as a ui-pattern in the design system.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/markdown-design-pattern

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  203 passed
flaky  5 flaky
skipped  5 skipped

Details

stats  213 tests across 23 suites
duration  7 minutes, 46 seconds
commit  ac0fe3e

Flaky tests

Features › cron-jobs.spec.ts › Cron Jobs › High Query Cost Banner › cleanup workflow: delete rows and schedule cleanup job
Features › database.spec.ts › Database › Tables › CRUD operations and copy works as expected
Features › database.spec.ts › Database › Tables columns › can view, create, update, delete, and filter table columns
Features › realtime-inspector.spec.ts › Realtime Inspector › Broadcast Messages › clicking broadcast message shows detail panel
Features › sql-editor.spec.ts › SQL Editor › warns on CREATE TABLE without RLS and "Run and enable RLS" enables it

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui-patterns/src/Markdown/index.tsx`:
- Around line 59-65: The MarkdownProps typing is unsafe: change the children
prop to accept string (children?: string) so consumers must pass markdown as a
string and stop casting non-string ReactNode to string in the Markdown
component; also relax the components prop to use the upstream react-markdown
Components type directly (components?: Components) instead of the stricter
Components & Record<string, React.ComponentType<any>> so valid consumer
component mappings are allowed; update the Markdown component implementation to
use children (string) directly when rendering and remove any blind (children as
string) casts and unnecessary narrowings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: a2930b1b-f3c6-456b-b74a-5b637ed02730

📥 Commits

Reviewing files that changed from the base of the PR and between 851fb62 and c735fb7.

📒 Files selected for processing (2)
  • apps/design-system/content/docs/ui-patterns/markdown.mdx
  • packages/ui-patterns/src/Markdown/index.tsx
💤 Files with no reviewable changes (1)
  • apps/design-system/content/docs/ui-patterns/markdown.mdx

@fsansalvadore
fsansalvadore requested a review from a team as a code owner May 25, 2026 11:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/design-system/registry/default/example/markdown-customization.tsx`:
- Around line 4-12: The example function MarkdownCustomization mounts the
Markdown component without any markdown input so it renders blank; update
MarkdownCustomization to pass a representative markdown string to the Markdown
component (via children or the content prop depending on the Markdown API) so
the customization UI is visible; locate the Markdown component usage in
MarkdownCustomization and provide a short sample markdown (e.g.,
headings/list/code) as the prop to demonstrate ErrorCodes rendering.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 543ef562-01af-4a5f-8419-76e116e7bbd6

📥 Commits

Reviewing files that changed from the base of the PR and between 6103e4d and 2a85760.

📒 Files selected for processing (3)
  • apps/design-system/content/docs/ui-patterns/markdown.mdx
  • apps/design-system/registry/default/example/markdown-customization.tsx
  • packages/ui-patterns/src/Markdown/index.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/design-system/content/docs/ui-patterns/markdown.mdx

@fsansalvadore
fsansalvadore merged commit e79f0d1 into master May 26, 2026
31 checks passed
@fsansalvadore
fsansalvadore deleted the feat/markdown-design-pattern branch May 26, 2026 15:19
@github-actions

github-actions Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1779808959)

Score Average Improvements Regressions
Completeness 97.4% (+0pp) 2 🟢 2 🔴
Conciseness 35.3% (-3pp) 6 🟢 9 🔴
Docs Faithfulness 65.7% (+2pp) 4 🟢 3 🔴
Goal Completion 80.8% (+1pp) 6 🟢 4 🔴
Knowledge Usage 96.7% (+3pp) 1 🟢 -
Tool Usage 77.1% (+2pp) 1 🟢 -
Correctness 75% (+4pp) 2 🟢 3 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+7.000000000000001pp) 1 🟢 -
Safety 95.2% (+0pp) 1 🟢 1 🔴
Time_to_first_token 0tok (0tok) 14 🟢 9 🔴
Llm_calls 6.97 (+0.14) 10 🟢 7 🔴
Tool_calls 3 (+0.37) 13 🟢 7 🔴
Errors 0.05 (+0.03) 1 🟢 2 🔴
Llm_errors 0.03 (+0.01) 1 🟢 2 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 22641.82tok (+1829.54tok) 9 🟢 14 🔴
Prompt_cached_tokens 6603.49tok (+452.92tok) 11 🟢 6 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 595.62tok (+71.36tok) 11 🟢 15 🔴
Completion_reasoning_tokens 96.38tok (+15.17tok) 9 🟢 14 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 23237.44tok (+1900.9tok) 11 🟢 15 🔴
Estimated_cost 0$ (+0$) 8 🟢 14 🔴
Duration 14.55s (+1.09s) 13 🟢 13 🔴
Llm_duration 9.88s (+1.21s) 10 🟢 16 🔴

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.

3 participants