conductor(checkpoint): Checkpoint end of Phase 1 - History Core Logic
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add src to path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
|
||||
|
||||
from src.history import HistoryManager
|
||||
|
||||
def verify_phase_1():
|
||||
print("Verifying Phase 1: History Core Logic...")
|
||||
hm = HistoryManager(max_capacity=10)
|
||||
|
||||
# Test push
|
||||
hm.push({"test": 1}, "initial")
|
||||
if not hm.can_undo:
|
||||
print("Error: can_undo should be true after push")
|
||||
sys.exit(1)
|
||||
|
||||
# Test undo
|
||||
entry = hm.undo({"test": 2}, "current")
|
||||
if entry.state != {"test": 1}:
|
||||
print(f"Error: expected state {{'test': 1}}, got {entry.state}")
|
||||
sys.exit(1)
|
||||
if entry.description != "initial":
|
||||
print(f"Error: expected description 'initial', got {entry.description}")
|
||||
sys.exit(1)
|
||||
|
||||
# Test redo
|
||||
entry = hm.redo({"test": 1}, "back")
|
||||
if entry.state != {"test": 2}:
|
||||
print(f"Error: expected state {{'test': 2}}, got {entry.state}")
|
||||
sys.exit(1)
|
||||
if entry.description != "current":
|
||||
print(f"Error: expected description 'current', got {entry.description}")
|
||||
sys.exit(1)
|
||||
|
||||
print("Phase 1 verification PASSED.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
verify_phase_1()
|
||||
+1
-1
@@ -87,7 +87,7 @@ This file tracks all major tracks for the project. Each track has its own detail
|
||||
*Link: [./tracks/discussion_hub_panel_reorganization_20260322/](./tracks/discussion_hub_panel_reorganization_20260322/)*
|
||||
*Goal: Properly merge Session Hub into Discussion Hub (4 tabs: Discussion | Context Composition | Snapshot | Takes), establish Files & Media as project-level inventory, deprecate ui_summary_only, implement Context Composition and DAW-style Takes.*
|
||||
|
||||
10. [ ] **Track: Undo/Redo History Support**
|
||||
10. [~] **Track: Undo/Redo History Support**
|
||||
*Link: [./tracks/undo_redo_history_20260311/](./tracks/undo_redo_history_20260311/)*
|
||||
*Goal: Robust, non-provider based undo/redo for text inputs, UI controls, discussion mutations, and context management. Includes hotkey support and a history list view.*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user