Skip to content

chore(design-system): redo safer Admonition updates - #45618

Merged
dnywh merged 4 commits into
masterfrom
dnywh/redo-depr-551-admonition
May 8, 2026
Merged

dnywh merged 4 commits into
masterfrom
dnywh/redo-depr-551-admonition

Conversation

@dnywh

@dnywh dnywh commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature and design-system update. Resolves DEPR-551.

This is a narrower redo of #45302 after the revert in #45535.

What is the current behaviour?

The reverted implementation made Admonition more flexible, but it also changed Studio callsites, touched shared Alert styling, renamed the design-system Tailwind config, and changed Docs-facing content/API assumptions in a way that broke production docs static generation.

What is the new behaviour?

Admonition now supports description-only content, children-only content, optional title, legacy label, and type="success" without touching apps/docs/content/** or shared Alert styling.

title wins over label when both are provided. The runtime component props stay backwards-compatible for existing MDX and Studio usage, while AdmonitionStrictProps captures the stricter new-usage contract for tests and future callsites.

The design-system docs and registry include description-only and success examples, and the Admonition tests cover the rendering paths that broke production previously.

After
CleanShot 2026-05-06 at 17 35 13@2x

Additional context

These things that were in #45302 have been left out (unless checked):

  • Studio callsite rewrites from title/label to description
  • Shared Alert text-colour changes
  • Design-system Tailwind config rename
  • Design-system global CSS changes
  • Any docs content migration or label deprecation
  • Any production docs workaround

Summary by CodeRabbit

  • New Features

    • Added success admonition variant with dedicated styling and icon.
    • Added description-only admonition example and registry entries.
  • Documentation

    • Expanded admonition guidance on title vs description usage and best practices.
    • Added example sections showcasing description-only and success variants.
  • Tests

    • Added comprehensive tests covering admonition variants, rendering, and precedence.

@vercel

vercel Bot commented May 6, 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 8, 2026 7:57am
docs Ready Ready Preview, Comment, Open in v0 May 8, 2026 7:57am
learn Ready Ready Preview, Comment May 8, 2026 7:57am
studio-self-hosted Ready Ready Preview, Comment May 8, 2026 7:57am
studio-staging Ready Ready Preview, Comment May 8, 2026 7:57am
ui-library Ready Ready Preview, Comment May 8, 2026 7:57am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 May 8, 2026 7:57am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 8, 2026 7:57am

Request Review

@supabase

supabase Bot commented May 6, 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 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 7703a397-1b1f-465e-986c-b3d5898d569b

📥 Commits

Reviewing files that changed from the base of the PR and between 7d1a64a and 925f7cb.

📒 Files selected for processing (2)
  • packages/ui-patterns/src/admonition.test.tsx
  • packages/ui-patterns/src/admonition.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/ui-patterns/src/admonition.test.tsx
  • packages/ui-patterns/src/admonition.tsx

📝 Walkthrough

Walkthrough

Adds a 'success' Admonition variant, refactors Admonition props/rendering to use unified heading + AlertTitle/AlertDescription, updates dialog callers, and adds tests, docs, and two design-system examples.

Changes

Admonition Component Enhancement & Documentation

Layer / File(s) Summary
Types & Mapping
packages/ui-patterns/src/admonition.tsx
Add 'success' to AdmonitionType; adjust AdmonitionProps (type?, title?, deprecated label?, description?: ReactNode, children?).
Icon / SVG / ForwardRef
packages/ui-patterns/src/admonition.tsx
Add SuccessIcon; extend admonitionSVG for success; update forwardRef prop typing to omit conflicting props.
Core Rendering
packages/ui-patterns/src/admonition.tsx
Compute heading = title ?? label; conditionally render AlertTitle_Shadcn_ and AlertDescription_Shadcn_ for description and children; inject admonitionSVG({ type }); choose SuccessIcon when appropriate.
Dialog callers
packages/ui-patterns/src/Dialogs/ConfirmationModal.tsx, packages/ui-patterns/src/Dialogs/TextConfirmModal.tsx
Destructure alert?.base into alertBase, compute alertTitleProps from alert?.title, and pass ...alertTitleProps, ...alertBase to Admonition.
Tests
packages/ui-patterns/src/admonition.test.tsx
New Vitest+RTL suite validating description-only, children, title+description, title+children, success styling/icon path, omission of icon when requested, and title precedence over legacy label.
Docs & Examples
apps/design-system/content/docs/fragments/admonition.mdx, apps/design-system/registry/...
Add usage guidance (title vs description, deprecate label for new code), add "Description only" and "Success" previews, add two example components and register them in the design-system registries.

Sequence Diagram

sequenceDiagram
  actor User
  participant Admonition
  participant AlertTitle as AlertTitle_Shadcn_
  participant AlertDescription as AlertDescription_Shadcn_
  participant SVG as admonitionSVG
  participant Icon as Icon

  User->>Admonition: render(type, title/label, description, children)
  Admonition->>Admonition: compute typeStyle & heading (title ?? label)
  alt heading exists
    Admonition->>AlertTitle: render title
  end
  alt description or children exist
    Admonition->>AlertDescription: render content
  end
  Admonition->>SVG: apply admonitionSVG({ typeStyle })
  Admonition->>Icon: render icon for type (SuccessIcon or existing)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through props and tiny lines,
A success icon sparkles, the heading aligns,
Titles and descriptions find their place,
Tests and examples show the face—
The Admonition smiles in tidy design.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: redoing safer Admonition updates to resolve DEPR-551 after a prior revert.
Description check ✅ Passed The PR description provides comprehensive context, clearly explains the changes, and follows the required template structure with all key sections filled.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/redo-depr-551-admonition

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.

@dnywh
dnywh marked this pull request as ready for review May 6, 2026 07:31
@dnywh
dnywh requested a review from a team as a code owner May 6, 2026 07:31
@dnywh dnywh changed the title redo safer Admonition updates chore(design-system): redo safer Admonition updates May 6, 2026
@dnywh
dnywh marked this pull request as draft May 6, 2026 07:31
@dnywh
dnywh marked this pull request as ready for review May 6, 2026 07:38
@github-actions

github-actions Bot commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  206 passed
skipped  5 skipped

Details

stats  211 tests across 23 suites
duration  5 minutes, 30 seconds
commit  925f7cb

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/admonition.tsx`:
- Around line 146-150: The current JSX renders WarningIcon for destructive
admonitions even when showIcon is false because the condition " (showIcon &&
typeMapped === 'warning') || typeMapped === 'destructive' " escapes the showIcon
guard; update the conditional in admonition.tsx (the expression handling icon /
showIcon / typeStyle / typeMapped and rendering SuccessIcon/WarningIcon) so that
showIcon is required for both warning and destructive cases, e.g. require
showIcon && (typeMapped === 'warning' || typeMapped === 'destructive') so that
showIcon={false} prevents the WarningIcon for destructive types.
🪄 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: 516c539d-b557-427a-af21-2945abc7c269

📥 Commits

Reviewing files that changed from the base of the PR and between 1797301 and 7d1a64a.

📒 Files selected for processing (2)
  • packages/ui-patterns/src/admonition.test.tsx
  • packages/ui-patterns/src/admonition.tsx

Comment thread packages/ui-patterns/src/admonition.tsx Resolved
@dnywh
dnywh enabled auto-merge (squash) May 8, 2026 07:53
@dnywh
dnywh merged commit 04c9fb7 into master May 8, 2026
24 checks passed
@dnywh
dnywh deleted the dnywh/redo-depr-551-admonition branch May 8, 2026 07:59
@github-actions

github-actions Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1778227277)

Score Average Improvements Regressions
Completeness 96% (+0pp) 1 🟢 2 🔴
Conciseness 20.7% (-1pp) 5 🟢 6 🔴
Correctness 68.1% (-4pp) 1 🟢 3 🔴
Docs Faithfulness 61.8% (-2pp) 3 🟢 4 🔴
Goal Completion 81.3% (+5pp) 7 🟢 5 🔴
Safety 90.5% (-5pp) - 1 🔴
Tool Usage 75.6% (+9pp) 3 🟢 -
Knowledge Usage 96.7% (+0pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Time_to_first_token 0.02tok (0tok) 12 🟢 13 🔴
Llm_calls 11.64 (+0.53) 16 🟢 5 🔴
Tool_calls 3.01 (+0.12) 8 🟢 10 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 20926.8tok (-277.09tok) 8 🟢 13 🔴
Prompt_cached_tokens 6307.84tok (+136.53tok) 11 🟢 10 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 595.61tok (+29.64tok) 11 🟢 14 🔴
Completion_reasoning_tokens 94.24tok (-7.35tok) 14 🟢 8 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 21522.41tok (-247.45tok) 8 🟢 17 🔴
Estimated_cost 0$ (0$) 10 🟢 13 🔴
Duration 24.91s (+5.43s) 3 🟢 22 🔴
Llm_duration 13.3s (+0.79s) 9 🟢 16 🔴

dnywh added a commit that referenced this pull request May 18, 2026
## What kind of change does this PR introduce?

Docs update. Related to DEPR-551.

## What is the current behavior?

Docs MDX still uses the legacy `label` prop for Admonitions, even though
#45618 added `title` and kept `label` only as a backwards-compatible
alias after #45302 was reverted in #45535.

## What is the new behavior?

Migrates Docs-owned Admonitions from `label=` to `title=` without
changing rendered copy, component APIs, Studio callsites, design-system
examples, or the legacy `label` alias.

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

* **Documentation**
* Standardized admonition headings across the docs by switching how
admonition headings are provided (preserving all visible guidance and
examples). Content and instructions remain unchanged; this ensures
consistent rendering of callouts and improves uniformity across guides
and reference pages.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46053?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Chris Chinchilla <[email protected]>
dnywh added a commit that referenced this pull request May 19, 2026
## What kind of change does this PR introduce?

Chore. Follow-up to DEPR-551, #45302, #45535, and #45618.

## What is the current behaviour?

Some short Studio Admonitions still put their entire message in `title`
or legacy `label`, so body-copy callouts render as headings.

## What is the new behaviour?

Moves selected single-message Studio Admonitions to `description`,
keeping the follow-up deliberately limited to Studio callsites.

This PR does not touch Docs content, shared Alert styling, ui-patterns,
design-system registry/docs, or Tailwind config.

| Before | After |
| --- | --- |
| <img width="1818" height="388" alt="Image"
src="https://github.com/user-attachments/assets/283a1853-348a-4d74-a408-013957350e5e"
/> | <img width="1380" height="462" alt="Image"
src="https://github.com/user-attachments/assets/e5761e8e-3697-423b-805b-45110205099a"
/> |
| <img width="1640" height="716" alt="CleanShot 2026-04-28 at 15 17
25@2x"
src="https://github.com/user-attachments/assets/a5be4d5f-2bf7-4dc2-b396-56129fe64ec9"
/> | <img width="1630" height="716" alt="CleanShot 2026-04-28 at 15 16
00@2x"
src="https://github.com/user-attachments/assets/0d589252-aaf8-4efc-9d81-15ec4f99ec61"
/> |


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

## Summary by CodeRabbit

* **Style**
* Refined message displays and admonition styling across settings,
database, dashboard, and admin interfaces for improved visual
consistency and clarity.

* **UI Updates**
* Updated search input layouts and form element styling in publications
tables and other admin pages.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46049?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
dnywh added a commit that referenced this pull request May 19, 2026
## What kind of change does this PR introduce?

Bug fix. Follow-up to DEPR-551, #45302, #45535, #45618, and stacked on
#46049.

## What is the current behaviour?

Warning and destructive Alert variants do not explicitly own their
foreground text colour. In muted parent contexts, nested Admonition
content can inherit lighter text styling.

## What is the new behaviour?

Warning and destructive Alert variants now include `text-foreground`,
just like the default counterpart.

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

## Summary by CodeRabbit

* **Style**
* Updated styling for alert components with destructive and warning
variants.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46050?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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