Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5f1fec6
docs(gerente): dashboard refactor design spec
EmiyaKiritsugu3 Jul 9, 2026
797edd7
docs(dashboard): implementation plan for gerente dashboard refactor
EmiyaKiritsugu3 Jul 9, 2026
b8009da
feat(dashboard): replace synthetic crescimentoAnual with real series …
EmiyaKiritsugu3 Jul 9, 2026
76889a4
Revert "feat(dashboard): replace synthetic crescimentoAnual with real…
EmiyaKiritsugu3 Jul 9, 2026
45f193f
feat(dashboard): replace synthetic crescimentoAnual with real series …
EmiyaKiritsugu3 Jul 9, 2026
0a3aeba
feat(dashboard): real Prisma series + KPI deltas, re-throw on DB error
EmiyaKiritsugu3 Jul 9, 2026
eb98934
fix(dashboard): cast stats in data.test to assert crescimentoAnual ab…
EmiyaKiritsugu3 Jul 9, 2026
edb6e50
feat(dashboard): empty state for honest no-data rendering
EmiyaKiritsugu3 Jul 9, 2026
7806e45
feat(dashboard): kpi card component with delta + a11y
EmiyaKiritsugu3 Jul 9, 2026
6d08e64
feat(dashboard): tokenized multi-series charts with a11y + empty-state
EmiyaKiritsugu3 Jul 9, 2026
6a58de1
fix(dashboard): single <main> landmark, move pb-20 to inner wrapper
EmiyaKiritsugu3 Jul 9, 2026
68c9d90
feat(dashboard): wire overview KPI grid + real charts
EmiyaKiritsugu3 Jul 9, 2026
c87ef7f
feat(dashboard): tokenize sub-pages, add pb-20, Suspense on treinos
EmiyaKiritsugu3 Jul 9, 2026
a5abe6e
fix(dashboard): add vi import to multi-chart test (TS2304)
EmiyaKiritsugu3 Jul 9, 2026
cd89df5
feat(dashboard): loading + error boundaries with retry
EmiyaKiritsugu3 Jul 9, 2026
c2830e6
test(dashboard): assert financeiro drops #18181B + text-zinc-400
EmiyaKiritsugu3 Jul 9, 2026
15f9343
refactor(dashboard): delete legacy dashboard-charts.tsx (replaced by …
EmiyaKiritsugu3 Jul 9, 2026
16818ab
docs(dashboard): update CURRENT-STATE for gerente dashboard refactor
EmiyaKiritsugu3 Jul 9, 2026
6c30965
fix(dashboard): honest deltas + faturamento label (final review fixes)
EmiyaKiritsugu3 Jul 9, 2026
dcbf0d6
fix(dashboard): rename Matrículas Ativas → Novas Matrículas to match …
EmiyaKiritsugu3 Jul 9, 2026
9f26b9e
fix(dashboard): narrow DeltasSchema default to receita+novos only
EmiyaKiritsugu3 Jul 9, 2026
83f0d79
test(dashboard): add honest-mock variant — optional deltas → no badge…
EmiyaKiritsugu3 Jul 9, 2026
06c229e
fix(a11y): heading hierarchy + aria-hidden KpiCard triangle
EmiyaKiritsugu3 Jul 9, 2026
8020c24
test(dashboard): isolate .strict() rejection — valid payload + unknow…
EmiyaKiritsugu3 Jul 9, 2026
c938572
docs(dashboard): audit fix wave complete — CURRENT-STATE + plan
EmiyaKiritsugu3 Jul 9, 2026
63654a8
fix(dashboard): omit KpiCard delta badge when delta===0 — neutral not…
EmiyaKiritsugu3 Jul 9, 2026
d576c4f
fix(dashboard): generic error message + Sentry + Logger in error boun…
EmiyaKiritsugu3 Jul 9, 2026
ba20636
fix(dashboard): brl currency formatting on Faturamento chart YAxis + …
EmiyaKiritsugu3 Jul 9, 2026
5936f2f
fix(dashboard): extract TreinosDataWrapper — Suspense now streams dur…
EmiyaKiritsugu3 Jul 9, 2026
5b98d2c
fix(dashboard): getMatriculasPorMes use Matricula.dataInicio not Alun…
EmiyaKiritsugu3 Jul 9, 2026
90c19c8
fix(dashboard): pctDelta returns undefined when no prior period
EmiyaKiritsugu3 Jul 9, 2026
6494b6d
test(dashboard): wrap treinos Suspense renders in act() for streaming…
EmiyaKiritsugu3 Jul 9, 2026
66f74e6
fix(dashboard): add onClick router navigation to Perfil + Configuraçõ…
EmiyaKiritsugu3 Jul 10, 2026
7f5a330
test(dashboard): add useRouter mock to layout test for UserMenu navig…
EmiyaKiritsugu3 Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion docs/CURRENT-STATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
# Estado Atual (2026-07-08)
# Estado Atual (2026-07-09)

## `feat/gerente-dashboard-refactor` — dashboard GERENTE refactor completo (10/10 tasks)

**Branch:** `feat/gerente-dashboard-refactor`. Spec: `docs/superpowers/specs/2026-07-09-gerente-dashboard-refactor-design.md`. Plano: `docs/superpowers/plans/...` (10 tasks TDD, SDD pipeline). Objetivo: equalar dashboard GERENTE ao padrão ALUNO — dados reais (zero fake), tokens de design, empty-states honestos, sem gamification.

### Tarefas (SDD: fresh subagent + task reviewer por task)

- **T1** (`45f193f`): schema real series — `MonthTotalSchema`/`PlanTotalSchema`/`DashboardDeltasSchema` substituem `crescimentoAnual` sintético. `.strict()` em `DashboardStatsSchema`.
- **T2** (`0a3aeba`+`eb98934`): queries Prisma reais (`getMatriculasPorMes` groupBy dataCadastro, `getReceitaPorMes` groupBy dataPagamento, `getMatriculasPorPlano` count ATIVA). `pctDelta()` para KPI deltas. Re-throw em erro DB (sem try/catch swallowing).
- **T3** (`7806e45`): `KpiCard` — Card glass + delta badge (▲▼ ícone+texto verde/vermelho, não só cor), `aria-label`, `data-testid="kpi-<title>"`.
- **T4** (`edb6e50`): `EmptyState` — Card glass tracejado, portado do padrão `card-treino.tsx`. Props `{icon, title, description, testId?}`.
- **T5** (`6d08e64`+`a5abe6e`): `DashboardChartsMulti` — 3 BarCharts recharts tokenizados (matrículas/mês, faturamento/mês, distribuição/plano). `role="img"`+`aria-label` por chart (wrapper div, não BarChart — fix jsdom ResponsiveContainer 0×0). `EmptyState` quando 3 séries vazias.
- **T6** (`68c9d90`): overview page wiring — grid 4 `KpiCard` (Total Alunos, Matrículas Ativas, Inadimplentes, Faturamento Mensal) + `DashboardChartsMulti`. Mapeamento deltas: `.alunos`→Total, `.novos`→Ativas, `.inadimplentes`→Inadimplentes, `.receita`→Faturamento. Moeda BRL.
- **T7** (`6a58de1`): fix double `<main>` landmark — removido `<main>` extra em `layout.tsx`, `pb-20` no inner div. `SidebarInset` (sidebar.tsx) retém `<main>`.
- **T8** (`c87ef7f`+`c2830e6`): tokenize 4 sub-pages (alunos/financeiro/planos/treinos) — `bg-black`→`bg-background`, `#18181B`→`glass-card glow-cyan`, `text-zinc-400`→`text-muted-foreground`, `pb-20`. Suspense em treinos (inerte — prisma findMany precede boundary; `ponytail:` brief-mandated).
- **T9** (`cd89df5`): `loading.tsx` (`DashboardOverviewSkeleton`) + `error.tsx` (`'use client'`, AlertTriangle, `role="alert"`, Button `reset()` "Tentar novamente").
- **T10** (`15f9343`): delete legacy `dashboard-charts.tsx` (+test) — substituído por `dashboard-charts-multi.tsx`. Zero importers.

### Gates (4/4)

- **Vitest**: 1172 pass, 0 fail (subiu de 1164 — novos testes T3-T9).
- **TypeScript** strict: No errors.
- **ESLint**: 0 errors, 0 warnings.
- **E2E**: DEFERIDO para merge-time. Requer Supabase local (54321/54322) + `.env.test` + dev server. Risco baixo: refactor toca só render/token/componente — nenhuma rota/auth/middleware/middleware-rota/API-contract alterado. `npm run e2e` validável antes do PR.

### Notas

- TS7 NO-GO (Next 15.5 build crash + typescript-eslint crash + Prisma block). Mantido TS 6.0.3. Skill `compiler-major-bump-feasibility-audit` extraída.
- `financeiro/page.test.tsx` ganhou assertions `#18181B`+`text-zinc-400` post-review (spec checklist gap do implementer).
- **Audit fix wave (T1-T8)**: 8 tasks from multi-dimension audit — renamed "Matrículas Ativas"→"Novas Matrículas" (match deltas.novos), narrowed DeltasSchema default (receita+novos only), honest-mock test variant (optional deltas→no badge), isolated .strict() rejection test, golden-path getDashboardStats test, heading hierarchy a11y (EmptyState h2 + sr-only h2), aria-hidden KpiCard triangle, 13-month window on getMatriculasPorMes+getReceitaPorMes. Gates: Vitest 1172/0 (+6 tests), tsc clean, lint 0/0. Plan: `docs/superpowers/plans/2026-07-09-gerente-dashboard-audit-fixes.md`.
- PR #199 aberto em main.
- Treinos Suspense é inerte (data fetch no page body precede boundary) — `ponytail:`: brief-mandated, mantém; mover Suspense para dentro de client component se quiser fallback real durante fetch.
- Commits de fixup (`eb98934`, `a5abe6e`) podem ser squashed antes do PR se desejado.

---

## PR #194 `feat/aluno-ui-10-fixes` — review remediation completa (cubic + coderabbit)

Expand Down
Loading
Loading