mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
## What kind of change does this PR introduce? UI improvement ## What is the current behavior? The session expired dialog is quite hard to parse when, for most people, the ask is simple. ## What is the new behavior? Improved session expired dialog: - Refactored to use AlertDialog - Clarified copywriting - Uses the new AlertCollapsible to hide all the complicated debugging steps under a toggle - This component is documented in the design-system | Before | After | | --- | --- | | <img width="1024" height="563" alt="Supabase-B1728A05-DDD2-4A50-AED4-D62EAA2E7D7C" src="https://github.com/user-attachments/assets/771f85d8-21ea-42b5-99f5-b9b05f5617dd" /> | <img width="1024" height="563" alt="Storage Supabase" src="https://github.com/user-attachments/assets/b2fcab68-fb29-4cb9-bd42-aecc57b9fa32" /> | | <img width="1024" height="563" alt="Supabase-B1728A05-DDD2-4A50-AED4-D62EAA2E7D7C" src="https://github.com/user-attachments/assets/771f85d8-21ea-42b5-99f5-b9b05f5617dd" /> | <img width="1024" height="563" alt="Storage Supabase" src="https://github.com/user-attachments/assets/babd3711-5fdf-43b9-be06-d96268a191fd" /> | ## To test In apps/studio/hooks/misc/withAuth.tsx: ```diff - const [isSessionTimeoutModalOpen, setIsSessionTimeoutModalOpen] = useState(false) + const [isSessionTimeoutModalOpen, setIsSessionTimeoutModalOpen] = useState(true) // Mocked as true for UI testing ``` --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
38 lines
755 B
Plaintext
38 lines
755 B
Plaintext
---
|
|
title: Alert Collapsible
|
|
description: An alert-styled block with a collapsible content section, toggled by an icon button.
|
|
component: true
|
|
---
|
|
|
|
<ComponentPreview name="alert-collapsible-demo" peekCode wide />
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { AlertCollapsible } from 'ui'
|
|
```
|
|
|
|
```tsx
|
|
<AlertCollapsible trigger="Need help?">
|
|
<p>Content revealed when expanded.</p>
|
|
</AlertCollapsible>
|
|
```
|
|
|
|
### Default open
|
|
|
|
```tsx
|
|
<AlertCollapsible trigger="Details" defaultOpen>
|
|
<p>This section is expanded by default.</p>
|
|
</AlertCollapsible>
|
|
```
|
|
|
|
### Variants
|
|
|
|
Supports the same `variant` prop as `Alert`: `default`, `destructive`, and `warning`.
|
|
|
|
```tsx
|
|
<AlertCollapsible trigger="Warning" variant="warning">
|
|
<p>Something needs attention.</p>
|
|
</AlertCollapsible>
|
|
```
|