Skip to main content
Dropdown com sessoes recentes. Troca otimista com rollback automatico em caso de erro. The session switcher dropdown lists the doctor’s recent sessions, fetched via background worker IPC. Each row shows patient name (or “Paciente HH:mm” fallback) and creation time. The switch is optimistic: storage is updated immediately for instant UI feedback. If the backend sync fails (timeout or error), the switch rolls back to the previous session and shows an error toast. Empty results (“no record yet”) are NOT treated as failures — a brand-new session legitimately has no data yet.