-
Notifications
You must be signed in to change notification settings - Fork 131
Refactor SettingsManager #1240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor SettingsManager #1240
Conversation
…dules
- Split monolithic settings.ts (1565 lines) into 8 category files:
* graphics-settings.ts - Rendering, textures, visual effects
* ui-settings.ts - Interface, menus, display settings
* camera-settings.ts - Camera movement, FOV, zoom
* orbital-settings.ts - Orbit calculations, propagation
* data-settings.ts - Data sources, catalogs, servers
* performance-settings.ts - Optimization and limits
* color-settings.ts - Color schemes and object colors
* core-settings.ts - Core settings, plugins, filters
- Refactored SettingsManager to use category instances with programmatic
property accessors for 100% backward compatibility
- Enhanced settingsOverride.js to support both:
* Flat syntax (backward compatible): isDrawSun: true
* Nested syntax (recommended): graphics: { isDrawSun: true }
- Updated deepMerge to handle partial nested overrides while preserving
defaults for unspecified properties
- Maintained all existing methods and functionality
- All property access patterns remain unchanged for consuming code
Breaking Changes: None - fully backward compatible
… checking - Added interface SettingsManager that extends all category classes - Uses TypeScript's declaration merging to expose all properties - Fixes 'property does not exist' TypeScript errors - Runtime behavior unchanged - properties still delegated via getters/setters
…s and update imports
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the settings system by splitting the monolithic SettingsManager class into smaller, domain-specific setting classes organized by category (graphics, UI, camera, orbital, data, performance, color, and core). The refactor maintains backward compatibility through programmatic property accessors while enabling both flat and nested configuration syntax for settings overrides.
Key changes:
- Introduces category-based settings classes with dedicated default exports
- Implements property accessor pattern for backward compatibility
- Updates documentation and examples to demonstrate both flat and nested override syntax
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/settings/ui-settings.ts | New UI-specific settings class with display, splash screen, and label configuration |
| src/settings/settings.ts | Refactored to delegate properties to category instances via accessors and PROPERTY_CATEGORY_MAP |
| src/settings/performance-settings.ts | New performance settings class for resource limits and FPS throttling |
| src/settings/orbital-settings.ts | New orbital mechanics settings class for orbit rendering and propagation |
| src/settings/graphics-settings.ts | New graphics settings class for rendering, textures, and visual effects |
| src/settings/data-settings.ts | New data settings class for catalogs, servers, and external sources |
| src/settings/core-settings.ts | New core settings class for plugins, global flags, and application state |
| src/settings/color-settings.ts | New color settings class for color schemes and object colors |
| src/settings/camera-settings.ts | New camera settings class for movement, zoom, and FOV configuration |
| public/settings/settingsOverride.js | Updated documentation demonstrating flat and nested override syntax |
| src/settings/parse-get-variables.ts | Added type assertions for texture quality settings |
| src/settings/presets/*.ts | Added type assertions and import reordering for preset configurations |
| .gitignore | Added pattern to exclude note files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
1 similar comment
|



This pull request introduces a major refactor and expansion of the application's settings system, improving organization, extensibility, and clarity for both developers and users. It adds new structured settings classes for core, camera, and color configuration, updates documentation and examples for overriding settings, and makes minor compatibility improvements in the rendering logic. The most important changes are grouped below:
Settings System Refactor and Expansion
CameraSettings,ColorSettings, andCoreSettingsin thesrc/settings/directory, each with comprehensive documentation, typed properties, and default exports for use throughout the application. These cover camera movement, color schemes, and core/global flags respectively. [1] [2] [3]public/settings/settingsOverride.jsto document both flat and nested syntax for overriding settings, including available categories and improved organization.Rendering and Engine Compatibility
createSatRicFramemethod inLineManagerto acceptOemSatelliteobjects, improving compatibility with new satellite types.Submodule Updates
src/engine/ootkandsrc/plugins-prosubmodules to their latest commits, ensuring compatibility with the new settings structure and other improvements. [1] [2]These changes collectively make the application's configuration more robust, maintainable, and easier to extend for future features.