Skip to content

[MPDX-9540] - Show step progress and current step indicator in PDS Goal Calculator#1769

Merged
wjames111 merged 11 commits into
mainfrom
MPDX-9540
May 13, 2026
Merged

[MPDX-9540] - Show step progress and current step indicator in PDS Goal Calculator#1769
wjames111 merged 11 commits into
mainfrom
MPDX-9540

Conversation

@wjames111
Copy link
Copy Markdown
Contributor

Description

  • Replaces the hardcoded percentComplete={0} in the PDS Goal Calculator with a step-based progression so the percentage advances each time the user moves to the next step.
  • Updates useSteps to accept the active step and mark every section in the current step (and earlier steps) as complete, so the sidebar's filled blue dot reflects where the user currently is in the form.
  • Mirrors the pattern used by the Salary Calculator and other reports (useStepList((currentIndex + 1) / steps.length) * 100).
  • Jira: MPDX-9540

Testing

  • Go to a PDS Goal Calculator goal (/accountLists/[id]/hrTools/pdsGoalCalculator/[pdsGoalId])
  • On the Setup step, confirm the circular progress indicator shows 25% and the "Setup" sidebar entry has the filled blue dot
  • Click Continue and confirm the indicator advances to 50% and the "Monthly Reimbursable Expenses" / "Annual Reimbursable Expenses" entries show filled blue dots on the Reimbursable Expenses step
  • Continue through Support Item (75%) and Summary Report (100%), confirming the current step's sidebar sections always show as filled blue dots
  • Repeat with a Simple form goal — only Setup / Support Item / Summary Report should appear, advancing 33% / 67% / 100%
  • Click an earlier step icon in the left rail and confirm the percentage and dots reflect the new active step

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

@wjames111 wjames111 changed the base branch from main to MPDX-9541 May 8, 2026 20:52
@wjames111 wjames111 changed the title MPDX-9540 Show step progress and current step indicator in PDS Goal Calculator [MPDX-9540] - Show step progress and current step indicator in PDS Goal Calculator May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Bundle sizes [mpdx-react]

Compared against 6bac042

No significant changes found

@wjames111 wjames111 self-assigned this May 11, 2026
@wjames111 wjames111 added the On Staging Will be merged to the staging branch by Github Actions label May 11, 2026
Copy link
Copy Markdown
Contributor Author

@wjames111 wjames111 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

Verdict: APPROVED WITH SUGGESTIONS — no blockers, 1 Important finding (severity 7.0) and several Medium-priority improvements recommended.

Mode: standard (5 specialized agents + dependency impact + 5-agent debate round)

Risk Assessment

  • Risk score: 10/10 (rule-based cap — 12 medium-risk feature files × 1pt + 200-300 line volume = 14, capped at 10)
  • Risk level: CRITICAL by formula, but qualitatively LOW–MEDIUM: pure UI/display logic, no auth/CI/migration/GraphQL/schema changes; dependency analysis confirmed zero breaking exports.
  • Reviewer level: MID-LEVEL/SENIOR. PDS Goal Calculator is financial-domain UI; the math itself is untouched.

Selected agents

Architecture, Testing & Quality, Standards Compliance, UX, Financial Reporting (domain). Security and Data Integrity were skipped — no API/auth/CI/env/GraphQL-mutation/schema/cache changes.

Summary of findings (post-debate consensus)

Important (severity 7.0–7.9) — recommended fix, not a blocker:

  • Missing tests for 4 new *SectionList.tsx components (Setup / ReimbursableExpenses / SupportItem / SummaryReport). Project standard from .claude/rules/code-review.md is colocated *.test.tsx for every new component. The wiring is thin and pdsCompletion.ts is well-tested, so this is recommended but not blocking. Testing agent revised down to 6.0, Standards agent revised up to 7.0 — landed at 7.0 consensus.

Medium (severity 5.0–6.9):

  • No loading affordance during calculationLoading=true (PdsGoalCalculatorLayout.tsx:51 → PanelLayout.tsx:131). When showPercentage={false}, the entire StyledBox containing the progress ring is removed from the DOM — no spinner, no skeleton. Brief in practice but visible on slow networks.
  • Missing test for CircularProgressWithLabel aria-label / aria-hidden additions — file is untested today; the new a11y attributes should be pinned.
  • Missing test for new announceCompletion branch in shared SectionList.tsx — the titleAccess Complete/Incomplete announcement is uncovered.
  • Missing test for aria-current="step" on PanelLayout active icon button — the “current step indicator” outcome named in the PR title hinges on this attribute.
  • Missing test for the showPercentage={!calculationLoading} loading branch in PdsGoalCalculatorLayout.
  • “$0 = complete” semantics in isMonthlyReimbursableComplete / isAnnualReimbursableComplete — entering a single $0 value flips the section to “Complete.” Financial agent originally flagged sev 7.0, self-revised to 4.0 on the grounds that the dot is a hint not a validator, and the comment in pdsCompletion.ts:29-30 documents the intent. UX agent disagreed and held sev 7.0+ on the grounds that “Complete” carries semantic weight that may mislead. Landing at 5.5 — please confirm the intended semantics and either (a) document the contract more loudly in the test (link to a ticket) or (b) rename to …Started / …Touched.

Suggestions (severity < 5.0) — informational:

  • isSalaryComplete = isSetupComplete aliases by reference equality; consider explicit wrappers so future divergence is trivially safe.
  • aria-label="Progress: 25%" on CircularProgress may double-announce with the role=progressbar + aria-valuenow. UX agent recommends aria-label="Section progress" (static) and rely on aria-valuenow for the numeric value.
  • CurrentSectionList switch has no exhaustiveness guard (matches the pre-existing CurrentStep pattern — not a regression).
  • PR description claims the percentage formula “mirrors the Salary Calculator (useStepList)”, but useStepList.ts:94-97 does not Math.round; PDS does. Imperceptible to users; update PR description for accuracy.
  • New goal shows 25%/33% before any user input. Matches existing Salary Calculator pattern, so not a regression — flagged for future product consideration only.

Dependency impact (no breaking changes)

  • SectionList (shared) — 8 consumers; announceCompletion prop added with default false, fully backward-compatible.
  • usePdsGoalCalculator — 25+ consumers; percentComplete added (non-breaking).
  • PanelLayout — 8 consumers; aria-current conditionally applied (non-breaking).
  • PdsGoalCalculatorSection type removed — zero remaining references.
  • useStepList.ts:94-97 confirmed as the Salary Calculator pattern the PR mirrors (modulo Math.round).

Auto-approval

Risk score = 10 (rule-based) so the auto-approve workflow will not trigger. A human reviewer should look at the financial-domain semantic question (“$0 = complete”) and decide whether to address now or in a follow-up.

Comment thread src/components/HrTools/PdsGoalCalculator/Setup/SetupSectionList.tsx
Comment thread src/components/HrTools/PdsGoalCalculator/Shared/PdsGoalCalculatorLayout.tsx Outdated
Comment thread src/components/HrTools/PdsGoalCalculator/Shared/pdsCompletion.ts
Comment thread src/components/HrTools/PdsGoalCalculator/Shared/pdsCompletion.ts Outdated
Comment thread src/components/HrTools/PdsGoalCalculator/PdsGoalCalculator.tsx
Comment thread src/components/HrTools/PdsGoalCalculator/Shared/PdsGoalCalculatorContext.tsx Outdated
@wjames111 wjames111 added the Preview Environment Add this label to create an Amplify Preview label May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Preview branch generated at https://MPDX-9540.d3dytjb8adxkk5.amplifyapp.com

Copy link
Copy Markdown
Contributor

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

It's looking good Will! There are a few areas we can make changes for quick wins.

Comment thread src/components/HrTools/GoalCalculator/SharedComponents/SectionList.test.tsx Outdated
0)
: ''
}
value={totalFourOThreeBContributionPercentage}
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.

Great refactor

Comment thread src/components/HrTools/PdsGoalCalculator/Shared/PdsGoalCalculatorContext.test.tsx Outdated
Comment on lines +129 to +131
const percentComplete = Math.round(
safeProgressRatio(stepIndex + 1, steps.length) * 100,
);
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.

Should we memoize this?

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.

I think it was at one point. Claude suggested it wasn't worth the overhead. Either way I think is fine, if you feel strongly about it we can memoize it though.

Comment thread src/components/HrTools/PdsGoalCalculator/Shared/PdsGoalCalculatorContext.test.tsx Outdated
Base automatically changed from MPDX-9541 to main May 12, 2026 19:56
@wjames111 wjames111 requested a review from zweatshirt May 12, 2026 20:32
@wjames111
Copy link
Copy Markdown
Contributor Author

@zweatshirt sorry to force push on you!

Copy link
Copy Markdown
Contributor

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

Nice job Will, the PDS Calculator is so close to being done now

@@ -77,15 +77,26 @@ describe('calculatePdsGoalTotal', () => {
});

it('excludes reimbursable expenses and 403b when formType is Simple', () => {
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.

Awesome. Thanks for updating this test, I feel like it is much better. I know it may be a bit of a pain, but I'm wondering if it's best that we also have a test that it does include 403b and reimbursable?

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.

Yeah I agree

@wjames111 wjames111 merged commit c5a4bb8 into main May 13, 2026
23 of 24 checks passed
@wjames111 wjames111 deleted the MPDX-9540 branch May 13, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

On Staging Will be merged to the staging branch by Github Actions Preview Environment Add this label to create an Amplify Preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants