feat(oxibadge): warn before losing unexported review edits, add undo
Check, format and test / build (push) Successful in 10m25s

The review screen now tracks whether there are edits not yet exported
and asks for confirmation before discarding them: clicking back, or
closing the app window entirely (intercepted via onCloseRequested,
which needed a core:window:allow-destroy capability that wasn't
granted by core:default). The confirmation dialog (ConfirmDialog.svelte)
is generic, built on a shared ModalFrame extracted from ExportModal so
the two don't duplicate the backdrop/box styling.

Also adds undo: a per-row button (icon-only, left of the note, shown
when that day has edits) reverts just that day instantly, and a
per-employee "undo all" (icon in a red box, last among the header's
tools) reverts every day for the current employee after a confirmation
dialog, since that one can't be undone itself.

ActionButton moves out of review/ next to IconButton/PillButton, since
ConfirmDialog (outside the review feature) now uses it too.

Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 13:46:31 +02:00
parent 25127bee96
commit 0c320c39b0
13 changed files with 421 additions and 104 deletions
+11 -1
View File
@@ -114,7 +114,17 @@
"export_warning_unrounded": "Gli orari sono completi, ma alcuni non sono arrotondati a {step} minuti. Puoi arrotondarli automaticamente prima di esportare, oppure esportarli così come sono.",
"back_to_review": "Torna alla revisione",
"round_and_export": "Arrotonda ed esporta",
"export_anyway": "Esporta comunque"
"export_anyway": "Esporta comunque",
"leave_confirm_title": "Modifiche non esportate",
"leave_confirm_message": "Se esci ora, le modifiche fatte in questa revisione andranno perse.",
"leave_anyway": "Esci senza esportare",
"undo_day_aria": "Annulla le modifiche di {label}",
"undo_short": "Annulla",
"undo_all": "Annulla modifiche",
"undo_all_title": "Ripristina gli orari di questo dipendente a quelli letti dal timbratore",
"undo_all_confirm_title": "Annullare tutte le modifiche?",
"undo_all_confirm_message": "Tutti gli orari modificati per questo dipendente torneranno a quelli letti dal timbratore. L'operazione non si può annullare.",
"undo_all_confirm": "Annulla tutte le modifiche"
},
"settings": {
"title": "Impostazioni",