Skip to content

fix(ui): align Admonition titles and docs link hover with prose - #48428

Merged
dnywh merged 10 commits into
masterfrom
fix/admonition-alert-title-prose
Jul 31, 2026
Merged

dnywh merged 10 commits into
masterfrom
fix/admonition-alert-title-prose

Conversation

@dnywh

@dnywh dnywh commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

UI bug fix.

What is the current behavior?

After the recent Admonition a11y refactor:

  • Titled Admonitions in MDX (blog and docs) could pick up large prose top margin on the title, or (after follow-ups) end up with a title much smaller than the body because the title was a div at text-sm while body <p>s took prose ~15px
  • Docs MDX links (including inside Admonitions) had a weak hover: prose only shifted underline colour

Prior issues:

  • A couple of guide callouts bolded link text via [**…**](…)
  • Some funky Admonition formatting as called out in comments below

What is the new behavior?

  • AlertTitle is a <p> with !mt-0 mb-0.5 font-medium (not an h5 / bare div), so it does not break heading hierarchy and matches admonition body font-size under prose
  • Admonition uses AlertTitle again (though with <p> as explained above) and wraps MDX children in AlertDescription (same as description)
  • Alert / AlertTitle / AlertDescription get data-slot attributes; description keeps string→<p> wrapping, Studio density, plus text-balance
  • Docs link hover: typography a:hover and MdxAnchor now move text + decoration toward foreground (InlineLink-like), without stealing brand link colour via text-inherit
  • Content: remove accidental bold on oauth-scopes and multi-factor-authentication guide links
Before After
CleanShot 2026-07-29 at 16 44 48@2x CleanShot 2026-07-29 at 16 44 08@2x
CleanShot 2026-07-29 at 16 46 18@2x CleanShot 2026-07-29 at 16 46 30@2x
CleanShot 2026-07-29 at 16 47 15@2x CleanShot 2026-07-29 at 16 47 39@2x

To test

Docs

  1. Functions quickstart: titled tip near the top. Title and body should be the same size, no giant gap above the title
  2. BYO MCP: tip with links. Hover a link (text + underline should both go foreground)
  3. OAuth scopes: note link is not bold
  4. Multi-factor authentication: same, note link not bold

Blog

  1. CLI v2 config as code: titled Admonitions. Title size matches body, no huge top margin

Other

  1. Design system: Admonition: component reference
  2. Studio (e.g. project Edge Functions secrets): Admonitions should stay compact text-sm outside prose. Preview: studio-staging

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • None
  • Style

    • Improved link decoration consistency (underline/hover) across internal and external documentation content, with safer external link handling.
  • Bug Fixes

    • Refined alert/admonition rendering for clearer title/description semantics and better spacing/text wrapping.
    • Updated documentation image rendering to avoid forwarding whitespace-only children and adjusted chart image layout.
  • Tests

    • Expanded assertions for alert/admonition structure and styling.

@dnywh
dnywh requested review from a team as code owners July 29, 2026 06:22
@vercel

vercel Bot commented Jul 29, 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 Jul 31, 2026 2:17am
docs Ready Ready Preview, v0 Jul 31, 2026 2:17am
studio-self-hosted Ready Ready Preview Jul 31, 2026 2:17am
studio-staging Ready Ready Preview Jul 31, 2026 2:17am
ui-library Ready Ready Preview Jul 31, 2026 2:17am
zone-www-dot-com Ready Ready Preview, v0 Jul 31, 2026 2:17am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 31, 2026 2:17am

Request Review

@supabase

supabase Bot commented Jul 29, 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 ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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

Documentation links, image rendering, typography, alert primitives, and admonition markup were updated. MDX image usage was reformatted across several guides, and Admonition tests now verify the updated alert structure.

Changes

Documentation and admonition presentation

