fix(app): rescue copy importable, trapping draft held, replace confirmed

The JSON rescue copy could not be restored in the app, a draft that traps
the engine left the tab on a reload screen and spent a recovery on every
read, and an unsaved or in-progress report could be lost by a reload
outside the editor or by New report / Import without warning.

Home import reads the copy (content-sniffed, 16 MiB cap, strict UTF-8)
through the core's draft.restore before any session change; a trapping
(draft, archive) pair is held in the resolution panel and only re-read
on Retry; ReplaceSessionDialog guards New report and Import; the
beforeunload guard is app-wide while unsaved. Supersedes BDR-055's
"never held" for `internal` only.
This commit is contained in:
bchanot committed 2026-10-17 12:58:57 +02:00
1 parent 9464651140
commit 9bd9acaf58
22 files changed
+1090 -68

No files matched your search

+19 -2
View File
@@ -19,15 +19,17 @@ export const en: Dict = {
'home.new_report.description':
'Start a new osteopathic report for an animal.',
'home.new_report.cta': 'Start',
'home.import.title': 'Import a PDF',
'home.import.title': 'Import a PDF or a rescue copy',
'home.import.description':
'Reopen a previous report generated by this app to follow up.',
'home.import.cta': 'Choose a PDF',
'home.import.cta': 'Choose a file',
'home.import.loading': 'Reading…',
'home.import.error_core_unavailable':
'The reading engine could not be loaded. Try the import again.',
'home.import.error_generic': 'Failed to read the PDF.',
'home.import.error_invalid_pdf': 'This file is not a readable PDF.',
'home.import.error_invalid_copy':
'This file is not a Faunosteo rescue copy this version can read. Import refused; the file was not changed.',
'home.import.error_no_attachment':
'This PDF was not generated by Faunosteo (no data detected).',
'home.import.error_incompatible_version':
@@ -122,6 +124,21 @@ export const en: Dict = {
"Open",
'session.held_blocked':
"A draft in this tab must be recovered or deleted first: it could not be set aside and would be overwritten. The editor will open to resolve it.",
'session.held.notice_engine':
"Faunosteo's computation engine cannot open a draft of this tab. It is kept as is; nothing was deleted. Download a copy, try again, or delete it to start a new report.",
'session.held.draft_engine_failure':
"Draft the computation engine cannot open ({size})",
'session.held_blocked_engine':
"A draft of this tab makes the computation engine fail: recover or delete it first. The editor will open to resolve it.",
'session.replace.title': 'Replace the report in progress?',
'session.replace.body':
"The report of {animal} will be replaced in this tab. Export it as a PDF to keep it.",
'session.replace.body_unloaded':
"The report in progress in this tab will be replaced. Open it and export it as a PDF to keep it.",
'session.replace.unsaved':
"Its latest changes are not saved in this tab.",
'session.replace.open': 'Open the report in progress',
'session.replace.confirm': 'Replace',
'editor.edit_infos': 'Edit info',
'editor.edit_dialog_title': 'Edit information',
'editor.disclaimer_title': 'Legal scope of animal osteopathy',
+19 -2
View File
@@ -21,15 +21,17 @@ export const fr: Dict = {
'home.new_report.description':
"Démarrer un nouveau bilan d'ostéopathie sur un animal.",
'home.new_report.cta': 'Commencer',
'home.import.title': 'Importer un PDF',
'home.import.title': 'Importer un PDF ou une copie de secours',
'home.import.description':
'Reprendre un bilan précédent généré par cette application pour effectuer un suivi.',
'home.import.cta': 'Choisir un PDF',
'home.import.cta': 'Choisir un fichier',
'home.import.loading': 'Lecture…',
'home.import.error_core_unavailable':
"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.",
'home.import.error_generic': 'Erreur de lecture du PDF.',
'home.import.error_invalid_pdf': "Ce fichier n'est pas un PDF lisible.",
'home.import.error_invalid_copy':
"Ce fichier n'est pas une copie de secours Faunosteo lisible par cette version. Import refusé ; le fichier n'a pas été modifié.",
'home.import.error_no_attachment':
"Ce PDF n'a pas été généré par Faunosteo (pas de données détectées).",
'home.import.error_incompatible_version':
@@ -128,6 +130,21 @@ export const fr: Dict = {
"Ouvrir",
'session.held_blocked':
"Un brouillon de cet onglet doit d'abord être récupéré ou supprimé : il n'a pas pu être mis de côté et serait écrasé. L'éditeur va s'ouvrir pour le résoudre.",
'session.held.notice_engine':
"Le moteur de calcul n'arrive pas à ouvrir un brouillon de cet onglet. Il est conservé tel quel ; rien n'a été supprimé. Téléchargez-en une copie, réessayez, ou supprimez-le pour commencer un nouveau bilan.",
'session.held.draft_engine_failure':
"Brouillon que le moteur de calcul n'arrive pas à ouvrir ({size})",
'session.held_blocked_engine':
"Un brouillon de cet onglet fait échouer le moteur de calcul : il doit d'abord être récupéré ou supprimé. L'éditeur va s'ouvrir pour le résoudre.",
'session.replace.title': 'Remplacer le bilan en cours ?',
'session.replace.body':
"Le bilan de {animal} sera remplacé dans cet onglet. Exportez-le en PDF pour le garder.",
'session.replace.body_unloaded':
"Le bilan en cours dans cet onglet sera remplacé. Ouvrez-le et exportez-le en PDF pour le garder.",
'session.replace.unsaved':
"Ses dernières modifications ne sont pas enregistrées dans l'onglet.",
'session.replace.open': 'Ouvrir le bilan en cours',
'session.replace.confirm': 'Remplacer',
'editor.edit_infos': 'Modifier les infos',
'editor.edit_dialog_title': 'Modifier les informations',
'editor.disclaimer_title': "Périmètre légal de l'ostéopathie animale",