# ✅ Vérification humaine — `dev-verif-6` (Performance)

**Branche :** `dev-verif-6` (empilée sur `dev-verif-5`)
**Lot :** Performance — quick-wins sûrs (CLS, prefetch, view transitions)
**Date :** 2026-06-01

## Items d'audit traités

| Item (spec) | Avant | Après | État |
|---|---|---|---|
| performance / **scrollbar-gutter** | ❌ absent | ✅ `html { scrollbar-gutter: stable }` | **fixé** |
| performance / **view-transitions** | ❌ absent | ✅ `@view-transition { navigation: auto }` | **fixé** |
| performance / **no-vary-search** | ❌ absent | ✅ header sur params de tracking | **fixé** |

## Changements (fichiers)

- `app/globals.css` — `html { scrollbar-gutter: stable }` (anti-saut horizontal) + `@view-transition { navigation: auto }` (transitions natives, progressive enhancement, respecte le `prefers-reduced-motion` ajouté en dev-verif-5).
- `next.config.ts` — header `No-Vary-Search` : `utm_*`, `gclid`, `fbclid`, `msclkid`, `ref` → le cache/prefetch réutilise l'entrée canonique.

## Preuves (build prod local :3001)

```
No-Vary-Search: params=("utm_source" … "ref")   ✓
CSS bundle : scrollbar-gutter + @view-transition  ✓
pnpm build : exit 0
```

## 🔴 Non couvert — gros chantiers perf (mesure navigateur requise)

L'item **core-web-vitals (required, FAIL)** et les optimisations lourdes ne sont **pas** dans ce lot : ils touchent des composants et demandent une **mesure Lighthouse/CrUX réelle**, pas un build headless. À planifier (cf. rapport d'audit) :

- [ ] **LCP > 2.5s** (home 5.3s, guide 3.7s, outil 3.5s) : vidéo hero `<video>` sans `poster`/preload (home) ; `<img>` guide sans `priority`/`fetchpriority=high` ; preload de l'élément LCP.
- [ ] **CLS 0.242 sur `/outils/comparateur-electricite-pro/`** : `<CalculatorWizard>` sous `Suspense` avec fallback non dimensionné (`page.tsx:152`) → réserver la hauteur.
- [ ] **critical-CSS** : ~450ms de CSS render-blocking (feuille principale ~135KB) → inline du critical / découpage.
- [ ] **image-optimisation** / **lazy-loading** : auditer l'usage `next/image` (dimensions explicites, `priority` sur LCP uniquement).
- [ ] **font-loading** : self-host la police (`next/font/local`) — supprime aussi la dépendance réseau Google Fonts au build (rencontrée pendant cet audit).
- [ ] **cache-control** : durcir les assets fingerprintés (`immutable, max-age=31536000`).

## Décision

- [ ] **Lot validé** (quick-wins sans risque) → mergeable.
- [ ] Chantier CWV planifié séparément.
- [ ] Corrections demandées :

> _Notes du vérificateur :_
