Skip to content

chore(studio + design-system): more flexible Admonition - #45302

Merged
awaseem merged 9 commits into
masterfrom
dnywh/chore/depr-551-admonition
May 1, 2026
Merged

awaseem merged 9 commits into
masterfrom
dnywh/chore/depr-551-admonition

Conversation

@dnywh

@dnywh dnywh commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

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

What is the current behavior?

Admonition supports several overlapping content shapes, but it previously did not support a first-class success state or description-only usage cleanly. Title-only usage was also possible, which made some callouts read like floating headings without body copy.

Docs MDX Admonitions could also pick up prose spacing around rich children, while the design-system Tailwind config emitted an ESM/CommonJS warning in the design-system app.

What is the new behavior?

Adds a success Admonition type, description-only support, and a stricter content contract: title or legacy label now requires either description or children. Existing title-only Studio callsites have been converted to description-only callouts.

The design-system docs now include examples for description-only and success Admonitions, plus guidance for title, description, children, and legacy label usage.

This also tightens Admonition body spacing so rich MDX children keep docs link/code styling without inheriting excessive prose margins, and renames the design-system Tailwind config to tailwind.config.cjs so it matches its CommonJS syntax.

Warning and destructive alerts now explicitly set text-foreground, preventing nested Admonition titles from inheriting muted form-description colour after the Tailwind v4 cascade changes.

Before After
Image Image
CleanShot 2026-04-28 at 15 12 41@2x CleanShot 2026-04-28 at 15 13 09@2x
CleanShot 2026-04-28 at 15 17 25@2x CleanShot 2026-04-28 at 15 16 00@2x
Design System Docs
CleanShot 2026-04-28 at 14 59 15@2x

Summary by CodeRabbit

  • New Features

    • Added a "success" admonition variant and new example previews demonstrating success and description-only usages.
  • Documentation

    • Clarified admonition guidance: when to use title vs description vs children; added example sections for short callouts and success messages.
  • Refactor

    • Standardized UI by moving short/advisory text into description across the app and harmonized trailing punctuation.
  • Style

    • Ensured warning/destructive admonitions use consistent foreground text styling.

@vercel

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

Request Review

@coderabbitai

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

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: a2b4f689-dd53-49e5-9d20-4f982b75033a

📥 Commits

Reviewing files that changed from the base of the PR and between 627c132 and 2d596d5.

📒 Files selected for processing (2)
  • apps/design-system/styles/globals.css
  • packages/ui/src/components/shadcn/ui/alert.tsx
✅ Files skipped from review due to trivial changes (1)
  • packages/ui/src/components/shadcn/ui/alert.tsx

📝 Walkthrough

Walkthrough

Adds a success Admonition variant, refactors Admonition props to enforce title/description/children constraints, updates implementation and docs, migrates many Studio usages from title/children to description, and adds two design-system examples (description-only, success).

Changes

Cohort / File(s) Summary
Design System Registry & Examples
apps/design-system/__registry__/index.tsx, apps/design-system/registry/examples.ts, apps/design-system/registry/default/example/admonition-description-only.tsx, apps/design-system/registry/default/example/admonition-success.tsx
Adds two new example registry entries and corresponding example components for description-only and success cases.
Admonition Documentation
apps/design-system/content/docs/fragments/admonition.mdx
Clarifies prop semantics (title = heading slot, description = short body copy; use children for rich content), marks label as legacy, adjusts heading level, and adds previews for the new examples.
Core Admonition Component
packages/ui-patterns/src/admonition.tsx
Introduces success variant and icon/styling, refactors exported AdmonitionProps into base/content unions with stricter constraints, updates rendering and icon selection logic, centralizes body spacing, and adds a runtime guard for invalid prop combinations.
UI Token / Styles
packages/ui/src/components/shadcn/ui/alert.tsx, apps/design-system/styles/globals.css
Tweaks alert variant text color utility classes and updates Tailwind config import path in globals.css.
Studio Component Prop Migration
apps/studio/...
apps/studio/components/interfaces/Auth/Users/UserOverview.tsx, apps/studio/components/interfaces/Database/Publications/PublicationsTables.tsx, apps/studio/components/interfaces/Database/Replication/DestinationPanel/.../DestinationPanelFields.tsx, apps/studio/components/interfaces/Database/RestoreToNewProject/RestoreToNewProject.tsx, apps/studio/components/interfaces/Integrations/Queues/.../QueueSettings.tsx, apps/studio/components/interfaces/Integrations/templates/.../StripeSyncSettingsPage.tsx, apps/studio/components/interfaces/OrganizationInvite/OrganizationInvite.tsx, apps/studio/components/interfaces/Settings/API/PostgrestConfig.tsx, apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx, apps/studio/components/interfaces/Settings/Database/JitDatabaseAccess/JitDbAccessRuleSheet.tsx, apps/studio/components/interfaces/Settings/General/DashboardPreferences.tsx, apps/studio/components/interfaces/Support/ProjectAndPlanInfo.tsx, apps/studio/components/interfaces/TableGridEditor/.../ApiAccessToggle.tsx, apps/studio/pages/cli/login.tsx
Replaces numerous Admonition usages that previously used title or children with description prop, adds trailing periods to messages, and adjusts minor layout/styling in a few places for description rendering.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 I hopped through props both new and old,
Swapped titles for descriptions bold.
A gentle green success appears,
Two examples tucked among the peers.
Small changes, soft thumps — the docs cheer.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 'chore(studio + design-system): more flexible Admonition' directly summarizes the main change—making the Admonition component more flexible across both Studio and design-system packages.
Description check ✅ Passed The description covers all required template sections: change type (Feature and design-system cleanup with issue reference DEPR-551), current behavior, new behavior, and context with visual comparisons.
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/chore/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
Review rate limit: 6/8 reviews remaining, refill in 13 minutes and 4 seconds.

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

@supabase

supabase Bot commented Apr 28, 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 ↗︎.

@dnywh dnywh changed the title ship flexible Admonition chore(studio + design-system): more flexible Admonition Apr 28, 2026
<Admonition
type="warning"
label={`User banned until ${dayjs(user.banned_until).format(DATE_FORMAT)}`}
description={`User banned until ${dayjs(user.banned_until).format(DATE_FORMAT)}`}

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.

You can just invite yourself/a dummy email to a local/staging project and ban to see this.

@github-actions

github-actions Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  205 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  211 tests across 23 suites
duration  6 minutes, 9 seconds
commit  2d596d5

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Broadcast Messages › broadcast modal validates JSON payload

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

Comment on lines +80 to +86
{!isLoadingPermissions && !canUpdatePublications && (
<Admonition
type="warning"
className="mb-4 w-full"
description="You need additional permissions to update database replications."
/>
)}

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.

Made a few tweaks here since it rendered awkwardly to the right.

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.

See image on PR description.

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.

Suppresses the below terminal warning while keeping the existing shared CommonJS Tailwind config intact.

[0] ⚠ ./apps/design-system/tailwind.config.js
[0] Specified module format (EcmaScript Modules) is not matching the module format of the source code (CommonJs)
[0] The EcmaScript module format was specified in the package.json that is affecting this source file or by using an special extension, but it looks like that CommonJs syntax is used in the source code.
[0] Exports made by CommonJs syntax will lead to a runtime error, since the module is in EcmaScript mode. Either change the "type" field in the package.json or replace CommonJs syntax with EcmaScript import/export syntax in the source file.

@dnywh
dnywh marked this pull request as ready for review April 28, 2026 05:25
@dnywh
dnywh requested review from a team as code owners April 28, 2026 05:25

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

LGTM

@awaseem
awaseem merged commit 5bfbae2 into master May 1, 2026
25 checks passed
@awaseem
awaseem deleted the dnywh/chore/depr-551-admonition branch May 1, 2026 13:15
@github-actions

github-actions Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

No experiments to report

@jeremenichelli
jeremenichelli restored the dnywh/chore/depr-551-admonition branch May 4, 2026 14:58
@dnywh
dnywh deleted the dnywh/chore/depr-551-admonition branch May 5, 2026 00:18
@dnywh
dnywh restored the dnywh/chore/depr-551-admonition branch May 5, 2026 00:18
@dnywh
dnywh deleted the dnywh/chore/depr-551-admonition branch May 6, 2026 07:18
dnywh added a commit that referenced this pull request May 8, 2026
## 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 |
| --- |
| <img width="1668" height="1768" alt="CleanShot 2026-05-06 at 17 35
13@2x"
src="https://github.com/user-attachments/assets/1c00ea7f-e3ca-45eb-8af9-3536b657c341"
/> |

## 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


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

* **New Features**
  * Added success admonition variant with dedicated styling and icon.
  * Introduced description-only admonition example.

* **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 and
rendering/precedence behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

3 participants