Layer / File(s) Summary
Documentation link presentation
apps/docs/features/docs/MdxAnchor.tsx, packages/config/typography.config.js, apps/docs/content/guides/...
Links now receive shared decoration, hover styling, inherited colors, and explicit external-link handling; guide references and note link markup were updated.
MDX image rendering
apps/docs/components/Image.tsx, apps/docs/content/guides/ai/..., apps/docs/content/guides/database/..., apps/docs/content/guides/telemetry/...
Image separates figure and next/image props, while affected guide image tags receive formatting-only closing syntax updates.
Alert primitive contracts
packages/ui/src/components/shadcn/ui/alert.tsx
Alert components add slot markers, change AlertTitle to a paragraph, and extend description typography classes.
Admonition rendering integration
packages/ui-patterns/src/Admonition/Admonition.tsx, packages/ui-patterns/src/Admonition/Admonition.test.tsx
Admonitions use AlertTitle and AlertDescription for titles, descriptions, and child content, with tests covering the updated markup and classes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: charislam, chrischinchilla

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main UI typography and Admonition fix.
Description check ✅ Passed The description covers the main behavior changes and testing, but omits the template's CONTRIBUTING confirmation section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/admonition-alert-title-prose

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.

@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.

🧹 Nitpick comments (1)
packages/ui/src/components/shadcn/ui/alert.tsx (1)

53-53: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Use Tailwind v4’s postfix important modifier consistently.

Tailwind v4 allows the legacy prefix form, but the new preferred syntax places ! after the utility class. Update these classes/tests to use mt-0! and the ! after each utility in AdmonitionBodyClassName so the prose margin resets stay in sync.

🤖 Prompt for 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.

In `@packages/ui/src/components/shadcn/ui/alert.tsx` at line 53, Update the alert
class in packages/ui/src/components/shadcn/ui/alert.tsx at line 53 to use
Tailwind v4 postfix syntax, replacing !mt-0 with mt-0!. Update
AdmonitionBodyClassName in packages/ui-patterns/src/Admonition/Admonition.tsx at
lines 10-11 so each utility places ! after the utility, and update the
corresponding expectation in
packages/ui-patterns/src/Admonition/Admonition.test.tsx at line 132; keep the
prose margin resets synchronized across all three sites.
🤖 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.

Nitpick comments:
In `@packages/ui/src/components/shadcn/ui/alert.tsx`:
- Line 53: Update the alert class in
packages/ui/src/components/shadcn/ui/alert.tsx at line 53 to use Tailwind v4
postfix syntax, replacing !mt-0 with mt-0!. Update AdmonitionBodyClassName in
packages/ui-patterns/src/Admonition/Admonition.tsx at lines 10-11 so each
utility places ! after the utility, and update the corresponding expectation in
packages/ui-patterns/src/Admonition/Admonition.test.tsx at line 132; keep the
prose margin resets synchronized across all three sites.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0cacf9af-3475-4119-9824-ee9c4f279908

📥 Commits

Reviewing files that changed from the base of the PR and between 618e003 and 53f794f.

📒 Files selected for processing (7)
  • apps/docs/content/guides/integrations/build-a-supabase-oauth-integration/oauth-scopes.mdx
  • apps/docs/content/guides/platform/multi-factor-authentication.mdx
  • apps/docs/features/docs/MdxAnchor.tsx
  • packages/config/typography.config.js
  • packages/ui-patterns/src/Admonition/Admonition.test.tsx
  • packages/ui-patterns/src/Admonition/Admonition.tsx
  • packages/ui/src/components/shadcn/ui/alert.tsx

Comment thread apps/docs/features/docs/MdxAnchor.tsx Resolved
@blacksmith-sh

This comment has been minimized.

AlertTitle is a paragraph again so MDX admonition titles match body
font-size, without breaking heading hierarchy. Restore AlertDescription
wrapping for children, tighten docs link hover, and drop accidental bold
in a couple of guide links.
@dnywh
dnywh force-pushed the fix/admonition-alert-title-prose branch from e5a5383 to 9785651 Compare July 29, 2026 06:35
@dnywh
dnywh requested a review from Copilot July 29, 2026 06:49

