# CMS UI preview — how to revert

The preview adds **separate routes** (`/site`, `/admin`, `/members`) and shared tokens. Your original marketing site (`/`) and app (`/dashboard`) are unchanged.

## Option 1: Git (recommended)

1. Before merging preview work into your main branch, commit it on a branch:

   ```bash
   git checkout -b cms-ui-preview
   git add app/admin app/members app/site app/ui-preview components/cms lib/cms public/docs
   git add app/globals.css components/ui/badge.tsx package.json package-lock.json
   # Add footer change if you committed it:
   # git add components/footer.tsx
   git commit -m "feat(cms): preview shell (/site /admin /members)"
   ```

2. To **drop the preview** and go back to the previous commit on your branch:

   ```bash
   git checkout <your-branch>   # e.g. dev
   git reset --hard HEAD~1      # only if the CMS commit is the last one; otherwise revert the merge commit
   ```

   Or **stay on `cms-ui-preview`** only while evaluating, and never merge.

3. To remove just one commit from history (after it was pushed), prefer `git revert <sha>` instead of `reset`.

## Option 2: Delete folders and undo file edits (no Git)

Remove these paths:

- `app/admin/`
- `app/members/`
- `app/site/`
- `app/ui-preview/`
- `components/cms/`
- `lib/cms/`
- `public/docs/cms-ui-revert.md`

Then manually revert edits that were only for the CMS preview:

- **`app/globals.css`** — remove the `/* Church CMS UI */` block (`[data-cms-ui]` and `.dark [data-cms-ui]`), remove `--success` / `--warning` from `:root` if you added them only for CMS, and remove the four `--color-success` / `--warning` lines in `@theme inline` if undesired.
- **`components/ui/badge.tsx`** — remove the `success` and `warning` variants if you don’t need them elsewhere.
- **`package.json` / `package-lock.json`** — remove `framer-motion` if nothing else uses it.
- **`components/footer.tsx`** — remove the “New UI (preview)” link if you added it.

Run `npm install` after editing `package.json`, then `npm run build`.

## Preview hub URL

- **`/ui-preview`** — links to all preview routes (also linked from the site footer when enabled).
