feat(aluno): dashboard UI polish — remove fake stats, fix spacing, clean up#193
Conversation
…ean up unused imports - Remove fake "Meta Semanal 80%" stat (no prior-period data) - Remove fake "Power Index 752" stat (no real metric) - Remove non-functional "Ver Todas" button on achievements - Remove dangling grid-closing div causing JSX broken tree - Remove unused Button import (TS6133) - Fix workoutsThisMonth i18n interpolation - Clean up pb-20 double padding
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
WalkthroughThis PR updates the ALUNO dashboard cleanup and planning docs, adds change-tracking metadata, and extends seeding to create fixed test users and Supabase Auth accounts. It also adds a seed password example to the environment template. ChangesDashboard client fixes and planning docs
Seed auth and E2E user setup
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tmp-output.json (1)
1-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove this scratch/planning artifact from the PR.
This file appears to be an internal change-tracking/planning artifact (task list, rationale, region hints) generated during development, not application code or configuration consumed by the app. It shouldn't be committed to the repository.
🧹 Suggested fix
-tmp-output.jsonRemove this file from the PR (add to
.gitignoreif it's a recurring tooling artifact).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tmp-output.json` around lines 1 - 43, This file is a scratch/planning artifact rather than app code, so remove it from the repository and the PR. Delete the generated change-tracking content entirely, and if this artifact is produced repeatedly by tooling, update the relevant ignore rules so tmp-output.json is not committed again.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tmp-output.json`:
- Around line 1-43: This file is a scratch/planning artifact rather than app
code, so remove it from the repository and the PR. Delete the generated
change-tracking content entirely, and if this artifact is produced repeatedly by
tooling, update the relevant ignore rules so tmp-output.json is not committed
again.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6d4c340c-3ec7-470b-abcf-a30549a1661b
📒 Files selected for processing (4)
docs/PRODUTO/PRD-UI-Aluno-Aprimoramento.mddocs/superpowers/specs/2026-07-07-aluno-dashboard-ui-audit-design.mdsrc/app/aluno/dashboard/dashboard-client.tsxtmp-output.json
There was a problem hiding this comment.
3 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tmp-output.json">
<violation number="1" location="tmp-output.json:1">
P2: This looks like an accidentally committed temporary/output file. `tmp-output.json` contains change-planning metadata rather than application code or configuration, is not referenced by any build scripts or docs, and is not ignored by `.gitignore`. It should be removed from the repository before merge to avoid polluting the codebase with generated artifacts.</violation>
</file>
<file name="src/app/aluno/dashboard/dashboard-client.tsx">
<violation number="1" location="src/app/aluno/dashboard/dashboard-client.tsx:139">
P2: The workout-count card now duplicates the numeric count in both the small label and the large value. The `dashboard.workoutsThisMonth` translation template includes a `{count}` placeholder (`"{count} treinos no mês"`), so the label renders something like "12 treinos no mês" directly above the large "12". The previous code intentionally passed an empty count and stripped residual formatting specifically to avoid this duplication. To fix this cleanly without re-introducing the hack, consider adding a separate count-free translation key such as `dashboard.workoutsThisMonthLabel` ("treinos no mês") and using it here while keeping the interpolated key for contexts that need the count embedded.</violation>
</file>
<file name="docs/PRODUTO/PRD-UI-Aluno-Aprimoramento.md">
<violation number="1" location="docs/PRODUTO/PRD-UI-Aluno-Aprimoramento.md:192">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**
This PRD contains a fabricated workflow script under "Workflow ultracode (opcional, para verificação adversarial)" that references multiple things that do not exist in the repository: the `.claude/workflows/` directory (and `aluno-ui-premium-exec-wf.js` file), the `phase()`, `parallel()`, and `agent()` orchestration functions, and an undefined `TASKS` variable. Shipping documentation that presents imaginary files, APIs, and paths as real misleads future readers and adds noise to the repo. Consider removing this section entirely, or replacing it with a reference to the project's actual CI/testing workflow.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
There was a problem hiding this comment.
4 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="prisma/seed.ts">
<violation number="1" location="prisma/seed.ts:31">
P1: The auth seeding in `createAuthUser` is non-idempotent and silently swallows errors. On every run the script deletes and recreates all `funcionario`/`aluno` rows with new random UUIDs, but existing Supabase Auth users are never removed. When re-run, `supabase.auth.admin.createUser` fails with "already exists" for the same email; the code merely logs `skipped` and continues, leaving the Auth user with its old UUID while the Prisma record now has a new one. Since the code explicitly passes the Prisma `id` into `createUser`, the intent is clearly that the IDs stay in sync, so reruns silently break that invariant. Actual auth creation errors are also only `console.warn`-ed, letting the script claim `✅ Seed complete!` even when no login credentials were created.
Consider making auth creation idempotent — for example, by reading the existing auth user and updating its UUID if needed, or by deleting and recreating auth users alongside the Prisma records. Also consider `throw`ing on unexpected errors so seed failures surface immediately rather than being buried in console output.</violation>
<violation number="2" location="prisma/seed.ts:179">
P2: The default seed duplicates E2E fixture logic that is already handled by the dedicated `prisma/seed-e2e.ts` script. injecting `@test.com` users into every seeded database (dev, demo, staging) and re-creating Supabase Auth credentials for fixed IDs that `seed-e2e.ts` owns. This creates two maintenance risks:
1. **Drift in passwords**: the auth helper and `seed-e2e.ts` use `E2E_DEFAULT_PASSWORD`, but the default seed uses `SEED_DEFAULT_PASSWORD`. If these env vars diverge, the same fixed IDs will end up with different passwords depending on which seed runs last.
2. **Polluted seed data**: anyone running the default seed now gets test users in their local or staging DB.
It would be safer to keep E2E fixtures isolated in `seed-e2e.ts` and remove section `6.` (and the matching auth creation in section `7.`) from the default seed. If you need parity in local dev, you can document running `npm run seed:e2e` after the default seed instead.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| ...(id ? { id } : {}), | ||
| }); | ||
|
|
||
| if (error) { |
There was a problem hiding this comment.
P1: The auth seeding in createAuthUser is non-idempotent and silently swallows errors. On every run the script deletes and recreates all funcionario/aluno rows with new random UUIDs, but existing Supabase Auth users are never removed. When re-run, supabase.auth.admin.createUser fails with "already exists" for the same email; the code merely logs skipped and continues, leaving the Auth user with its old UUID while the Prisma record now has a new one. Since the code explicitly passes the Prisma id into createUser, the intent is clearly that the IDs stay in sync, so reruns silently break that invariant. Actual auth creation errors are also only console.warn-ed, letting the script claim ✅ Seed complete! even when no login credentials were created.
Consider making auth creation idempotent — for example, by reading the existing auth user and updating its UUID if needed, or by deleting and recreating auth users alongside the Prisma records. Also consider throwing on unexpected errors so seed failures surface immediately rather than being buried in console output.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At prisma/seed.ts, line 31:
<comment>The auth seeding in `createAuthUser` is non-idempotent and silently swallows errors. On every run the script deletes and recreates all `funcionario`/`aluno` rows with new random UUIDs, but existing Supabase Auth users are never removed. When re-run, `supabase.auth.admin.createUser` fails with "already exists" for the same email; the code merely logs `skipped` and continues, leaving the Auth user with its old UUID while the Prisma record now has a new one. Since the code explicitly passes the Prisma `id` into `createUser`, the intent is clearly that the IDs stay in sync, so reruns silently break that invariant. Actual auth creation errors are also only `console.warn`-ed, letting the script claim `✅ Seed complete!` even when no login credentials were created.
Consider making auth creation idempotent — for example, by reading the existing auth user and updating its UUID if needed, or by deleting and recreating auth users alongside the Prisma records. Also consider `throw`ing on unexpected errors so seed failures surface immediately rather than being buried in console output.</comment>
<file context>
@@ -12,6 +13,35 @@ const pool = new Pool({ connectionString: process.env.DATABASE_URL });
+ ...(id ? { id } : {}),
+ });
+
+ if (error) {
+ if (
+ error.message.includes('already been registered') ||
</file context>
| }, | ||
| }); | ||
|
|
||
| // 6. E2E Test Users — cria registros Prisma para usuários de teste |
There was a problem hiding this comment.
P2: The default seed duplicates E2E fixture logic that is already handled by the dedicated prisma/seed-e2e.ts script. injecting @test.com users into every seeded database (dev, demo, staging) and re-creating Supabase Auth credentials for fixed IDs that seed-e2e.ts owns. This creates two maintenance risks:
- Drift in passwords: the auth helper and
seed-e2e.tsuseE2E_DEFAULT_PASSWORD, but the default seed usesSEED_DEFAULT_PASSWORD. If these env vars diverge, the same fixed IDs will end up with different passwords depending on which seed runs last. - Polluted seed data: anyone running the default seed now gets test users in their local or staging DB.
It would be safer to keep E2E fixtures isolated in seed-e2e.ts and remove section 6. (and the matching auth creation in section 7.) from the default seed. If you need parity in local dev, you can document running npm run seed:e2e after the default seed instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At prisma/seed.ts, line 179:
<comment>The default seed duplicates E2E fixture logic that is already handled by the dedicated `prisma/seed-e2e.ts` script. injecting `@test.com` users into every seeded database (dev, demo, staging) and re-creating Supabase Auth credentials for fixed IDs that `seed-e2e.ts` owns. This creates two maintenance risks:
1. **Drift in passwords**: the auth helper and `seed-e2e.ts` use `E2E_DEFAULT_PASSWORD`, but the default seed uses `SEED_DEFAULT_PASSWORD`. If these env vars diverge, the same fixed IDs will end up with different passwords depending on which seed runs last.
2. **Polluted seed data**: anyone running the default seed now gets test users in their local or staging DB.
It would be safer to keep E2E fixtures isolated in `seed-e2e.ts` and remove section `6.` (and the matching auth creation in section `7.`) from the default seed. If you need parity in local dev, you can document running `npm run seed:e2e` after the default seed instead.</comment>
<file context>
@@ -146,6 +176,85 @@ async function main() {
},
});
+ // 6. E2E Test Users — cria registros Prisma para usuários de teste
+ // (IDs fixos batem com prisma/seed-e2e.ts e tests/e2e/helpers/auth.ts)
+ const e2eGerenteId = '550e8400-e29b-41d4-a716-000000000001';
</file context>
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
There was a problem hiding this comment.
2 issues found across 6 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".gitignore">
<violation number="1" location=".gitignore:168">
P2: Custom agent: **Enforce Strict Maintainability Standards**
The trailing `.env*` pattern at the end of `.gitignore` overrides the existing `!.env.example` negation earlier in the file. Because gitignore applies the last matching rule, `.env*` will match `.env.example` and cause it to be ignored again — silently undermining the explicit decision to keep `.env.example` tracked. Consider either moving `!.env.example` after `.env*` or replacing `.env*` with narrower patterns that don't accidentally catch `.env.example`.</violation>
</file>
<file name="prisma/seed.ts">
<violation number="1" location="prisma/seed.ts:37">
P2: The seed script's `createAuthUser` function skips existing Supabase Auth users without verifying or updating their IDs or passwords. When re-seeding, non-E2E demo users get new random UUIDs in Prisma (`crypto.randomUUID()`), but the corresponding Auth users retain their old IDs. Because the app's RLS policies match `auth.uid()` directly against `funcionario.id` and `aluno.id`, these ID mismatches break login for demo users after a re-seed. Consider either using fixed UUIDs for non-E2E seed users (matching the E2E pattern), or calling the Supabase admin update API in the skip branch to keep the Auth record in sync.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| qa/ | ||
| .sisyphus/evidence/ | ||
| .omo/ | ||
| .env* |
There was a problem hiding this comment.
P2: Custom agent: Enforce Strict Maintainability Standards
The trailing .env* pattern at the end of .gitignore overrides the existing !.env.example negation earlier in the file. Because gitignore applies the last matching rule, .env* will match .env.example and cause it to be ignored again — silently undermining the explicit decision to keep .env.example tracked. Consider either moving !.env.example after .env* or replacing .env* with narrower patterns that don't accidentally catch .env.example.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .gitignore, line 168:
<comment>The trailing `.env*` pattern at the end of `.gitignore` overrides the existing `!.env.example` negation earlier in the file. Because gitignore applies the last matching rule, `.env*` will match `.env.example` and cause it to be ignored again — silently undermining the explicit decision to keep `.env.example` tracked. Consider either moving `!.env.example` after `.env*` or replacing `.env*` with narrower patterns that don't accidentally catch `.env.example`.</comment>
<file context>
@@ -165,3 +165,5 @@ graphify-out/
qa/
.sisyphus/evidence/
.omo/
+.env*
+tmp-output.json
</file context>
| error.message.includes('already been registered') || | ||
| error.message.includes('already exists') | ||
| ) { | ||
| console.log(` Auth user ${email} already exists (expected on re-seed)`); |
There was a problem hiding this comment.
P2: The seed script's createAuthUser function skips existing Supabase Auth users without verifying or updating their IDs or passwords. When re-seeding, non-E2E demo users get new random UUIDs in Prisma (crypto.randomUUID()), but the corresponding Auth users retain their old IDs. Because the app's RLS policies match auth.uid() directly against funcionario.id and aluno.id, these ID mismatches break login for demo users after a re-seed. Consider either using fixed UUIDs for non-E2E seed users (matching the E2E pattern), or calling the Supabase admin update API in the skip branch to keep the Auth record in sync.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At prisma/seed.ts, line 37:
<comment>The seed script's `createAuthUser` function skips existing Supabase Auth users without verifying or updating their IDs or passwords. When re-seeding, non-E2E demo users get new random UUIDs in Prisma (`crypto.randomUUID()`), but the corresponding Auth users retain their old IDs. Because the app's RLS policies match `auth.uid()` directly against `funcionario.id` and `aluno.id`, these ID mismatches break login for demo users after a re-seed. Consider either using fixed UUIDs for non-E2E seed users (matching the E2E pattern), or calling the Supabase admin update API in the skip branch to keep the Auth record in sync.</comment>
<file context>
@@ -33,12 +34,12 @@ async function createAuthUser(
error.message.includes('already exists')
) {
- console.log(` Auth user ${email} already exists — skipped`);
+ console.log(` Auth user ${email} already exists (expected on re-seed)`);
} else {
console.warn(` ⚠️ Auth user ${email}: ${error.message}`);
</file context>



Changes
Buttonimport (TS6133)workoutsThisMonthi18n interpolation (was using.replaceAll(': ', '')hack)pb-20double padding on containerWhy
The ALuno dashboard had accumulated fake/mock stats that mislead users. Removing them aligns with the mobile-first premium polish roadmap — honest KPI display (PRD-2 brand consistency principle). The "Ver Todas" button was dead (no route). Cleaner, truthful, lighter.
QA
🤖 Generated with Claude Code
Summary by cubic
Polished the Aluno dashboard by removing fake stats and dead UI, fixing the monthly workouts label/spacing, and making the next‑workout card render its exercise list. The seed now creates Supabase Auth users, upserts E2E users with stable IDs, and logs missing envs;
.env*is ignored for safety.Bug Fixes
workoutsThisMonthi18n interpolation and label.Exercicios→exerciciossoCardTreinoshows exercises.Button; dropped extrapb-20..gitignore: ignore.env*andtmp-output.json.New Features
SEED_DEFAULT_PASSWORD(seed users) andE2E_DEFAULT_PASSWORD(E2E), with clear logs whenNEXT_PUBLIC_SUPABASE_URL/SUPABASE_SERVICE_ROLE_KEY/SEED_DEFAULT_PASSWORDare missing;.env.exampledocuments the new var.HistoricoTreinoto delete order and wraps execution in an async IIFE for idempotent runs; upserts E2E users in Prisma with fixed IDs.Written for commit 56dcac5. Summary will update on new commits.
Summary by CodeRabbit
.env.example.