M3.10: autosave and flushDirty

Autosave saves dirty buffers when the window loses focus (DOM blur and
visibilitychange), when the active tab changes and after
editor.autosave.idleSeconds (default 15) without an edit; three settings,
all on by default. flushDirty() in ui/src/stores/autosave.ts is the one
save-all-dirty-and-wait entry point for later deployment, run and
terminal features: it waits for pending buffer sync, then runs
file.saveAll {skipConflicts: true}; one toast per failed file.

Engine: file.saveAll takes skipConflicts and returns skipped; Buffers
tracks buffers in conflict with their file and the hash of the last
read/written content, so our own save reported late is not a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-20 20:59:44 +02:00
parent 228669036c
commit e1dc24dc25
18 changed files with 996 additions and 37 deletions

View file

@ -49,7 +49,10 @@ fn list_describes_the_c2_keys_with_catalog_keys_only() {
"ui.language",
"php.executable",
"phpactor.path",
"phpactor.autoDownload"
"phpactor.autoDownload",
"editor.autosave.onBlur",
"editor.autosave.onTabSwitch",
"editor.autosave.idleSeconds"
]
);
for s in list.as_array().unwrap() {
@ -112,7 +115,10 @@ fn get_set_reset_and_events() {
"ui.language": "en",
"php.executable": "",
"phpactor.path": "",
"phpactor.autoDownload": true
"phpactor.autoDownload": true,
"editor.autosave.onBlur": true,
"editor.autosave.onTabSwitch": true,
"editor.autosave.idleSeconds": 15
})
);
let out = e