Skip to content

feat(commitments): multi-instalment stepper + edit form#240

Merged
thierryvm merged 2 commits into
mainfrom
feat/commitments-edit-stepper
Jul 24, 2026
Merged

feat(commitments): multi-instalment stepper + edit form#240
thierryvm merged 2 commits into
mainfrom
feat/commitments-edit-stepper

Conversation

@thierryvm

Copy link
Copy Markdown
Owner

Motivation (@Thierry)

Sur /app/commitments, un échéancier (ex. 11 × 220 €) ne pouvait valider que le mois courant (bouton ✓ gated dueThisPeriod) et aucune édition n'était possible. On doit pouvoir valider les 11 versements + corriger un engagement.

Ce que fait la PR

  • Compteur −/+ « X / N payées » (InstallmentStepper, extrait) : + coche la plus ancienne échéance non payée, décoche la plus récente payée — réutilise l'action toggle mono-période existante. Boutons désactivés aux bornes et pendant une mutation → un double-clic ne peut pas annuler un paiement (reducer useOptimistic passé en intent explicite {key, paid}, idempotent sur lecture périmée ; contrat rollback feat(commitments): Engagements page — CRUD, remaining balance, progress, ticks (épic PR-2) #234 préservé).
  • Édition via le crayon : réutilise le formulaire (source unique formMode + resetForm), branché sur l'updateCommitmentAction déjà existant. Garde : impossible de réduire installmentsTotal sous le nombre déjà coché (pas d'orphelin ledger silencieux).
  • Layout ligne : contrôles (stepper + crayon + poubelle) déplacés des coins absolute cramés vers une rangée flex en flux, mobile-first, cibles 44px (size-11 md:size-9).
  • i18n : +10 clés × 5 locales (traductions réelles), −2 obsolètes.

Process

plan-reviewer : ✅ APPROVED (6 renforcements intégrés : race double-clic, garde reduction, migration des 6 tests toggle, discipline reset form bi-mode, DoD, hygiène branche). Backend (update/toggle actions) non modifié — réutilisé.

Evidence

  • typecheck ✅ · lint 0 erreur · 1616 tests (+6 stepper, +4 net commitments, 6 tests toggle réécrits sur le stepper dont le contrat rollback)
  • QA : dashboard-ux-auditor + i18n-auditor lancés.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ankora Ready Ready Preview, Comment Jul 24, 2026 2:16pm

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @thierryvm, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added status:review-needed Ready for review type:feat New user-facing feature labels Jul 22, 2026
thierryvm added a commit that referenced this pull request Jul 24, 2026
…ypass, SSRF, DoS) (#241)

## Motivation

Le check CI `Security audit` (`npm audit --audit-level=high`) est passé
rouge sur toutes les PR — **9 advisories HIGH Next.js** publiées,
affectant la plage `16.0.0 – 16.2.10` (on est en 16.2.6) :

- **GHSA-6gpp-xcg3-4w24** — contournement middleware/proxy (App Router +
Turbopack) → **touche directement notre auth `proxy.ts`**
- SSRF dans les Server Actions (custom servers + rewrites)
- DoS Server Actions + DoS Image Optimization via SVG
- Cache confusion (bodies de requête)
- Divulgation non authentifiée d'endpoints Server Function

**Dérive environnementale** — aucun changement de code de notre côté ;
`main` est également affecté.

## Fix

Bump **next 16.2.6 → 16.2.11** (patch — 16.2.11 est hors plage
vulnérable). Aucun changement de code applicatif.

## Evidence

- `npm audit --audit-level=high` → **0 high** (reste 1 low esbuild, sous
le seuil)
- `npm run typecheck` ✅ · `npm run build` ✅ (next 16.2.11 compile) ·
**1606 tests** verts
- Patch de version dans le même minor (16.2.x) → risque de régression
minimal, vérifié empiriquement

## Débloque

Merge en amont → #240 (stepper engagements) et toutes les futures PR
retrouvent un `Security audit` vert.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Summary by Sourcery

Build:
- Mettre à jour la dépendance Next de la version 16.2.6 à 16.2.11 afin
d’intégrer les correctifs de sécurité en amont sans modifier le code de
l’application.

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Build:
- Bump next dependency from 16.2.6 to 16.2.11 to incorporate upstream
security fixes without changing application code.

</details>
@Thierry: an échéancier (e.g. 11 × 220 €) could only tick the CURRENT month and
had no way to edit. Now:
- InstallmentStepper « X / N payées » with − / + : + marks the earliest unpaid
  scheduled instalment, − un-marks the latest paid one, reusing the existing
  single-period toggle action. Buttons disabled at bounds + while pending, so a
  double-click can't cancel a payment. useOptimistic reducer switched to explicit
  {key, paid} intent (idempotent under stale reads) — keeps the #234 rollback.
- Edit via the pencil: reuses the form (single formMode source + resetForm),
  wired to the existing updateCommitmentAction. Guard blocks reducing
  installmentsTotal below what's already ticked (no silent ledger orphaning).
- Row controls moved from cramped absolute corners into a flow flex row.
- i18n: +10 keys × 5 locales, −2 dead. plan-reviewer APPROVED. 1616 tests.
@thierryvm
thierryvm force-pushed the feat/commitments-edit-stepper branch from a19624b to 5d2b851 Compare July 24, 2026 14:14
@thierryvm
thierryvm merged commit 107fba8 into main Jul 24, 2026
9 checks passed
@thierryvm
thierryvm deleted the feat/commitments-edit-stepper branch July 24, 2026 14:24
thierryvm added a commit that referenced this pull request Jul 24, 2026
## Motivation

Follow-up du `dashboard-ux-auditor` sur #240 (**P1**). Cliquer le crayon
d'un engagement en bas d'une longue liste ouvrait le formulaire
d'édition **tout en haut de la page** — hors écran, sans aucun
changement visible pour un utilisateur sighted, et sans repère pour
clavier/lecteur d'écran (pattern ARIA APG Disclosure : déplacer le focus
vers le contenu révélé).

## Fix

`useEffect` sur `formMode`/`editingId` : focus du champ libellé
(`preventScroll`) + `scrollIntoView` smooth du formulaire. Bonus P3 :
opacity disabled du stepper 40 → 50 (cohérence token).

## Evidence

- `typecheck` ✅ · 27 tests commitments (dont un nouveau : le crayon
déplace le focus dans le form)
- `scrollIntoView` gardé (`?.`) pour jsdom.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:review-needed Ready for review type:feat New user-facing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant