stack/apps/dashboard
Armaan Jain 5dbfb1ebab
Auth app redesign (#1367)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


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

* **New Features**
* Added a reusable DesignDialog modal system (sizes, variants,
header/footer/headerContent, trigger/close controls).
* Added a documented "roids" skill and pinned it in the skills registry.

* **Documentation**
* Expanded design guide with comprehensive dialog usage patterns,
examples, and props.

* **Improvements**
  * Playground now previews and generates dialog code interactively.
* Auth methods and sign-up rules UIs migrated to the new design system.
* Action dialogs can opt to ignore outside interactions and accept
custom content classes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---

## Summary

Two things bundled together:

1. **New `DesignDialog` primitive** in
`@stackframe/dashboard-ui-components` — the canonical glassmorphic
dashboard modal shell. Exposes configurable sizes (`sm`→`7xl`/`full`),
`glassmorphic` vs `plain` variant, optional icon / title / description /
footer / custom header slots, and a `DesignDialogClose` companion.
Replaces the ad-hoc dialog wrappers scattered across the dashboard.
2. **Auth-app pages migrated onto the design-components system** —
`auth-methods` and `sign-up-rules` are rebuilt on `DesignCard` /
`DesignAlert` / `DesignButton` / `DesignBadge` / `DesignInput` /
`DesignMenu` / `DesignSelectorDropdown` / `DesignDialog`. Live
OAuth-page preview frame, glassmorphic confirmation dialogs, and a
redesigned rule-builder all live behind these new shells.

The design-language catalog page and the `/playground` component
explorer were both extended with full dialog showcases so the new
primitive has a single discoverable home.

**Base:** `dev` → **Head:** `auth-app-redesign`
**Scope:** 11 files changed · +2553 / −1151 lines

---

## Screenshots — before and after

> Captured locally against `http://localhost:8101` at 1440×900 with a
fresh project (`Demo Project`) created via the sign-up + new-project
flow. Dev-only overlays (outdated-version banner, console toasts) are
hidden via injected CSS for clarity.

### Auth methods — `/projects/<id>/auth-methods`

The big page-client rewrite. Before was a flat list of toggleable rows
with a live preview pinned to the right. After is a sectioned layout —
`SIGN-IN METHODS` and `SSO PROVIDERS` get uppercase subheaders, each
method gets a `DesignBadge` icon + description ("Classic email +
password credentials.", "One-time codes delivered by email.",
"Phishing-resistant device-bound credentials."), and empty states (e.g.
SSO with no providers configured) become real call-outs instead of plain
rows.

| Before (`dev`) | After (this PR) |
| --- | --- |
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/before-auth-methods__light.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-auth-methods__light.png)
|
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/before-auth-methods__dark.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-auth-methods__dark.png)
|

### Sign-up rules — `/projects/<id>/sign-up-rules`

Full rule-builder rewrite (CEL ↔ visual tree round-trip kept intact,
just dressed in the new design system). Before's empty state was a flat
alert + plain "Default action" row. After uses `DesignCard` variants —
`NO RULES YET` with an inline "Add your first rule" CTA, an "If no rules
match → Allow sign-up" surface, and a dedicated `TEST RULES` card
linking the simulator.

| Before (`dev`) | After (this PR) |
| --- | --- |
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/before-sign-up-rules__light.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-sign-up-rules__light.png)
|
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/before-sign-up-rules__dark.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-sign-up-rules__dark.png)
|

### Component playground — `/playground`

A new **Dialog** entry was added to the component selector. The before
shots show `dev` — the selector only listed Button (and a handful of
other primitives) and had no Dialog playground at all. The after shots
show the new entry: a props panel for `shape` / `size` / `variant` /
`title` / `description` / `headerIcon` / `footer` / `topRightClose`,
plus an "Open confirmation" button that mounts the live `DesignDialog`.

#### Closed (props panel + code preview)

| Before (`dev` — no Dialog entry) | After (this PR) |
| --- | --- |
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/before-playground-dialog__light.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-playground-dialog__light.png)
|
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/before-playground-dialog__dark.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-playground-dialog__dark.png)
|

> The "before" shots default to the Button playground because the Dialog
entry doesn't exist on `dev` — that's the change.

#### Open (glassmorphic surface in action)

The dialog itself — only available after this PR, so no `dev`
equivalent.

| Light | Dark |
| --- | --- |
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-playground-dialog-open__light.png)
|
![](https://gist.githubusercontent.com/aadesh18/7789d1cf8622693a85f61cd7db91f5c2/raw/after-playground-dialog-open__dark.png)
|
## What changed

- **New** `packages/dashboard-ui-components/src/components/dialog.tsx` —
the `DesignDialog` primitive. Props shape: `size` × `variant` × optional
`icon` / `title` / `description` / `headerContent` / `customHeader` /
`footer` slots, plus `trigger`, `noBodyPadding`, `hideTopCloseButton`,
and per-section `*ClassName` escape hatches. Exports `DesignDialog`,
`DesignDialogClose`, plus the `DesignDialogSize` / `DesignDialogVariant`
/ `DesignDialogProps` types.
- **Exports** wired through
`packages/dashboard-ui-components/src/index.ts` so consumers import from
`@stackframe/dashboard-ui-components` or, by extension, the dashboard's
local `@/components/design-components` barrel.
- **Auth methods page**
(`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/auth-methods/page-client.tsx`)
— full migration. Sign-in methods, OAuth provider list, dot-menu
actions, "Add disabled providers" search dialog, two confirmation
dialogs, sign-up policy block, user-deletion block. Old `Card` / `Input`
/ `Button` / `SettingCard` imports replaced with their design-component
counterparts. `providers.tsx` follows the same migration for the
per-provider config dialogs.
- **Sign-up rules page**
(`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/sign-up-rules/page-client.tsx`)
— the big 1830-line rewrite. Rule builder, empty state,
conditional-group editor, and tester sheet all rebuilt on the new
primitives. CEL ↔ visual-tree conversion (`parseCelToVisualTree` /
`visualTreeToCel`) is unchanged.
- **Design-language catalog**
(`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/design-language/page-client.tsx`)
— adds the Dialog section so the catalog reflects the new primitive.
- **Playground**
(`apps/dashboard/src/app/(main)/(outside-dashboard)/playground/page-client.tsx`)
— adds the Dialog entry with `Shape` / `Size` / `Variant` / `Title` /
`Description` / `Header Icon` / `Footer` / `Top-right close` controls
and live JSX generation.
- **Design guide** (`apps/dashboard/DESIGN-GUIDE.md`) — new "Dialogs"
section documenting when to reach for `DesignDialog` (default),
`DesignDrawer`, `ActionDialog`, or the raw `<Dialog>` primitives, plus
the canonical usage snippet.
- **Action dialog shim**
(`apps/dashboard/src/components/ui/action-dialog.tsx`) — small follow-on
edits so existing `ActionDialog` callers stay consistent with the new
look.

## Notes for reviewers

- **Start with**
`packages/dashboard-ui-components/src/components/dialog.tsx` — it's the
load-bearing piece. The two state machines worth eyeballing are the
`dialogSurfaceClasses` map (glassmorphic vs plain shells, including the
dark-mode ring/backdrop tweaks) and the header/body/footer composition
inside the main `DesignDialog` function.
- **Then** `sign-up-rules/page-client.tsx`. 1830 lines, but the diff is
mostly mechanical (Card→DesignCard, Button→DesignButton, etc.). The
interesting bits are the rule-row layout, the conditional-group editor,
and the simulator drawer — those received structural tweaks, not just
visual ones. The CEL serialization (`parseCelToVisualTree` /
`visualTreeToCel`) was deliberately left alone.
- **OAuth provider migration to non-pushable config** — a `// OAuth
client ID/secret are environment-level (not pushable)` comment was
removed from a couple of call-sites. Behaviour-equivalent (the call
already passes `pushable: false`), just trimmed because the new code is
cleaner. Flag if you want it kept.
- **Catalog routes are dashboard-internal**
(`/projects/<id>/design-language`, `/playground`) — exposed only in
dev/staging, not customer-facing. They exist so design changes have a
discoverable demo surface.
- **Live-preview frame on `auth-methods`** uses a real `<AuthPage>`
inside `BrowserFrame`, fed by the in-progress config. Verify your
changes still render correctly there if you touch `<AuthPage>` props.

## Test plan

- [ ] `/projects/<id>/auth-methods` — toggle each sign-in method; live
preview reflects the change; "Save changes" inline action works; "Add
SSO providers" dialog filters via the search input
- [ ] OAuth provider dot-menu — open the provider config dialog (now
`DesignDialog` glassmorphic), confirm the per-provider switches/inputs
save through the `useUpdateConfig` hook
- [ ] Sign-up confirmation dialogs — toggling "Allow new user sign-ups"
off and back on shows the new warning `DesignAlert`s inside the dialog
- [ ] `/projects/<id>/sign-up-rules` — add a rule, add a condition
group, run the tester sheet; CEL output unchanged vs `dev`
- [ ] `/projects/<id>/design-language` — Dialog showcase renders all
sizes/variants without overflow
- [ ] `/playground` → select **Dialog** — all prop combinations render;
generated code snippet matches the rendered component; "Open
confirmation" launches the glassmorphic shell
- [ ] Light + dark mode visual sanity across all four pages (screenshots
above are the canonical reference)

---------

Co-authored-by: Aadesh Kheria <kheriaaadesh@gmail.com>
2026-05-19 23:03:46 -07:00
..
public [codex] Add TanStack Start SDK integration (#1399) 2026-05-08 10:59:16 -07:00
scripts Custom dashboards and unified ai no playground (#1243) 2026-03-13 20:24:40 +00:00
src Auth app redesign (#1367) 2026-05-19 23:03:46 -07:00
.env Local emulator base (#1233) 2026-03-10 15:15:06 -07:00
.env.development Add Mintlify docs to pnpm run dev 2026-04-06 13:47:53 -07:00
.eslintrc.cjs Config sources (#1083) 2026-01-21 18:08:35 -08:00
.gitignore Custom dashboards and unified ai no playground (#1243) 2026-03-13 20:24:40 +00:00
.npmrc Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
components.json Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
DESIGN-GUIDE.md Auth app redesign (#1367) 2026-05-19 23:03:46 -07:00
instrumentation-client.ts re-enable posthog recordings (#1404) 2026-05-03 23:38:46 -07:00
LICENSE Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
next.config.mjs Remote dev envs (#1435) 2026-05-19 15:54:18 -07:00
package.json Upgrade Next.js 2026-05-19 19:01:00 -07:00
postcss.config.js Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
tailwind.config.ts Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
tsconfig.json fix flaky typecheck test (#1072) 2025-12-17 12:26:12 -08:00
vitest.config.ts In-source unit tests (#429) 2025-02-14 11:47:52 -08:00