M1.15: one modal at a time, restore dialog follows outside restores

- Modal rule (ui/src/commands/modals.ts): palette, settings dialog and the
  close question are exclusive; opening one closes the other. Running any
  command but palette.open (keyboard, palette, uiCommand) closes the
  palette. The restore dialog is queued: hidden while another modal is
  open, back with its list intact afterwards.
- recovery.restore / recovery.discard emit recoveryResolved {paths}; the
  restore dialog drops the settled paths and closes when none are left.
  Rust was needed: discard gave the UI no signal, and a restored entry
  stays in the journal as the buffer's own entry.
- Dimmed restored text (C2 screenshot 09) was the dialog overlay, not an
  editor style; no editor change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-16 21:49:38 +02:00
parent d12a517009
commit 1a38e68480
13 changed files with 442 additions and 12 deletions

View file

@ -137,6 +137,13 @@ pub enum Event {
/// The params the command was run with, as given.
params: Value,
},
/// `recovery.restore` or `recovery.discard` settled journal entries:
/// they were restored into buffers or discarded, so a restore dialog
/// that still lists them drops them (M1.15).
RecoveryResolved {
/// Project-relative paths with `/`, sorted.
paths: Vec<String>,
},
}
/// Severity of an [`Event::Notification`].
@ -228,4 +235,15 @@ mod tests {
json!({"kind": "uiCommand", "id": "palette.open", "params": {}})
);
}
#[test]
fn recovery_resolved_shape() {
let e = Event::RecoveryResolved {
paths: vec!["src/a.php".into()],
};
assert_eq!(
serde_json::to_value(e).unwrap(),
json!({"kind": "recoveryResolved", "paths": ["src/a.php"]})
);
}
}