refactor: drop toast + over-engineered extras, add inline admin feedback
CI / quality (push) Waiting to run

Phase 1 cleanup of the personal-site revamp. Backend/architecture untouched;
changes are limited to removing unused complexity and restoring feedback.

Removals
- Toast system: delete react-hot-toast, Toaster, QueryToastBridge, lib/toast,
  the toggle/easter-egg calls, related i18n keys and the dependency.
- Contact protection: remove Turnstile + per-IP rate limiting
  (lib/contact-guard, lib/contact-protection, admin screen, form widget,
  app-config wiring, nav entry, test).
- Speculative specs: delete orders, products, downloads, project-inquiry.

Inline feedback (replaces toast, no new deps)
- Add lib/admin-feedback (withFlash/readFlash) and components/admin/admin-flash,
  rendered centrally by AdminDashboardShell.
- Emit success/error messages for media, site-settings, portfolio, smtp,
  marquee and maintenance actions; pages read them via searchParams.
- Contact form shows validation/delivery errors inline; success still
  redirects to /success.

Docs
- Fix stale paths in frontend-system-* (components/root -> components/admin,
  lib/root-navigation -> lib/admin-navigation, drop phantom src/) and remove
  contact-protection references from docs and CLAUDE.md.
- Add docs/PHASE0_DIAGNOSIS.md (diagnosis report).

Note: proxy.ts self-fetch kept intentionally; it also drives maintenance mode.
This commit is contained in:
MohFarawati
2026-07-14 21:03:51 +02:00
parent 1a7b3397f6
commit d48497b992
62 changed files with 443 additions and 1453 deletions
+20 -20
View File
@@ -140,7 +140,7 @@ Patterns:
Repeated in:
- `components/dashboard/dashboard-layout.tsx`
- `components/root/root-dashboard-shell.tsx`
- `components/admin/root-dashboard-shell.tsx`
- many `app/root/*/page.tsx`
Patterns:
@@ -160,8 +160,8 @@ Patterns:
Repeated in:
- `components/root/site-settings-form.tsx`
- `components/root/portfolio-project-form.tsx`
- `components/admin/site-settings-form.tsx`
- `components/admin/portfolio-project-form.tsx`
- `app/root/page.tsx`
Patterns:
@@ -204,7 +204,7 @@ Most repeated token usage:
- `components/ui/textarea.tsx`
- `components/ui/select.tsx`
- `components/dashboard/sidebar.tsx`
- `components/root/contact-protection-form.tsx`
- `components/admin/contact-protection-form.tsx`
- `rounded-[var(--radius-pill)]`
- `components/layout/site-header.tsx`
- `components/layout/floating-preferences.tsx`
@@ -220,13 +220,13 @@ Most repeated token usage:
- several content blocks and previews
- examples:
- `app/root/page.tsx`
- `components/root/site-settings-form.tsx`
- `components/root/media-field-picker.tsx`
- `components/admin/site-settings-form.tsx`
- `components/admin/media-field-picker.tsx`
- `rounded-lg`
- examples:
- `components/ui/dialog.tsx`
- `components/dashboard/dashboard-layout.tsx`
- `components/root/portfolio-project-form.tsx`
- `components/admin/portfolio-project-form.tsx`
## 6. Repeated spacing patterns found in code
@@ -321,14 +321,14 @@ Very common combinations:
- `border border-input bg-background`
- `components/ui/input.tsx`
- `components/ui/select.tsx`
- `components/root/portfolio-categories-manager.tsx`
- `components/root/portfolio-projects-overview.tsx`
- `components/admin/portfolio-categories-manager.tsx`
- `components/admin/portfolio-projects-overview.tsx`
- `bg-primary text-primary-foreground`
- active nav and badges/buttons:
- `components/ui/button.tsx`
- `components/ui/badge.tsx`
- `components/dashboard/sidebar.tsx`
- `components/root/portfolio-subnav.tsx`
- `components/admin/portfolio-subnav.tsx`
- `app/[locale]/(site)/portfolio/page.tsx`
- `text-muted-foreground`
- repeated throughout forms, cards, table headers, descriptions
@@ -406,7 +406,7 @@ Evidence:
- dependency in `package.json`
- broad usage across app and components
- examples:
- `components/root/root-dashboard-shell.tsx`
- `components/admin/root-dashboard-shell.tsx`
- `components/layout/site-header.tsx`
- `components/theme-toggle.tsx`
- `app/root/page.tsx`
@@ -422,8 +422,8 @@ No second React icon library is present in `package.json`.
- public site routes live under:
- `app/[locale]/(site)/*`
- admin routes live under:
- `app/root/*`
- `src` exists but is empty in the current codebase.
- `app/_admin/*` (canonical source), mirrored to `app/admin-internal/*` (rewrite target) and `app/root/*` (dev alias)
- there is no `src/` directory in the codebase.
### Component folders
@@ -431,7 +431,7 @@ No second React icon library is present in `package.json`.
- primitive and near-primitive reusable controls
- `components/layout`
- site shell, hero, header, footer, container, backdrops
- `components/root`
- `components/admin`
- admin feature components and forms
- `components/dashboard`
- admin navigation and dashboard layout shell
@@ -442,7 +442,7 @@ No second React icon library is present in `package.json`.
- `lib/utils.ts`
- `cn()`
- `lib/root-navigation.ts`
- `lib/admin-navigation.ts`
- navigation config for admin shell
- other `lib/*`
- app settings, metadata, locale, media, portfolio, auth
@@ -457,7 +457,7 @@ Confirmed custom wrappers around local primitive layer:
- wraps `Button`
- `components/layout/locale-toggle.tsx`
- uses `Button` and `DropdownMenu`
- `components/root/form-save-button.tsx`
- `components/admin/form-save-button.tsx`
- uses `Button`
## 11. Violations or inconsistencies found in the current codebase
@@ -498,8 +498,8 @@ Examples:
- `components/ui/dialog.tsx`
- `components/dashboard/dashboard-layout.tsx`
- `components/root/site-settings-form.tsx`
- `components/root/portfolio-project-form.tsx`
- `components/admin/site-settings-form.tsx`
- `components/admin/portfolio-project-form.tsx`
### Some primitives follow the local system, some keep stock shadcn-style values
@@ -529,7 +529,7 @@ So the file defines multiple levels, but two of them are currently identical.
Most interactive primitives use Radix wrappers, but `components/ui/tabs.tsx` is a custom React context implementation instead.
### Tailwind scans `src`, but `src` is empty
### Tailwind scans `src`, but `src` does not exist
`tailwind.config.ts`
includes:
@@ -538,7 +538,7 @@ includes:
Current project state:
- `src` contains no files.
- there is no `src/` directory; this glob matches nothing.
## 12. Codex rules derived from the existing system