Copilot AI 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.

Pull request overview

This PR fixes styling/semantics regressions introduced by the recent Admonition accessibility refactor across docs/blog MDX and shared UI components, focusing on consistent title/body typography and more visible link hover treatment.

Changes:

  • Updates Alert/AlertTitle/AlertDescription structure and adds data-slot attributes, aligning Admonition title typography with prose body sizing.
  • Refactors Admonition to render titles via AlertTitle and to wrap both description and MDX children in AlertDescription, with updated tests.
  • Improves docs link hover styling via typography config + MdxAnchor, and removes accidental bolding in a couple of MDX guides.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/ui/src/components/shadcn/ui/alert.tsx Adjusts Alert subcomponents’ markup/classes and adds data-slot hooks for consistent styling in prose and non-prose contexts.
packages/ui-patterns/src/Admonition/Admonition.tsx Re-aligns Admonition composition to use AlertTitle and wrap MDX body content in AlertDescription.
packages/ui-patterns/src/Admonition/Admonition.test.tsx Updates/extends tests to assert the new title/description structure and wrapping behavior.
packages/config/typography.config.js Strengthens prose link hover so underline + text move toward foreground together.
apps/docs/features/docs/MdxAnchor.tsx Aligns MDX anchor underline/hover styling with Studio’s InlineLink behavior.
apps/docs/content/guides/platform/multi-factor-authentication.mdx Removes unintended bold emphasis from a note link.
apps/docs/content/guides/integrations/build-a-supabase-oauth-integration/oauth-scopes.mdx Removes unintended bold emphasis from a note link.

Comment thread apps/docs/features/docs/MdxAnchor.tsx Resolved
Drop brand/green link colour in favour of inherit→foreground, harden
target=_blank with noopener noreferrer, and point oauth-scopes at the
current OAuth integration guide so Docs E2E stops 404ing.

Copilot AI 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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

