Commit fac628b
feat(ux): inline editor + visual grouper + scroll fixes for meus treinos (#175)
* docs: meus treinos UX improvements design spec
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: detailed implementation plan for meus treinos UX improvements
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(workout-editor): add compact prop to drop outer Card wrapper
- Add compact?: boolean prop (default false) to WorkoutEditor
- Extract JSX into const content, conditionally wrap in div vs Card
- Add 2 tests: compact omits Card, default renders Card
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(ux): expose planName from useWorkoutGeneration for visual grouper banner
* feat(ux): inline editor inside treino cards, remove bottom editor
- editingTreinoId state drives inline WorkoutEditor per card
- handleEditLocal replaces scrollTo behavior
- Criar Manual button moved above list, opens inline editor
- Removed bottom-of-page conditional editor
- Removed window.scrollTo from use-workout-crud
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(test): update use-workout-crud tests for inline editor changes
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(ux): visual grouper banner + after-gen scroll anchor
Co-Authored-By: Claude <noreply@anthropic.com>
* test(ux): update meus-treinos-client tests for planName banner
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ux): reset planName before each generation
Ensures banner re-triggers on every AI gen, not just first time.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ux): add plan description to banner card
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ux): retry scroll with requestAnimationFrame until DOM ready
Replaces fixed 300ms setTimeout with rAF loop that retries
until #treinos-pessoais anchor exists in DOM. Eliminates
race condition on slow devices / slow RSC renders.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(auth): resolve Prisma alunoId vs Auth UUID in delete+update authorization
deleteTreinoAction and updateTreinoDayAction compared treino.alunoId
(Prisma ID) against user.id (Auth UUID), always mismatching after
PR #174 FK fix. Resolve aluno.id by email before auth check.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(review): address PR #175 review findings — all severity levels
- rAF scroll capped at 20 attempts (prevents infinite loop)
- handleDelete + handleDayChange: surface server errors to user
- replace inline prisma.aluno.findUnique with resolveAlunoId() for auth
- add onSuccess to useCallback dep array
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(type): make onSuccess optional in useWorkoutGeneration
Pre-existing tests don't pass onSuccess — made optional to avoid
12 TS2345 errors. Caller (meus-treinos-client) always passes it.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ux): keep editor open on save failure + dead code cleanup
handleSave returns boolean. Client closes editor only on success.
Removed unused isFormVisible, editingTreino, handleEdit from hook.
Kept __new__ sentinel for now.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Emiya Kiritsugu <emiyakiritsugu3@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1118d92 commit fac628b
10 files changed
Lines changed: 786 additions & 161 deletions
File tree
- docs/superpowers
- plans
- specs
- src
- app/aluno/meus-treinos
- components/dashboard/aluno
- hooks
- lib/actions
Lines changed: 431 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
197 | 210 | | |
0 commit comments