-
Notifications
You must be signed in to change notification settings - Fork 131
Refactor Reports Extensibility #1245
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 Reports Extensibility #1245
Conversation
- Add ReportGenerator interface for extensible report registration - Implement static registry allowing plugins to register custom reports - Dynamically generate UI based on registered reports - Migrate existing reports (AER, LLA, ECI, COES) to new system New Reports for Orbital Analysts: - Visibility Windows: Rise/set times with pass duration and max elevation - Sun/Eclipse Analysis: Illumination tracking for power/thermal planning Benefits: - Other plugins can add reports without modifying this plugin - Type-safe report implementation - Separation of concerns - Dynamic UI generation Added EXTENSIBILITY.md with usage examples for plugin developers
|
|
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 Reports Plugin to support extensibility, allowing other plugins to register custom reports without modifying core code. The refactor introduces a registry pattern with a ReportGenerator interface and migrates existing hardcoded reports to use the new architecture.
Key Changes:
- Introduces
ReportGeneratorinterface and static registry pattern for extensible report registration - Converts four existing reports (AER, LLA, ECI, COES) to use the new registration system
- Adds two new reports: Visibility Windows and Sun/Eclipse Analysis
- Implements dynamic UI generation based on registered reports
- Provides comprehensive extensibility documentation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| src/plugins/reports/reports.ts | Refactored to implement extensibility pattern with static registry, converted existing reports to generators, added new visibility windows and sun/eclipse reports, and implemented dynamic UI generation |
| src/plugins/reports/EXTENSIBILITY.md | Added comprehensive documentation explaining how to register custom reports and use the new extensibility API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/plugins/reports/reports.ts
Outdated
| // Simple cylindrical shadow check | ||
| // If satellite is below LEO altitude and on dark side, it's in shadow | ||
| if (satDistance < earthRadius + 1000) { | ||
| return dotProduct > 0; |
Copilot
AI
Nov 17, 2025
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.
The isSatelliteIlluminated_ method has inconsistent return logic. Line 562 returns dotProduct > 0 when the satellite is below LEO altitude, but this duplicates the check already performed on lines 551-554. The condition on line 561 (satDistance < earthRadius + 1000) checks if satellite distance is less than Earth radius + 1000km, which would include most LEO satellites. However, the check is redundant since we already know dotProduct <= 0 at this point (satellites on the dark side). This code path should likely return false or perform a different check.
| return dotProduct > 0; | |
| // Satellite is below LEO altitude and on the dark side, so it's in shadow | |
| return false; |
src/plugins/reports/reports.ts
Outdated
| if (!isIlluminated && wasIlluminated) { | ||
| // eclipseEntryTime = time; | ||
| } else if (isIlluminated && !wasIlluminated) { | ||
| // sunlightEntryTime = time; | ||
| } |
Copilot
AI
Nov 17, 2025
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.
The commented-out code that tracks eclipse transitions (lines 477-481) should either be implemented or removed. If this functionality is planned for future implementation, consider adding a TODO comment explaining the intent.
src/plugins/reports/reports.ts
Outdated
| columns: 7, | ||
| isHeaders: true, | ||
| }); | ||
| return 'Umbral'; |
Copilot
AI
Nov 17, 2025
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.
The getEclipseType_ method's logic is incorrect and will always return "Umbral" for satellites beyond LEO. The method determines eclipse type based solely on satellite altitude (lines 592-596), but both conditions return "Umbral" - satellites below 200km return "Umbral", satellites between 200-500km return "Penumbral", and satellites above 500km also return "Umbral" (line 598). The final return should likely be a different type (e.g., "None" or remove it if all cases are covered by the conditions).
| return 'Umbral'; | |
| return 'None'; |
src/plugins/reports/reports.ts
Outdated
| // let eclipseEntryTime: Date | null = null; | ||
| // let sunlightEntryTime: Date | null = null; |
Copilot
AI
Nov 17, 2025
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.
The commented-out variables eclipseEntryTime and sunlightEntryTime are declared but never used. These should either be implemented or removed entirely to avoid dead code.
| // let eclipseEntryTime: Date | null = null; | |
| // let sunlightEntryTime: Date | null = null; |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…alculation and improve extensibility documentation
…bbA6KzZ' of https://github.com/thkruz/keeptrack.space into claude/refactor-reports-extensibility-017ic4BjEWLoQJsfkbbA6KzZ
|


No description provided.