fix(vue-fiches): passe /autofeedback — Échap dans un champ garde le brouillon, titre d'onglet = fiche ouverte, contrastes et mini-carte décorative de FicheDetail

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
This commit is contained in:
Jules Neny
2026-10-03 09:20:16 +02:00
co-authored by Claude Opus 5.5
parent a6dcf48c71
commit a9befb25ab
4 changed files with 28 additions and 18 deletions
+10 -3
View File
@@ -459,11 +459,18 @@ watch(() => props.vf.ficheId, (id, avant) => {
})
function clavierDetail(e: KeyboardEvent) {
if (e.key === 'Escape') { e.preventDefault(); props.vf.fermerFiche(); return }
const t = e.target as HTMLElement
const champ = !!t.closest('input, textarea, select, [contenteditable="true"]')
if (e.key === 'Escape') {
e.preventDefault()
// Échap dans un champ (commentaire, signalement) le quitte d'abord : un brouillon ne se perd pas d'une touche
if (champ) { detail.value?.focus({ preventScroll: true }); return }
props.vf.fermerFiche()
return
}
if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return
const t = e.target as HTMLElement
if (t.closest('input, textarea, select, [contenteditable="true"]')) return
if (champ) return
e.preventDefault()
if (e.key === 'ArrowLeft') props.vf.fichePrecedente()
else props.vf.ficheSuivante()