Files
compiler-explorer/static
Matt GodboltandClaude f918545120 Implement type-safe GoldenLayout serialization/deserialization
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>
2025-06-19 15:03:23 -05:00
..
2025-06-18 09:04:23 -05:00
2025-06-18 09:04:23 -05:00
2025-06-19 08:46:57 -05:00
2025-06-18 09:04:23 -05:00
2024-10-25 12:19:04 +03:00
2025-04-24 12:10:37 -05:00
2025-04-24 12:10:37 -05:00