Implementation: How to implement dual-layer layout persistence for unified-b...

Documentation for Sessions

⚙️ Implementation: How to implement dual-layer layout persistence for unified-b...

📋 Decision Context

Question:

How to implement dual-layer layout persistence for unified-builder?

Task: Session 38: Implement dual-layer layout persistence for unified-builder


🎯 Decision Made

Chosen:

autoFlashState with global preferences and per-universe overrides

Options Considered:

  1. Single flat persistence
  2. Per-universe only persistence
  3. Global + per-universe dual-layer persistence
  4. External storage service

💭 Reasoning

Used autoFlashState pattern consistent with existing state management. Created two layers: (1) _globalLayoutPreferences for user's default layout settings with 90-day TTL, (2) _universeOverrides keyed by universeId for universe-specific customizations with 60-day TTL. Added effectiveLayoutPreferences computed signal that merges global with overrides. This approach allows users to have a default layout across all universes while customizing specific universes differently.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation