mirror of
https://github.com/OFFIS-ESC/constellation-analyzer
synced 2026-01-27 07:43:41 +00:00
Eliminates duplicate snapshot logic between useDocumentHistory and timelineStore. Problem: - useDocumentHistory created snapshots reading types from document (correct) - timelineStore created snapshots reading types from graphStore (incorrect) - ~30 lines of duplicated snapshot creation logic - Risk of inconsistent behavior between graph and timeline operations Solution: - Created createDocumentSnapshot() in documentUtils.ts - Single source of truth for snapshot creation - Always reads types/labels from document (correct source) - Syncs timeline current state before snapshot (ensures latest data) Changes: - Add createDocumentSnapshot() to src/stores/workspace/documentUtils.ts - Update useDocumentHistory.ts to use centralized helper - Update timelineStore.ts pushDocumentHistory() to use centralized helper - Remove duplicate snapshot creation code (~30 lines) Benefits: - ✅ Consistent snapshot behavior everywhere - ✅ Types always read from document (source of truth) - ✅ Easier to maintain (single implementation) - ✅ Fixes potential bug where timelineStore had stale types - ✅ Better code organization Impact: - No breaking changes - Undo/redo behavior unchanged for users - Timeline operations now have correct type information - Safer - impossible for snapshot logic to diverge Testing: - TypeScript compilation passes - No runtime behavior changes expected - Snapshot structure unchanged Related: Phase 2.1 of STATE_MANAGEMENT_REFACTORING_PLAN.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| DIRECTIONAL_RELATIONSHIPS_UX_SPEC.md | ||
| IMPLEMENTATION_CHECKLIST.md | ||
| KEYBOARD_SHORTCUTS.md | ||
| MULTI_FILE_PLAN.md | ||
| PERSISTENCE_PLAN.md | ||
| PHASE_1_COMPLETION_SUMMARY.md | ||
| PHASE_4_1_COMPLETION_SUMMARY.md | ||
| PHASE_4_1_TEST_PLAN.md | ||
| PROJECT_SUMMARY.md | ||
| SIDE_PANELS_UX_DESIGN.md | ||
| STATE_MANAGEMENT_REFACTORING_PLAN.md | ||
| TEMPORAL_ANALYSIS_SUMMARY.md | ||
| TEMPORAL_QUICK_START.md | ||
| TEMPORAL_SCENARIO_IMPLEMENTATION_PLAN.md | ||
| TEMPORAL_SCENARIO_UX_CONCEPT.md | ||
| UNDO_REDO_IMPLEMENTATION.md | ||
| UX_ANALYSIS.md | ||
| UX_ANALYSIS_ACTOR_TYPE_SETTINGS.md | ||
| UX_CONCEPT_MULTI_VERSION_GRAPH.md | ||
| VISUAL_EXAMPLES.md | ||
| WORKSPACE_PERSISTENCE.md | ||