From 99617f117c957c0a48195729e8811fd18b1a496d Mon Sep 17 00:00:00 2001
From: Hermann_Kitio
Date: Thu, 23 Apr 2026 03:17:16 +0300
Subject: [PATCH] style: prettier format
Co-Authored-By: Claude Opus 4.7 (1M context)
---
src/app/AppLayout.tsx | 4 +--
src/app/BottomNav.tsx | 9 ++----
src/app/Sidebar.tsx | 22 ++++++-------
src/app/main.tsx | 4 +--
src/app/router.tsx | 24 +++++++-------
src/entities/patterns/types.ts | 16 +++++-----
src/entities/production/api.ts | 9 ++----
src/entities/report/lib.ts | 5 ++-
src/entities/report/types.ts | 12 +++----
src/features/auth/hooks/useAuth.ts | 6 +---
.../components/MonProfilPreparation.tsx | 8 ++---
.../dashboard/pages/DashboardPage.tsx | 17 ++++------
.../components/SimulationListItem.tsx | 4 +--
.../__tests__/SimulationsList.test.tsx | 2 +-
.../components/BlurredProgression.tsx | 4 +--
.../components/PatternExerciceCard.tsx | 20 +++---------
.../progression/components/PatternsList.tsx | 3 +-
.../components/ProgressionPremium.tsx | 8 ++---
.../__tests__/ProgressionPremium.test.tsx | 21 ++++++------
.../progression/pages/ProgressionPage.tsx | 7 ++--
.../components/IdeesSuggestions.tsx | 5 ++-
.../components/NclcCibleSelector.tsx | 4 +--
.../simulations/components/SimulationForm.tsx | 12 ++-----
.../components/SpecialCharsKeyboard.tsx | 32 +++++++++++++++++--
.../simulations/components/SujetDisplay.tsx | 8 ++---
.../simulations/components/TaskSelector.tsx | 18 +++++------
.../components/rapport/ConseilNclcCallout.tsx | 8 ++---
.../components/rapport/CritereCard.tsx | 8 ++---
.../components/rapport/DiagnosticCallout.tsx | 8 ++---
.../rapport/ExerciceInteractive.tsx | 10 ++----
.../rapport/ProductionModeleSection.tsx | 4 +--
.../components/rapport/RevelationCards.tsx | 6 ++--
.../components/rapport/ScoreHero.tsx | 24 ++++++--------
.../__tests__/ExerciceInteractive.test.tsx | 2 +-
.../hooks/__tests__/useAutosave.test.ts | 4 +--
.../hooks/__tests__/useSimulation.test.tsx | 23 +++++++------
.../simulations/lib/simulationConfig.ts | 4 ++-
.../simulations/pages/RapportPage.tsx | 27 ++++------------
.../simulations/pages/SimulationPage.tsx | 32 +++++++++----------
src/features/simulations/pages/SujetsPage.tsx | 20 +++++-------
.../state/SimulationFlowProvider.tsx | 4 +--
.../simulations/state/simulationFlow.ts | 13 ++------
src/shared/ui/Badge.tsx | 14 ++++----
src/shared/ui/Button.tsx | 22 ++++++-------
src/shared/ui/Card.tsx | 14 +++-----
45 files changed, 229 insertions(+), 302 deletions(-)
diff --git a/src/app/AppLayout.tsx b/src/app/AppLayout.tsx
index 65d53f9..4208568 100644
--- a/src/app/AppLayout.tsx
+++ b/src/app/AppLayout.tsx
@@ -71,9 +71,7 @@ export function AppLayout({ children }: AppLayoutProps) {
{/* ── Zone de contenu ────────────────────────────────────────── */}
{/* pb-16 sur mobile pour ne pas être masqué par le BottomNav fixe */}
-
- {children}
-
+ {children}
{/* ── MOBILE — BottomNav fixe ────────────────────────────────── */}
diff --git a/src/app/BottomNav.tsx b/src/app/BottomNav.tsx
index b5f14ae..d610811 100644
--- a/src/app/BottomNav.tsx
+++ b/src/app/BottomNav.tsx
@@ -16,8 +16,8 @@ import { cn } from '@/shared/lib/utils'
const SHEET_ITEMS = [
{ label: 'Expression Écrite', to: '/simulation/ee' },
- { label: 'Expression Orale', to: '/simulation/eo' },
- { label: 'Examen blanc', to: '/examen' },
+ { label: 'Expression Orale', to: '/simulation/eo' },
+ { label: 'Examen blanc', to: '/examen' },
] as const
export function BottomNav() {
@@ -102,10 +102,7 @@ export function BottomNav() {
)}
>
Simuler
diff --git a/src/app/Sidebar.tsx b/src/app/Sidebar.tsx
index beedf45..1014ad0 100644
--- a/src/app/Sidebar.tsx
+++ b/src/app/Sidebar.tsx
@@ -21,18 +21,18 @@ interface NavItem {
}
const PREPARE_ITEMS: readonly NavItem[] = [
- { label: 'Tableau de bord', to: '/dashboard', feature: null },
- { label: 'Expression Écrite', to: '/simulation/ee', feature: null },
- { label: 'Expression Orale', to: '/simulation/eo', feature: null },
- { label: 'Examen blanc', to: '/examen', feature: 'exam_mode' },
- { label: 'Progression', to: '/progression', feature: 'pattern_analysis' },
- { label: 'Méthodologie', to: '/methodologie', feature: null },
- { label: 'Historique', to: '/historique', feature: 'dashboard' },
+ { label: 'Tableau de bord', to: '/dashboard', feature: null },
+ { label: 'Expression Écrite', to: '/simulation/ee', feature: null },
+ { label: 'Expression Orale', to: '/simulation/eo', feature: null },
+ { label: 'Examen blanc', to: '/examen', feature: 'exam_mode' },
+ { label: 'Progression', to: '/progression', feature: 'pattern_analysis' },
+ { label: 'Méthodologie', to: '/methodologie', feature: null },
+ { label: 'Historique', to: '/historique', feature: 'dashboard' },
]
const ACCOUNT_ITEMS: readonly NavItem[] = [
- { label: 'Mon plan', to: '/plan', feature: null },
- { label: 'Paramètres', to: '/parametres', feature: null },
+ { label: 'Mon plan', to: '/plan', feature: null },
+ { label: 'Paramètres', to: '/parametres', feature: null },
]
function SidebarItem({ item, plan }: { item: NavItem; plan: Plan }) {
@@ -48,8 +48,8 @@ function SidebarItem({ item, plan }: { item: NavItem; plan: Plan }) {
isActive && !locked
? 'bg-expria-50 font-medium text-expria'
: locked
- ? 'cursor-default text-ink-4 opacity-50'
- : 'text-ink-3 hover:bg-canvas hover:text-ink-1',
+ ? 'cursor-default text-ink-4 opacity-50'
+ : 'text-ink-3 hover:bg-canvas hover:text-ink-1',
)
}
>
diff --git a/src/app/main.tsx b/src/app/main.tsx
index 2033578..31cd894 100644
--- a/src/app/main.tsx
+++ b/src/app/main.tsx
@@ -11,7 +11,5 @@ if (!container) {
}
createRoot(container).render(
-
- {isMaintenanceMode ? : }
- ,
+ {isMaintenanceMode ? : },
)
diff --git a/src/app/router.tsx b/src/app/router.tsx
index 4a0df8e..50e7233 100644
--- a/src/app/router.tsx
+++ b/src/app/router.tsx
@@ -48,34 +48,34 @@ export function AppRouter() {
return (
{/* ── Routes publiques ─────────────────────────────────────── */}
- } />
+ } />
} />
{/* ── Routes privées — ProtectedRoute + AppLayout ──────────── */}
}>
- } />
- } />
+ } />
+ } />
{/* Simulation — /simulation/ee, /sujets et /rapport/:id partagent le
SimulationFlowProvider. L'instance est préservée entre ces routes
par React Router tant que le layout parent reste monté, ce qui
permet à RapportPage.reset() d'agir sur le même state que
SimulationPage (bouton « Nouvelle simulation » + breadcrumb). */}
- } />
+ } />
}>
} />
- } />
- } />
+ } />
+ } />
} />
{/* Autres sections — Sprint 4+ */}
- } />
- } />
- } />
- } />
- } />
- } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
{/* ── Dev only ─────────────────────────────────────────────── */}
diff --git a/src/entities/patterns/types.ts b/src/entities/patterns/types.ts
index b150ea8..a9d5212 100644
--- a/src/entities/patterns/types.ts
+++ b/src/entities/patterns/types.ts
@@ -13,7 +13,7 @@ import type { CritereCode } from '@/entities/report/types'
export interface Pattern {
code: string
critere: CritereCode
- frequency: number // 3, 4 ou 5 (seuil d'agrégation : ≥ 3)
+ frequency: number // 3, 4 ou 5 (seuil d'agrégation : ≥ 3)
description: string | null // non-null uniquement pour code === 'autre'
}
@@ -23,14 +23,14 @@ export interface PatternExercice {
diagnostic: string
exercice: {
consigne: string
- exemple: string // phrase incorrecte générique (pas du candidat)
- correction: string // version correcte
- astuce: string // procédé mnémotechnique / réflexe de relecture
+ exemple: string // phrase incorrecte générique (pas du candidat)
+ correction: string // version correcte
+ astuce: string // procédé mnémotechnique / réflexe de relecture
}
}
export interface PreparationIndex {
- score: number // 0-100 entier
+ score: number // 0-100 entier
message: string // interprétation textuelle fixée par le backend
}
@@ -40,13 +40,13 @@ export interface PatternsReady {
exercises: PatternExercice[]
preparation_index: PreparationIndex
analyzed_productions: number
- last_analysis: string // ISO timestamp
+ last_analysis: string // ISO timestamp
}
export interface PatternsNotReady {
ready: false
- minimum: number // toujours 5 côté backend actuel
- current: number // nb de productions corrigées déjà réalisées
+ minimum: number // toujours 5 côté backend actuel
+ current: number // nb de productions corrigées déjà réalisées
}
export type PatternsResponse = PatternsReady | PatternsNotReady
diff --git a/src/entities/production/api.ts b/src/entities/production/api.ts
index 3f914d9..ceebca1 100644
--- a/src/entities/production/api.ts
+++ b/src/entities/production/api.ts
@@ -33,10 +33,7 @@ export function getSimulation(id: string): Promise {
* Endpoint : `GET /simulations?page=X&limit=Y`. Tri `created_at DESC` côté backend.
* Champs lourds exclus (contenu, rapport, exercices, modele) — cf. SimulationListItem.
*/
-export function listSimulations(
- page: number,
- limit: number,
-): Promise {
+export function listSimulations(page: number, limit: number): Promise {
const qs = new URLSearchParams({ page: String(page), limit: String(limit) })
return apiFetch(`/simulations?${qs.toString()}`)
}
@@ -83,9 +80,7 @@ export async function updateSujet(id: string, sujetId: string): Promise {
* Retourne `null` pour les tâches sans catalogue de sujets côté base
* (EO_T1 : sujet fixe connu, EO_T2_LIVE : interaction sans sujet).
*/
-function mapTacheToSujetParams(
- tache: Tache,
-): { mode: 'EE' | 'EO'; tacheNumber: 1 | 2 | 3 } | null {
+function mapTacheToSujetParams(tache: Tache): { mode: 'EE' | 'EO'; tacheNumber: 1 | 2 | 3 } | null {
switch (tache) {
case 'EE_T1':
return { mode: 'EE', tacheNumber: 1 }
diff --git a/src/entities/report/lib.ts b/src/entities/report/lib.ts
index e88a7e1..252a7a0 100644
--- a/src/entities/report/lib.ts
+++ b/src/entities/report/lib.ts
@@ -77,7 +77,10 @@ export function critereCodeFromNom(nom: string): CritereCode | null {
*/
const NCLC_MIN_SCORE: Record = { 7: 10, 8: 12, 9: 14, 10: 16 }
-export function ecartVsCible(score: number, nclcCible: number): {
+export function ecartVsCible(
+ score: number,
+ nclcCible: number,
+): {
points: number
atteint: boolean
} {
diff --git a/src/entities/report/types.ts b/src/entities/report/types.ts
index b0aaecc..89d01b7 100644
--- a/src/entities/report/types.ts
+++ b/src/entities/report/types.ts
@@ -28,7 +28,7 @@ export interface ErreurCode {
export interface Critere {
nom: string
- score: number // 0-5
+ score: number // 0-5
commentaire: string
exemple: string
suggestion: string
@@ -42,7 +42,7 @@ export interface Revelation {
}
export interface ConseilNclc {
- nclc_cible: string // ex. "NCLC 9"
+ nclc_cible: string // ex. "NCLC 9"
ecart: string
action_prioritaire: string
}
@@ -101,14 +101,14 @@ export type NclcCible = 9 | 10
*/
export interface Report {
simulation_id: string
- score: number // /20
- nclc: number // NCLC atteint — ex. 8
+ score: number // /20
+ nclc: number // NCLC atteint — ex. 8
nclc_cible: NclcCible
revelation: Revelation
diagnostic: string
criteres: Critere[]
conseil_nclc: ConseilNclc
- erreurs_codes: ErreurCode[] // top-level — regroupés par critère côté UI
+ erreurs_codes: ErreurCode[] // top-level — regroupés par critère côté UI
exercices: Exercice[] | null
exercices_status: JobStatus
modele: ProductionModele | null
@@ -120,7 +120,7 @@ export interface CorrectEePayload {
simulationId: string
contenu: string
tache: string
- nclc_cible?: NclcCible // défaut backend : 9
+ nclc_cible?: NclcCible // défaut backend : 9
}
/**
diff --git a/src/features/auth/hooks/useAuth.ts b/src/features/auth/hooks/useAuth.ts
index 5de5968..6c3e1df 100644
--- a/src/features/auth/hooks/useAuth.ts
+++ b/src/features/auth/hooks/useAuth.ts
@@ -10,11 +10,7 @@
*/
import { useEffect, useState } from 'react'
-import {
- getCurrentSession,
- subscribeToAuthChanges,
- type User,
-} from '@/shared/lib/auth-client'
+import { getCurrentSession, subscribeToAuthChanges, type User } from '@/shared/lib/auth-client'
interface UseAuthResult {
user: User | null
diff --git a/src/features/dashboard/components/MonProfilPreparation.tsx b/src/features/dashboard/components/MonProfilPreparation.tsx
index 6f0691a..221b213 100644
--- a/src/features/dashboard/components/MonProfilPreparation.tsx
+++ b/src/features/dashboard/components/MonProfilPreparation.tsx
@@ -62,8 +62,7 @@ export function MonProfilPreparation({ plan }: Props) {
Mon profil de préparation
- Encore{' '}
- {remaining}{' '}
+ Encore {remaining}{' '}
{remaining > 1 ? 'simulations' : 'simulation'} pour débloquer votre profil.
@@ -108,10 +107,7 @@ export function MonProfilPreparation({ plan }: Props) {