This commit addresses issue #7807 by implementing comprehensive type
safety for GoldenLayout configuration serialization and deserialization,
replacing unsafe `any` types throughout the persistence pipeline.
Key changes:
- Updated url.ts functions to use proper types (SerializedLayoutState/GoldenLayoutConfig)
- Added validation with fromGoldenLayoutConfig() that returns false for invalid configs
- Implemented toSerializedLayoutState() helper for consistent serialization
- Updated localStorage handling in main.ts with proper validation and error recovery
- Enhanced history.ts to use SerializedLayoutState for tracking layout changes
- Updated sharing.ts to use type-safe serialization helpers
- Modified component tests to match new validation behavior (lenient for structure)
The implementation provides graceful degradation - invalid configurations
fall back to default config instead of crashing, ensuring robust handling
of corrupted localStorage/URL data while maintaining backward compatibility.
Related to PR #7801 and issue #7808.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>