constellation-analyzer/docs
Jan-Henrik Bruhn 0ac15353ae refactor: remove legacy persistence code and migration system (Phase 1)
Removes ~350 lines of legacy code from single-document system.

Changes:
- Delete src/stores/persistence/loader.ts (legacy load functions)
- Delete src/stores/persistence/saver.ts (legacy save functions)
- Delete src/stores/workspace/migration.ts (no migration support needed)
- Create src/stores/workspace/documentUtils.ts (consolidated utilities)

Extracted and consolidated:
- validateDocument() - document structure validation
- getCurrentGraphFromDocument() - extract current graph from timeline
- deserializeGraphState() - convert storage to runtime format
- serializeActors/Relations/Groups() - convert runtime to storage format
- createDocument() - create new document with initial timeline state

Updated imports:
- workspaceStore.ts: use documentUtils instead of loader/saver
- useActiveDocument.ts: use documentUtils.getCurrentGraphFromDocument
- fileIO.ts: use documentUtils for serialization/validation
- persistence.ts: use documentUtils.validateDocument
- graphStore.ts: remove legacy loadGraphState, start with empty state

Removed legacy storage keys:
- LEGACY_GRAPH_STATE from workspace/persistence.ts
- hasLegacyData() function (no longer needed)
- References to LEGACY_GRAPH_STATE in cleanupStorage.ts

Impact:
- No breaking changes for existing users (workspace format unchanged)
- Cleaner code organization (all document utils in one place)
- No migration support (old documents will not be loaded)
- Reduced technical debt (~350 lines removed)

Related: Phase 1 of STATE_MANAGEMENT_REFACTORING_PLAN.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 12:15:25 +02:00
..
DIRECTIONAL_RELATIONSHIPS_UX_SPEC.md feat: add document naming dialog before creation 2025-10-11 12:03:05 +02:00
IMPLEMENTATION_CHECKLIST.md doc: move some plans around 2025-10-11 22:08:53 +02:00
KEYBOARD_SHORTCUTS.md Initial commit 2025-10-10 11:15:51 +02:00
MULTI_FILE_PLAN.md Initial commit 2025-10-10 11:15:51 +02:00
PERSISTENCE_PLAN.md Initial commit 2025-10-10 11:15:51 +02:00
PHASE_4_1_COMPLETION_SUMMARY.md refactor: remove legacy persistence code and migration system (Phase 1) 2025-10-20 12:15:25 +02:00
PHASE_4_1_TEST_PLAN.md fix: correct history timing in createGroupWithActors for proper undo behavior 2025-10-20 12:09:09 +02:00
PROJECT_SUMMARY.md Initial commit 2025-10-10 11:15:51 +02:00
SIDE_PANELS_UX_DESIGN.md feat: side panels for properties and tools 2025-10-10 18:13:18 +02:00
STATE_MANAGEMENT_REFACTORING_PLAN.md fix: correct history timing in createGroupWithActors for proper undo behavior 2025-10-20 12:09:09 +02:00
TEMPORAL_ANALYSIS_SUMMARY.md doc: move some plans around 2025-10-11 22:08:53 +02:00
TEMPORAL_QUICK_START.md doc: move some plans around 2025-10-11 22:08:53 +02:00
TEMPORAL_SCENARIO_IMPLEMENTATION_PLAN.md doc: move some plans around 2025-10-11 22:08:53 +02:00
TEMPORAL_SCENARIO_UX_CONCEPT.md doc: move some plans around 2025-10-11 22:08:53 +02:00
UNDO_REDO_IMPLEMENTATION.md refactor: migrate undo/redo from per-state to per-document level 2025-10-11 22:38:23 +02:00
UX_ANALYSIS.md Initial commit 2025-10-10 11:15:51 +02:00
UX_ANALYSIS_ACTOR_TYPE_SETTINGS.md feat: redesign relation type configuration with improved UX 2025-10-16 19:47:12 +02:00
UX_CONCEPT_MULTI_VERSION_GRAPH.md doc: move some plans around 2025-10-11 22:08:53 +02:00
VISUAL_EXAMPLES.md doc: move some plans around 2025-10-11 22:08:53 +02:00
WORKSPACE_PERSISTENCE.md Initial commit 2025-10-10 11:15:51 +02:00