# XAMXAM TODO ## Duplicate TFE submission prevention (fixes) - [x] `DuplicateThesisException` — typed exception carrying existing thesis metadata - [x] `Database::findDuplicateThesis()` — year + author + normalised-title matching (exact, prefix, Levenshtein ≤10%) - [x] `ThesisCreateController::submit()` — calls duplicate check before any DB write, throws `DuplicateThesisException` - [x] `AppLogger::logDuplicate()` — dedicated log action (`status: duplicate`) for audit trail - [x] `App::flash/consumeFlash` — extended to support `warning` type alongside `error`/`success` - [x] `admin/actions/formulaire.php` — catches `DuplicateThesisException` separately; logs it; flashes HTML warning with link to existing thesis; repopulates form - [x] `partage/index.php` — same catch block; plain-text warning (no admin link) surfaced on the student form via `flash-warning` banner; form repopulated - [x] `toast.php` — renders `toast--warning` block - [x] `admin.css` — `.toast--warning` style + link colour - [x] `form.css` — `.flash-warning` style (partage form) ## Duplicate warning display fixes - [x] `toast-fragment.php` — 204 guard now also checks `warning`; warning was silently discarded before - [x] `partage/index.php` — warning stored as plain text (no pre-escaping); `htmlspecialchars()` applied once at render; was double-encoded before - [x] `partage/index.php` — `flash-warning` div gets `id` + `tabindex=-1`; inline JS scrolls and focuses it on load - [x] `admin/footer.php` — `htmx:afterSettle` listener focuses `.toast--warning` after HTMX injects the toast fragment