Skip to content

Conversation

@thkruz
Copy link
Owner

@thkruz thkruz commented Nov 17, 2025

No description provided.

claude and others added 2 commits November 16, 2025 20:39
- 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
Copilot AI review requested due to automatic review settings November 17, 2025 00:14
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ thkruz
❌ claude
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

Copilot AI left a 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 ReportGenerator interface 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.

// 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;
Copy link

Copilot AI Nov 17, 2025

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.

Suggested change
return dotProduct > 0;
// Satellite is below LEO altitude and on the dark side, so it's in shadow
return false;

Copilot uses AI. Check for mistakes.
Comment on lines 477 to 481
if (!isIlluminated && wasIlluminated) {
// eclipseEntryTime = time;
} else if (isIlluminated && !wasIlluminated) {
// sunlightEntryTime = time;
}
Copy link

Copilot AI Nov 17, 2025

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.

Copilot uses AI. Check for mistakes.
columns: 7,
isHeaders: true,
});
return 'Umbral';
Copy link

Copilot AI Nov 17, 2025

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).

Suggested change
return 'Umbral';
return 'None';

Copilot uses AI. Check for mistakes.
Comment on lines 450 to 451
// let eclipseEntryTime: Date | null = null;
// let sunlightEntryTime: Date | null = null;
Copy link

Copilot AI Nov 17, 2025

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.

Suggested change
// let eclipseEntryTime: Date | null = null;
// let sunlightEntryTime: Date | null = null;

Copilot uses AI. Check for mistakes.
@thkruz thkruz merged commit 1e3409b into develop Nov 18, 2025
2 of 4 checks passed
@thkruz thkruz deleted the claude/refactor-reports-extensibility-017ic4BjEWLoQJsfkbbA6KzZ branch November 18, 2025 00:36
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
9.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants