Skip to content

No-Jira - PDS Goal Calculator: Quick Geographic Location fix #1793

Merged
zweatshirt merged 1 commit into
mainfrom
improve-pds-geo
May 21, 2026
Merged

No-Jira - PDS Goal Calculator: Quick Geographic Location fix #1793
zweatshirt merged 1 commit into
mainfrom
improve-pds-geo

Conversation

@zweatshirt
Copy link
Copy Markdown
Contributor

@zweatshirt zweatshirt commented May 21, 2026

Description

We want to hide the geographic multiplier row information when there is no multiplier set.

Testing

  • Go to ...
  • Do ...
  • Check that ...

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels (Add the label "Preview" to automatically create a preview environment)
  • I have run the Claude Code /pr-review command locally and fixed any relevant suggestions
  • I have requested a review from another person on the project
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

@zweatshirt zweatshirt self-assigned this May 21, 2026
@zweatshirt zweatshirt added the Preview Environment Add this label to create an Amplify Preview label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Preview branch generated at https://improve-pds-geo.d3dytjb8adxkk5.amplifyapp.com

@github-actions
Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 29a6e24

No significant changes found

Copy link
Copy Markdown
Contributor Author

@zweatshirt zweatshirt left a comment

Choose a reason for hiding this comment

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

Multi-Agent Code Review — CLEAN ✓

Verdict: CLEAN — No issues found.

Risk: 1/10 (LOW) · 2 files · 9 source lines · single domain

Agents: Architecture, Testing, Standards, Financial Reporting (4 reviewers)


Summary

The geographicMultiplier === 0 guard is semantically correct: 0 is the "no adjustment" sentinel (sourced from goalGeographicConstantMap with ?? 0), and grossMonthlyPay = monthlyBase × (1 + 0) = monthlyBase exactly in IEEE-754. Showing "Monthly Base" instead of "× Geographic Multiplier (100%)" removes misleading noise. Both new translation keys are properly localized. Both branches have test coverage.

All findings below are informational suggestions — none block merge.


Financial Checklist

  • Arithmetic on money values safe: ✓
  • Rounding at display boundary only: ✓
  • Formula label matches computed amount: ✓ (multiply-by-1.0 is bit-exact)
  • Null/undefined amounts handled: ✓ (?? 0 present)

i18n.t,
);
const row = rows.find((r) => r.id === 'gross-monthly-pay');
expect(row?.formula).toBe('Monthly Base');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Suggestion] This test verifies the formula label but not that `row?.amount` equals the monthly base when the multiplier is 0. The amount is covered by a separate test elsewhere, but asserting both here would lock label/amount agreement in one place:
expect(row?.formula).toBe('Monthly Base');
expect(row?.amount).toBe(salariedCalculation.monthlyBase); // or the expected number

Not blocking — just strengthens the invariant.

rate: percentageFormat(1 + geographicMultiplier, locale),
}),
formula:
geographicMultiplier === 0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Suggestion] The strict `=== 0` guard is correct given that `geographicMultiplier` comes from `goalGeographicConstantMap` with `?? 0` (only exact zero is the "no adjustment" sentinel). Worth a brief comment to document this assumption so a future reader doesn't wonder whether very small values (e.g. `0.0001`) should also render "Monthly Base".

expect(row?.formula).toBe('Monthly Base');
});

it('shows "Monthly Base × Geographic Multiplier (rate)" formula when multiplier is non-zero', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Suggestion] The non-zero branch is covered with `0.06`. If negative multipliers are reachable from `goalGeographicConstantMap` (sub-baseline cost-of-living regions), a negative test case would document the intended behavior (e.g. `-0.06` → `94%`). Skip if negative values aren't possible in practice.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

AI Review Auto-Approval

Risk Level: LOW (1/10)
Verdict: CLEAN (no issues found)

This PR was auto-approved because:

  • The multi-agent AI review determined it is low risk
  • No blocking issues were found

If you believe this PR needs human review, dismiss this approval and request a review manually.

@zweatshirt zweatshirt marked this pull request as ready for review May 21, 2026 13:55
@zweatshirt zweatshirt merged commit 3e1957e into main May 21, 2026
23 of 24 checks passed
@zweatshirt zweatshirt deleted the improve-pds-geo branch May 21, 2026 13:56
@zweatshirt zweatshirt changed the title No-Jira - quick preferential fix No-Jira - PDS Goal Calculator: Quick Geographic Location fix May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Preview Environment Add this label to create an Amplify Preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant