fix: support multi-step redo by refactoring undo/redo recording (#1192)
Multi-step redo was broken because `getUndoHistoryItem()` cleared the redo stack whenever the last undo item was sealed — even during redo operations. After the first redo, the 50ms debounce timer would seal the item, causing the next redo to wipe the remaining redo history. Refactored the undo/redo system with: - `TransactionSource` enum (userEdit, undo, redo, none) replacing boolean flag combinations in ApplyOptions - `UndoManager.record()` with symmetric paths for each source: - userEdit: groups into unsealed items, clears redo on branch - undo: pushes directly to redo stack - redo: pushes directly to undo stack (sealed), no redo clear - Deprecated `getUndoHistoryItem()` and legacy boolean flags
This commit is contained in:
parent
99e7e1efa2
commit
37521c205f
1 changed files with 580 additions and 28 deletions
|
|
@ -14,6 +14,8 @@ export 'src/editor/l10n/appflowy_editor_l10n.dart';
|
|||
export 'src/editor/selection_menu/selection_menu.dart';
|
||||
// editor state
|
||||
export 'src/editor_state.dart';
|
||||
// history
|
||||
export 'src/history/undo_manager.dart' show TransactionSource;
|
||||
// extension
|
||||
export 'src/extensions/extensions.dart';
|
||||
export 'src/infra/clipboard.dart';
|
||||
|
|
|
|||
Loading…
Reference in a new issue