What's New: Autosave Feedback & Data-Loss Protection in the Check-Out Report Builder
What's New: Autosave Feedback & Data-Loss Protection in the Check-Out Report Builder
Version: v0.1.103
Affects: Check-Out Report Builder (/dashboard/check-out/[reportId]/report-builder)
Overview
The Check-Out Report Builder now provides clear, real-time feedback on every save operation and actively prevents you from accidentally losing unsaved changes. These improvements apply to all item edits — condition notes, descriptions, and cost fields — across every check-out report.
New Features
1. Saving… / ✓ Saved Indicator in the Header Toolbar
A persistent status indicator now lives in the sticky header toolbar at the top of the report builder.
| State | Display |
|---|---|
| Mutation in-flight | Saving… |
| Mutation resolved successfully | ✓ Saved |
| Mutation failed | Toast notification (see below) |
This means you no longer have to guess whether your last edit was written to the database. The indicator updates automatically each time you blur a textarea and the autosave mutation fires.
2. Per-Item Save Ring
In addition to the toolbar indicator, the item you are currently editing displays a subtle animated ring while its save is pending. This provides inline, at-a-glance confirmation without requiring you to shift focus to the toolbar.
The ring clears automatically once the mutation completes.
3. Dirty State Navigation Warning
If you attempt to leave the report builder — by closing the tab, refreshing the page, or navigating elsewhere — while:
- the report is in draft state, and
- there are unsaved textarea changes
…the browser will display a standard leave-page warning dialog.
This safeguard prevents accidental loss of condition notes or cost assessments that form the evidence base for deposit deductions.
Note: The warning only appears when there are genuinely unsaved changes. Navigating away after a successful save will not trigger the dialog.
4. Error Toast with Retry Action
If a save mutation fails — for example, because of a dropped network connection — a toast notification appears immediately. The toast includes a Retry button so you can re-attempt the save without re-typing your entry.
Common scenarios where this protects you:
- Temporarily offline while filling in a long report on-site
- Session timeout mid-edit
- Transient server errors
Why These Changes Matter
The Check-Out Report Builder is the primary evidence-gathering tool for deposit deductions. Under the Renters' Rights Act, the accuracy and completeness of this data directly affects the legal defensibility of any deduction claim. Silent autosave failures — previously invisible to users — carried a real risk of data loss at the worst possible moment.
These changes ensure that every save is visible, every failure is recoverable, and accidental navigation is blocked before data is lost.
Affected File
src/app/dashboard/check-out/[reportId]/report-builder.tsx