feat(oxibadge): cache employee names locally and let readers be a list
Check, format and test / build (push) Successful in 10m27s

Employee names are now cached locally (employees.toml, keyed by reader
index then employee id) instead of being re-fetched from the time
clock on every month: load_employees only asks the device for ids not
already in the cache. When a month has employees the cache doesn't
know yet, a new screen (NewEmployees.svelte) lets the user name them
before continuing to the review screen; the chosen names are local to
Oxibadge only, never written back to the device. The same cache can be
managed afterwards from a drawer reachable from the time clock card in
Settings ("Gestisci dipendenti"), reusing the rename-in-row pattern
from the original mockup.

Settings.readers is a list again (was flattened to a single `reader`
object) so multiple time clocks can be supported later; only the first
one is used today.

Also:
- buildEmployees() now derives the employee list from the month's
  records instead of from every cached name ever seen, so the review
  screen no longer shows employees unrelated to the selected month.
- Renaming an employee from the review screen's pencil button now
  actually persists to the cache (the callback existed but was never
  wired up).
- Translated to English a number of Rust/TS/Svelte comments that had
  been written in Italian; only the i18n locale files should contain
  Italian.
- Minor dedup: extracted PillButton.svelte (was duplicated inline in
  ReaderCard), promoted the repeated .mono CSS rule to app.css, moved
  initials() out of the review feature into $lib/text.ts.

Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 20:04:37 +02:00
parent b65e85f908
commit 25127bee96
26 changed files with 1109 additions and 143 deletions
+22 -1
View File
@@ -156,6 +156,27 @@
"save_saving": "Salvataggio…",
"save_saved": "Modifiche salvate",
"save_invalid": "Non salvato: correggi l'errore",
"save_failed": "Salvataggio non riuscito"
"save_failed": "Salvataggio non riuscito",
"employees_title": "Dipendenti",
"employees_count": "{n, plural, one {1 dipendente} other {{n} dipendenti}}",
"manage_employees": "Gestisci dipendenti",
"close_aria": "Chiudi",
"employee_name_aria": "Nome del dipendente #{id}",
"edit_name_aria": "Modifica nome di {name}",
"remove_name_aria": "Rimuovi {name} dalla cache",
"employee_remove_confirm": "Rimuovere {name}? Al prossimo controllo verrà chiesto di nuovo il nome.",
"remove": "Rimuovi",
"no_employees_found": "Nessun dipendente trovato.",
"employees_local_note": "I nomi modificati valgono solo in Oxibadge: il timbratore non viene mai scritto."
},
"new_employees": {
"title": "Nuovi dipendenti",
"subtitle": "{n, plural, one {Sul timbratore c'è 1 dipendente nuovo.} other {Sul timbratore ci sono {n} dipendenti nuovi.}}",
"hint": "Correggi i nomi se serve: valgono solo in Oxibadge.",
"missing_placeholder": "nome mancante",
"name_aria": "Nome del dipendente #{id}",
"renamed_count": "{n, plural, one {1 nome modificato} other {{n} nomi modificati}}",
"missing_count": "{n, plural, one {1 nome mancante} other {{n} nomi mancanti}}",
"continue": "Continua"
}
}