packages/ui-patterns/src/Admonition/Admonition.tsx:96

  • When both description and children are provided, this renders two separate AlertDescription blocks with identical props/classes. That duplicates the description wrapper styling (incl. mb-0.5/data-slot="alert-description") and can lead to unintended spacing/styling differences for common usages that pass a description plus an action child (e.g. a button). Consider merging description + children into a single AlertDescription container.
              {description && (
                <AlertDescription
                  {...childProps?.description}
                  className={cn(admonitionBodyClassName, childProps?.description?.className)}
                >

@czenko czenko 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.

Previewed admonitions and they look as expected.
I wonder if we have considered using visual regression tests on the style system? 🤔

Comment on lines +10 to +12
const admonitionBodyClassName =
'[&_p]:!mt-0 [&_p]:!mb-1.5 [&_p:last-child]:!mb-0 [&_ul]:!my-1.5 [&_ol]:!my-1.5 [&_li]:!my-0.5'

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.

Is there a way to avoid the importants? It seems that you have not-prose as a means of stripping styles before re-applying, which isn't pleasant either. I wish there was a better solution.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it’s not great. I tried not-prose on Docs’s AdmonitionWithMargin but that caused the Alert’s font size to revert too.

Basically we want to inherit the prose type styles but not the gaps. Let me see about a follow up that does a proper design pass on AdmonitionWithMargin!

dnywh added 4 commits July 30, 2026 10:29
Keep oauth-scopes note link unbolded while taking master's corrected guide path.
MDX treats a blank line inside JSX as the end of the element, which
corrupts the tree and crashes prerender with a children TypeError.
Also stop forwarding accidental Image children to next/image.
dnywh added a commit that referenced this pull request Jul 31, 2026
…#48465)

## What kind of change does this PR introduce?

Bug fix

## What is the current behavior?

Docs production builds can fail during prerender with:

`TypeError: Cannot read properties of undefined (reading 'children')`

Seen on `/guides/ai/going-to-prod` (and the same pattern exists on
several other guides).

Root cause: blank lines inside MDX JSX such as `<Image ...>` make the
MDX parser treat the element as closed early, which corrupts the AST.
Separately, `apps/docs/components/Image.tsx` forwarded accidental
`children` (and could overwrite `src`) onto `next/image`.

## What is the new behavior?

- Remove blank lines before the closing `/>` on the affected guide MDX
files so the JSX stays one element.
- Make the docs `Image` wrapper drop `children` and keep `src` from
props only, so a bad MDX tree is less likely to crash the build.

## Additional context

Split out of #48428 so that PR stays focused on Admonition/Alert
typography.

### To test

1. Check out this branch and run the docs app locally (`apps/docs`), or
wait for the Vercel docs preview on this PR.
2. Confirm these pages render without a prerender / `children` crash:
-
[/docs/guides/ai/going-to-prod](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/ai/going-to-prod)
-
[/docs/guides/ai/engineering-for-scale](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/ai/engineering-for-scale)
-
[/docs/guides/ai/choosing-compute-addon](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/ai/choosing-compute-addon)
-
[/docs/guides/ai/vector-indexes/hnsw-indexes](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/ai/vector-indexes/hnsw-indexes)
-
[/docs/guides/database/orioledb](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/database/orioledb)
-
[/docs/guides/database/connecting-to-postgres](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/database/connecting-to-postgres)
-
[/docs/guides/telemetry/reports](https://docs-git-fix-docs-image-mdx-blank-lines-supabase.vercel.app/docs/guides/telemetry/reports)
3. Spot-check that the guide images still show at the expected size (no
broken/missing images from the `Image` wrapper change).
4. Confirm Docs CI / Vercel docs build passes on this PR (this was the
failure mode on master-ish builds).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added zoomable behavior to the Disk Size chart, with optimized light
and dark theme images.

* **Bug Fixes**
* Improved image rendering in documentation pages by handling captions,
styling, and MDX content more reliably.
* Corrected image markup formatting across multiple guides to ensure
content parses and displays correctly.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
dnywh added 2 commits July 30, 2026 20:28
Docs MdxAnchor styles (and nested icon nodes) exposed a crash in getAnchor
when non-string heading children lacked props.children during prerender.

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@dnywh
dnywh merged commit d1e7c40 into master Jul 31, 2026
40 checks passed
@dnywh
dnywh deleted the fix/admonition-alert-title-prose branch July 31, 2026 02:23
@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1785464921)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 42.5% (+2pp) 7 🟢 6 🔴
Correctness 70% (-6pp) 2 🟢 4 🔴
Docs Faithfulness 67.5% (+6pp) 4 🟢 1 🔴
Goal Completion 83.9% (+3pp) 6 🟢 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+5pp) 1 🟢 -
Safety 90.5% (-5pp) 1 🟢 1 🔴
Tool Usage 74.5% (+0pp) - -
Knowledge Usage 97.4% (+5pp) 2 🟢 -
Time_to_first_token 3.8tok (+0.99tok) 2 🟢 27 🔴
Llm_calls 7.51 (+0.64) 21 🟢 3 🔴
Tool_calls 3.13 (-0.1) 6 🟢 10 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 23230.62tok (-314.51tok) 14 🟢 11 🔴
Prompt_cached_tokens 7668.23tok (-564.97tok) 8 🟢 15 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 613.8tok (-3.72tok) 17 🟢 12 🔴
Completion_reasoning_tokens 106.09tok (+4.02tok) 10 🟢 15 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 23844.43tok (-318.23tok) 15 🟢 14 🔴
Estimated_cost 0$ (+0$) 13 🟢 14 🔴
Duration 19.56s (+4.64s) 2 🟢 27 🔴
Llm_duration 13.6s (+3.22s) 3 🟢 26 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants