feat: ADR-0006 §8 steps 4-5 — undo/redo commands + confirm-modal flow

Commands & grammar (step 4):
- AppCommand::Undo/Redo, grammar nodes + REGISTRY entries, catalog
  help/usage + keys; parse tests
- replay skips undo/redo (is_app_lifecycle_entry_word) + completion
  entry-keyword lockstep; replay-skip test extended

Wiring (step 5):
- Action::{PrepareUndo,PrepareRedo,Undo,Redo} + AppEvent::{UndoPrepared,
  UndoUnavailable,UndoSucceeded,UndoFailed}
- App: undo_enabled flag, Modal::UndoConfirm, dispatch + event handling
  + confirm-key handler (Y confirms / N/Esc cancels); "turned off" when
  --no-undo; "nothing to undo/redo" when empty
- ui::render_undo_confirm names the command + snapshot time
- runtime: opens with undo enabled (!--no-undo), threads it through the
  project-switch path, spawn_prepare_undo/spawn_undo (peek->modal,
  restore->refresh tables + schema cache)
- 9 Tier-1 app tests + 3 parse tests

1692 passed / 0 failed / 1 ignored; clippy clean.
This commit is contained in:
claude@clouddev1
2026-05-24 20:48:30 +00:00
parent a97069c02e
commit 25800e3eb5
14 changed files with 541 additions and 9 deletions
+25
View File
@@ -253,6 +253,10 @@ help:
mode simple|advanced — switch input mode
messages: |-
messages [short|verbose] — show or switch error-message verbosity (verbose is the default)
undo: |-
undo — undo the last change (with confirmation)
redo: |-
redo — redo the last undone change (with confirmation)
ddl:
create: |-
create table <T> with pk [<col>(<type>), ...] — create a table
@@ -484,6 +488,8 @@ parse:
import: "import <zip-path> [as <target>]"
mode: "mode simple | mode advanced"
messages: "messages | messages short | messages verbose"
undo: "undo"
redo: "redo"
# ---- Pre-submit diagnostics (ADR-0027) -------------------------------
# Surfaced by the validity indicator and the hint panel before
@@ -665,6 +671,25 @@ modal:
load_picker_path_prompt: "Path to project directory:"
rebuild_confirm_title: "Rebuild project"
rebuild_confirm_prompt: "Continue?"
# Undo / redo confirmation (ADR-0006 Amendment 1).
undo_confirm_title: "Undo last change"
redo_confirm_title: "Redo last undone change"
undo_confirm_command: "This will undo:"
redo_confirm_command: "This will re-apply:"
undo_confirm_when: "snapshot taken {timestamp}"
undo_confirm_prompt: "Restore that earlier state?"
undo_cancelled: "undo cancelled"
redo_cancelled: "redo cancelled"
# ---- Undo / redo command surfaces (ADR-0006 Amendment 1) -------------
undo:
disabled: "undo is turned off for this session (started with --no-undo)"
nothing_to_undo: "nothing to undo"
nothing_to_redo: "nothing to redo"
undone_ok: "undone: {command}"
redone_ok: "re-applied: {command}"
undo_failed: "could not undo: {error}"
redo_failed: "could not redo: {error}"
# ---- Save / save-as command surfaces ---------------------------------
save: