Repository navigation
fix(ui): align Admonition titles and docs link hover with prose - #48428
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughDocumentation 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. ChangesDocumentation and admonition presentation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/ui/src/components/shadcn/ui/alert.tsx (1)
53-53: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueUse 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 usemt-0!and the!after each utility inAdmonitionBodyClassNameso 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
📒 Files selected for processing (7)
apps/docs/content/guides/integrations/build-a-supabase-oauth-integration/oauth-scopes.mdxapps/docs/content/guides/platform/multi-factor-authentication.mdxapps/docs/features/docs/MdxAnchor.tsxpackages/config/typography.config.jspackages/ui-patterns/src/Admonition/Admonition.test.tsxpackages/ui-patterns/src/Admonition/Admonition.tsxpackages/ui/src/components/shadcn/ui/alert.tsx
This comment has been minimized.
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.
e5a5383 to
9785651
Compare
There was a problem hiding this comment.
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/AlertDescriptionstructure and addsdata-slotattributes, aligning Admonition title typography with prose body sizing. - Refactors
Admonitionto render titles viaAlertTitleand to wrap bothdescriptionand MDXchildreninAlertDescription, 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. |
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.
There was a problem hiding this comment.
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
descriptionandchildrenare provided, this renders two separateAlertDescriptionblocks 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 mergingdescription+childreninto a singleAlertDescriptioncontainer.
{description && (
<AlertDescription
{...childProps?.description}
className={cn(admonitionBodyClassName, childProps?.description?.className)}
>
czenko
left a comment
There was a problem hiding this comment.
Previewed admonitions and they look as expected.
I wonder if we have considered using visual regression tests on the style system? 🤔
| 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' | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
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.
…nk lines" This reverts commit d624587.
…#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 -->
Docs MdxAnchor styles (and nested icon nodes) exposed a crash in getAnchor when non-string heading children lacked props.children during prerender.
Braintrust eval report
|
What kind of change does this PR introduce?
UI bug fix.
What is the current behavior?
After the recent Admonition a11y refactor:
divattext-smwhile body<p>s took prose ~15pxPrior issues:
[**…**](…)What is the new behavior?
AlertTitleis a<p>with!mt-0 mb-0.5 font-medium(not anh5/ barediv), so it does not break heading hierarchy and matches admonition body font-size under proseAlertTitleagain (though with<p>as explained above) and wraps MDXchildreninAlertDescription(same asdescription)Alert/AlertTitle/AlertDescriptiongetdata-slotattributes; description keeps string→<p>wrapping, Studio density, plustext-balancea:hoverandMdxAnchornow move text + decoration toward foreground (InlineLink-like), without stealing brand link colour viatext-inheritTo test
Docs
Blog
Other
text-smoutside prose. Preview: studio-stagingSummary by CodeRabbit
Summary by CodeRabbit
New Features
Style
Bug Fixes
Tests