Skip to content

[MPDX-9764,MPDX-9765,MPDX-9794] Implement goal settings page - #1867

Merged
canac merged 14 commits into
mainfrom
9764-goal-settings-page
Jun 30, 2026
Merged

[MPDX-9764,MPDX-9765,MPDX-9794] Implement goal settings page#1867
canac merged 14 commits into
mainfrom
9764-goal-settings-page

Conversation

@canac

@canac canac commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

Implement the goal settings page, where admins can edit the calculation fields. Most fields are functional, except for a couple that come from the attendee, which we don't have an API for yet.

There will probably be a few things to fix or improve, but since this is already a huge PR, it might be best to make those improvements in follow-up tickets and PRs unless they are trivial fixes or significant refactorings.

Jira tickets:

Testing

  • Login to the test account
  • Switch to account list TTM | John Doe | MPD Coach
  • Go to the coaching page and click on Jeff DePree
  • Click his "View New Staff Goal" link (full link: /accountLists/308c5567-a0b6-49f6-922e-f0c338e170ca/coaching/45ef99a5-c7b9-4873-b194-ca4d5b28d09e/nsGoalCalculator)
  • Verify that the goal calculation renders
  • Verify that you can edit and save values

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

@canac
canac requested a review from zweatshirt June 29, 2026 15:41
@canac canac self-assigned this Jun 29, 2026
@canac canac added Preview Environment Add this label to create an Amplify Preview Staging API Run GraphQL codegen against the staging API labels Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview branch generated at https://9764-goal-settings-page.d3dytjb8adxkk5.amplifyapp.com

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against ad90f78

Route Size (gzipped) Diff
/accountLists/[accountListId]/coaching/[coachingId]/nsGoalCalculator 119.76 KB added

@canac canac left a comment

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.

🤖 Multi-Agent Code Review — PR #1867

Verdict: ✅ APPROVED WITH SUGGESTIONS · Mode: standard · 7 specialist agents + dependency + gap review

No blockers (nothing ≥ 8.0, no critical). One Important (7.5) finding is strongly recommended before merge; 6 Medium and ~10 low suggestions follow as inline comments.

⚠️ Risk score 10/10 (CRITICAL) — driven by size (38 files, +3075/-2) + the financial goal-calculation domain, not by defects. The code is clean, convention-compliant, and unusually well-tested. Because risk is CRITICAL, this PR is not auto-approve eligible and a senior reviewer should sign off.

Consensus

Tier Count
Critical (9.0–10.0) 0
High (8.0–8.9) 0
Important (7.0–7.9) 1
Medium (5.0–6.9) 6
Suggestions (<5.0) ~10
Pre-existing (info) 2

Top finding

Save has no success/error feedback (7.5)GoalSettingsForm.tsx handleSubmit awaits the mutation with no try/catch and no snackbar. Flagged independently by the Testing and UX agents against the repo's enqueueSnackbar convention (252 usages; sibling useSaveField.ts). On failure the user sees nothing. Compounds with the PositiveFloat Medium finding: a user entering 0 in a salary/amount field could get a silent no-op save. See inline comment.

⚠️ Cross-cutting compound risk

Finding #1 (silent save) + finding #3 (0 possibly rejected by the PositiveFloat scalar) together mean a 0 entry can fail server-side with zero user feedback. Fixing the error handling (#1) also surfaces #3.

Test-coverage gaps (not posted inline)

  • No integration test asserts spouse attributes are cleared to null on a married→single save (unit-tested in isolation only). Medium 6.0.
  • The save success/error branches are untested (add with the #1 fix).
  • Field error/helperText display path lacks a focused unit test (covered indirectly). ~4.0.
  • One inline GqlMockedProvider in GoalSettingsForm.test.tsx lacks typed generics. 3.5.

Non-code confirmations (informational)

  • Server-side coach authorization — verify the API resolver scopes the newStaffGoalCalculation query + updateNewStaffGoalCalculation mutation by accountListId. The client can't enforce this and matches the existing coaching trust model; not a front-end defect.
  • Validation parity — the Yup numeric rules are client-only; ensure the server enforces the same bounds.
  • Codegen — confirm yarn gql succeeds in CI (.generated.ts is not committed).

Pre-existing (not this PR)

  • next.config.ts env block already inlines real secrets into the client bundle. This PR only adds the benign DISABLE_NS_GOAL_CALCULATOR flag, following the DISABLE_NEW_REPORTS convention. Out of scope.
  • CoachingDetail.tsx style={{ flexGrow: 1 }} is pre-existing context, not added here.

Strengths

  • Standards: 0 violations, full checklist PASS (named exports, file naming, i18n with proper interpolation, id in every selection set, no any/console/new Date(), Formik+Yup, submit disabled while submitting, Luxon for dates).
  • Data integrity: form→mutation mapping is an explicit allowlist — no editable field dropped, every spouse* field gated, real 0 preserved (value === ''), cache normalizes by id.
  • Dependency impact: LOW/non-breaking — only 2 existing files touched, both backward-compatible; 0 unresolved imports.
  • Gap review of the two untested Section files: clean.

Reply /dismiss: <reason> on any Medium/low comment (severity < 7) to acknowledge it. The Important (7.5) finding and the non-code confirmations can't be dismissed.

Comment thread src/components/HrTools/NsGoalCalculator/GoalSettings/GoalSettingsLayout.tsx Outdated
Comment thread src/components/HrTools/NsGoalCalculator/GoalSettings/goalSettingsApiMapping.ts Outdated

@zweatshirt zweatshirt left a comment

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.

Looks great so far. I noticed the Figma also has 'NSO/IBS Cost' and 'MPDRR / F&F Course' which aren't included here, but you're likely aware of that.

Comment on lines +30 to +34
<GoalSettingsNumberField
name="annualRequestedSalary"
label={t('Annual Requested Salary')}
personName={primaryName}
adornment="currency"

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.

From the Figma, it looks like this should have the seniorStaffOnly helper text as well

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'm not sure on this one. I thought that mid-career new staff could adjust their requested salary, but maybe I'm mistaken. I started a thread with Ryan about it: https://www.figma.com/design/O3zztrqYUv0lxHhYw3Fhw4?node-id=1580-22499&m=dev#1824311925

@canac

canac commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

I noticed the Figma also has 'NSO/IBS Cost' and 'MPDRR / F&F Course' which aren't included here, but you're likely aware of that.

Correct. Figma makes them seem like they are editable per-calculation. But they are actually set on the new staff cohort. We can show them here once the cohort model exists, but they won't be editable here.

@canac canac removed the Staging API Run GraphQL codegen against the staging API label Jun 30, 2026
@canac
canac enabled auto-merge June 30, 2026 15:44
@canac
canac merged commit df2dcc0 into main Jun 30, 2026
23 of 24 checks passed
@canac
canac deleted the 9764-goal-settings-page branch June 30, 2026 15:52
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.

2 participants