Date: 2026-08-15 Scope: Complete redesign of the PehchaanAI frontend (React + Vite + Tailwind v4 + Framer Motion)
The frontend looked broken because Tailwind v4 was being used with a Tailwind v3-style JS config. Custom colors (indigo-450, cyan-450, ocean-900, etc.) defined in tailwind.config.js were not applied because Tailwind v4 reads theme tokens from CSS @theme, not the JS config. Many pages also still used a leftover light theme (gray-900, bg-gray-50, text-blue-600), creating an inconsistent, misaligned look.
User requested: "redesign the dashboards entirely, don't build upon it, make it good, use skills."
frontend/src/styles.css— rewrote with proper Tailwind v4@themeblock:- New color system:
brandscale (indigo-based),cyan-450,violet-450/550,emerald-450,amber-450,rose-450,oceanscale (background navy). - Fonts: Inter (body), Space Grotesk (display), JetBrains Mono (mono).
- Glow shadows (
shadow-glow-brand/cyan/emerald), float keyframes, glass card classes. prefers-reduced-motionsupport.
- New color system:
tailwind.config.jsleft in place (harmless, unused by v4 postcss plugin).
frontend/src/components/motion/primitives.tsx— reusable primitives:Reveal,Stagger,StaggerItem,FadeIn,ScaleIn,PageTransition- Easing tokens
EASE = [0.16,1,0.3,1], all respectuseReducedMotion.
| File | Status |
|---|---|
src/components/layout/Layout.tsx |
✅ Sidebar w/ animated active indicator (layoutId), mobile drawer, sticky header |
src/pages/DashboardPage.tsx |
✅ Hero, animated stat cards, SVG circular progress, quick actions, recent cases, dev progress |
src/pages/LoginPage.tsx |
✅ Staggered entrance, glass card, password toggle |
src/pages/RegisterPage.tsx |
✅ Same treatment as login + validation hints |
src/pages/CaseListPage.tsx |
✅ Search + status tabs, staggered case cards |
src/pages/SearchPage.tsx |
✅ Upload w/ preview, sliders, animated similarity bars in result cards |
src/pages/ReportsPage.tsx |
✅ Case selector + report preview |
src/pages/CaseCreatePage.tsx |
✅ Header restyled |
src/components/cases/CaseDetail.tsx |
✅ Rebuilt dark, animated similarity bars, expandable candidate cards |
src/components/cases/CaseCreateForm.tsx |
✅ Step wizard (upload→details→success), preview, animated transitions |
src/components/ui/Card.tsx, Button.tsx, ProgressBar.tsx, Input.tsx |
✅ Updated to brand palette |
src/components/auth/ProtectedRoute.tsx |
✅ Loading screen now dark theme |
src/App.tsx |
✅ Loading screen dark theme |
- Added
framer-motion(npm install framer-motion).
- ✅
npx tsc -p tsconfig.json --noEmitpasses - ✅
npm run buildpasses (CSS 62.6 kB, custom classes confirmed in output) - ✅
npx vitedev server starts clean on :5173 ⚠️ No frontend test files exist (npm test→ "No test files found", exit 1). Backend has pytest tests.
# Backend (port 8000) — from project root
cd backend && python main.py
# Frontend (port 5173) — from project root
cd frontend && npm run devfrontend/src/components/cases/CaseList.tsxis orphaned (old light theme, no longer imported). Delete or restyle — not blocking.frontend/src/components/ui/FileUpload.tsxstill references some old custom classes (rose-450,cyan-450,ease-smooth,animate-bounce-in) — no longer imported anywhere (SearchPage & CaseCreateForm have inline upload UI). Safe to delete.- Visual QA on a browser not performed (no browser available in session). User should view
/login,/dashboard(needs auth) at localhost:5173. frontend/src/types/api.tsexists; API types duplicated inservices/api.ts— could consolidate later.
- Palette: dark navy (
ocean-950/900), indigo brand accent, cyan secondary accent, emerald=success/active, amber=medium, rose=danger. - Surfaces: glass cards
card-glass+rounded-2xl, subtle white/5–10 borders, no heavy noise overlays. - Type: Space Grotesk for headings (
font-display), Inter body, JetBrains Mono for IDs/scores. - Motion: 200–700ms,
EASE = [0.16,1,0.3,1], stagger 40–80ms, blur-fade reveals, animated similarity bars, spring nav indicator. - Accessibility: all motion respects
prefers-reduced-motion; focus ringsfocus-visible.
Scope: Fix broken /dashboard layout + invisible content + auth failing after a stray stub was removed.
- Layout:
Layout.tsxsidebar hadlg:static-> in document flow on desktop -> pushed entire content down (~490px empty gap). - Invisible content:
primitives.tsxbaseVariants.visiblewas a function;{...baseVariants.visible}(a function spread) ={}. SoReveal/StaggerItemvisiblevariants had no opacity/y/filter -> content frozen at opacity 0. (Found via Playwright bisection: hand-written plain-object variants worked; shared primitives didn't.) - Fake account "Aarav Sharma": leftover dev stub
C:\Users\HP\AppData\Local\Temp\opencode\stub_api.mjs(node) shared port 8000 with real uvicorn and hardcoded a fake user + 5 fake cases. Killed PID 8384. - "Failed to fetch" login/register: after the stub (which sent
Access-Control-Allow-Origin: *) was removed, the real backend CORS allowlist only had localhost:3000/5173 -> any request from the Vite LAN URL (http://192.168.0.123:5173) was blocked preflight (400, no ACAO -> browser shows "Failed to fetch").
Layout.tsx: sidebar alwaysfixed; drawer x toggled bysidebarOpen+useIsDesktop()(matchMedia 1024px). Removedlg:staticand CSS transform classes (framer drives transform).primitives.tsx:baseVariants.visiblenow a plain object.backend/config.py+backend/.env: CORS defaults includehttp://127.0.0.1:5173andhttp://192.168.0.123:5173(string wrapped for flake8 E501).- Backend restarted on 8000 (
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000). Note: config reload on .py edit;.envedits need restart.
- Desktop 1440x900 + mobile 390x844: main starts at y=65, 0 opacity-0 elements on desktop, all sections visible, mobile drawer closes to x=-280 / opens to x=0.
- CORS preflight 200 + correct ACAO from localhost / 127.0.0.1 / LAN IP.
- Browser E2E: register -> /dashboard (name in sidebar + hero) -> sign out -> sign in -> /dashboard. No network errors.
npm run buildpasses;pytest= 24 passed; black + flake8 clean on changed backend file.
- Frontend has no test files (vitest exits 1); no ESLint config (tsc is typecheck). E2E search flow (create case -> upload -> search) not yet automated. CaseList.tsx / FileUpload.tsx orphaned (old theme), safe to delete.