Skip to content

feat: add RenewalCalendar component for tracking and visualizing subs…#3

Merged
hardinxcore merged 6 commits into
mainfrom
staging
Apr 3, 2026
Merged

feat: add RenewalCalendar component for tracking and visualizing subs…#3
hardinxcore merged 6 commits into
mainfrom
staging

Conversation

@hardinxcore
Copy link
Copy Markdown
Owner

@hardinxcore hardinxcore commented Apr 3, 2026

  • Understand the codebase and relevant code sections
  • Check results.errors in PapaParse complete handler and surface parse warnings (comment_id: 3032958102)
    • Show count + sample of up to 3 parse issues; preserve warning in subsequent validation error messages
    • Extract CSV_ROW_NUMBER_OFFSET = 2 constant with doc comment for clarity
    • Use Number.POSITIVE_INFINITY for daysUntilEST when termEndDate is missing (avoids false "Today" urgency)
    • Reset file input on early complete returns and in the error callback so retry works
    • Handle Infinity in display labels (shows instead of Infinityd)

Copy link
Copy Markdown
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 updates the RenewalCalendar feature to stop inferring “in EST” status from billing data and instead support uploading a Partner Center AI Assist EST export CSV to track subscriptions scheduled to enter EST.

Changes:

  • Removed the previous “in Extended Service Term (EST)” calculation and related calendar/list/export UI.
  • Added Partner Center EST CSV upload parsing via PapaParse, including basic format validation and error display.
  • Added SubscriptionId → CustomerName resolution for uploaded EST rows using existing billing data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/RenewalCalendar.tsx Outdated
Comment on lines +291 to +295
complete: (results) => {
const rows = results.data as Record<string, string>[];
if (!rows.length) {
setEstUploadError('No data rows found in the uploaded file.');
return;
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PapaParse complete handler, results.errors is ignored. Papa can return partial data alongside parse errors (e.g., malformed quotes/rows), which would currently be treated as a successful upload. Consider checking results.errors.length and surfacing a useful error (or at least a warning) before calling setEstUploadRecords.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commits 62ae92d53eca7f. The complete handler now:

  • Builds a parseWarning string from results.errors (count + sample of up to 3 issues with human-readable row numbers via the new CSV_ROW_NUMBER_OFFSET constant).
  • Preserves that warning inside any subsequent validation error messages ("no data" / wrong format), so it's never silently lost.
  • Shows the warning on its own when partial data is still returned and processed successfully.
  • Also fixed the file input not being reset in early complete returns and in the error callback, so retrying the same file always fires onChange.
  • Changed daysUntilEST to Number.POSITIVE_INFINITY for missing/unparseable dates, so those rows sort to the end and render instead of the misleading "Today".

Comment thread src/components/RenewalCalendar.tsx Outdated
Comment on lines +332 to +337
setEstUploadRecords(parsed);
// Reset file input so re-uploading the same file triggers onChange
if (estFileInputRef.current) estFileInputRef.current.value = '';
},
error: (err: any) => {
setEstUploadError(`Parse error: ${err.message}`);
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file input is reset only on successful complete, but not on parse error. If parsing fails, selecting the same file again may not fire onChange, making it hard to retry. Consider also clearing estFileInputRef.current.value in the error callback (and possibly in early returns that set estUploadError).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hardinxcore
Copy link
Copy Markdown
Owner Author

@copilot apply changes based on the comments in this thread

Copilot AI and others added 3 commits April 3, 2026 14:00
…n dates, reset file input on error

Agent-Logs-Url: https://github.com/hardinxcore/CSPInsights.app/sessions/8e2b7784-bbed-4956-beea-3fd717a0ec75

Co-authored-by: hardinxcore <34623288+hardinxcore@users.noreply.github.com>
@hardinxcore hardinxcore merged commit a875552 into main Apr 3, 2026
2 checks passed
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.

3 participants