Skip to content

Autosave

Status: ✅ Implemented — @AutoSave

Eliminate the anxiety of losing work and the doubt of whether changes were persisted.

A user fills out a long form, the session times out or the tab is accidentally closed, and everything is lost. Or they are left unsure whether the last “Save” actually went through. Both are correctability failures.

Annotate the view class with @AutoSave. Mateu debounces field changes and automatically triggers the designated save action, keeping the backend in sync without any user gesture.

@UI("/orders/{id}/edit")
@AutoSave
public class EditOrder {
private String ref;
private LocalDate date;
private String notes;
public void save() {
orderService.update(id, ref, date, notes);
}
}

By default, @AutoSave targets the first eligible action on the class. You can specify the action explicitly:

@AutoSave(action = "save")
  1. Any field change triggers a debounce timer (default: ~800 ms).
  2. After the debounce window, the save action fires automatically.
  3. The action is local — it does not trigger navigation or page reload.
Use @AutoSaveUse explicit Save button
Long editing sessions where data loss is costlyWorkflows with a discrete “commit” concept
Drafts, notes, configurationMulti-step wizards
Any field-by-field editing workflowDestructive operations
  • Recoverability — work is never lost to an accidental close or timeout
  • Workflow over screens — saving becomes invisible infrastructure, not a user task
  • Minimize navigation — no “save and stay” vs “save and go” decision required