Skip to content

MPDX-10328 NSO questionnaire design changes from Joanna's review - #2321

Open
jeff-clay wants to merge 4 commits into
MPDX-10400-nso-questionnaire-deadline-reopenfrom
MPDX-10328-nso-design-changes
Open

jeff-clay wants to merge 4 commits into
MPDX-10400-nso-questionnaire-deadline-reopenfrom
MPDX-10328-nso-design-changes

Conversation

@jeff-clay

@jeff-clay jeff-clay commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

DO NOT MERGE. Built ahead of Scott's call on MPDX-10328 (Jira comment 142863). No On Staging until Scott says yes, and it holds with the NSO PRs for Marc's UAT (board card t-nso-uat-hold).

Stacked on #2313 (MPDX-10400): this PR's base is that branch. When the NSO stack merges, GitHub retargets this PR to main, and it needs a fresh agent-review then.

Links

Description

Joanna's six design changes to the NSO MPD Questionnaire:

  • Training start date: Step 1's section is now "Before You Start" and shows a box with the training name and "Starting on [date]" when the training has a start date. No box when it doesn't (Marc: no end date).
  • Due date once: the due date moves from an alert on every step to a "Complete this form by [date and time, Eastern]" box on Step 1. It hides once the form is locked or submitted. The locked alerts (deadline passed, goal already sent) still show on every step, since they explain why nothing can change.
  • Spouse MHA wording: "What is {{spouseName}}'s current annual requested MHA?", and the Summary row now reads "Spouse's annual requested MHA" to match.
  • Submitted box: adds "You'll receive your support goal at [Training name] that begins on [Start date]." and "Questions or need a change? Email the MPD Team." with a mailto link to mpdhelp@cru.org (the address the deadline alert and the submitted email already use). With no start date the sentence ends at the training name; with no training it's left out.
  • No Back after submit: the Summary drops the Back button once submitted. The step icons still open each step read-only.
  • Max width: the form content is capped at MUI sm (600px) plus its side margins on every step and the Summary. On a phone it still fills the screen.

Choices a reviewer might question:

  • The cap applies to the Summary too. Joanna's mockup shows 680px there; one cap is simpler and close.
  • The training name comes from the API with its year once ("Winter 2027 NSO Only"; see mpdx_api#3842).
  • The form cap leaves the existing LabeledField rule that holds text fields to 50% at the md breakpoint, so desktop fields are about 330px. Joanna's mockup shows full-width fields; dropping that rule is a one-line follow-up if wanted.
  • Only the heading changes from "Settings" to "Before You Start". The rest of Joanna's help-text redesign (intro text, married or engaged card) is out of scope here.
  • A form locked by the deadline but never submitted keeps its Back button; Joanna asked to drop it only after submission.

Testing

Local QA (mpdx-local-ui, local API on the API PR branch, a senior-staff-spouse test questionnaire in an open training with a 1/20/2027 deadline and a 1/11/2027 start date), before on #2313's branch and after on this one:

  • Step 1: "Settings" and the "Due Jan 20, 2027, 5:00 PM EST..." alert become "Before You Start" with two boxes: "Fall NSO 2026 / Starting on Jan 11, 2027" and "Complete this form by / Jan 20, 2027, 5:00 PM EST". Content stops at about 770px wide on a 1440px screen.
  • Step 3 (senior staff spouse): no due alert; the question reads "What is Alex's current annual requested MHA?".
  • Summary, not submitted: Back and Submit still show.
  • Summary, submitted: "Submitted on 11/30/2026" plus "You'll receive your support goal at Fall NSO 2026 that begins on Jan 11, 2027." and "Questions or need a change? Email the MPD Team." (link is mailto:mpdhelp@cru.org). No Back button.
  • Phone (390px): the two boxes stack, and the page has no sideways scroll.
  • No app errors in the console.

Unit tests cover each change (TrainingDates, Settings, DeadlineNotice, VariantQuestions, SummaryReadOnly, layout width). With the source changes reverted, 10 of them fail.

To check on staging once it's there: impersonate a household in an open training, set the training's start date in MPD Goal Admin, then walk Steps 1 to 4 and submit.

Screenshots: before/after pairs are in a comment below.

AI Review

  • Round 1 (not posted, fixed first in 9fcbc60): valid description-list markup in the Step 1 boxes, label contrast on the grey boxes, phone-width minimum for the boxes, empty action row once submitted, Summary MHA label, stale comments, orphaned translation keys, a test id instead of parentElement, and two new test cases (no training name; Back stays on a locked, unsubmitted form).
  • Round 2 (posted, report): no blockers. CodeScene then flagged Summary as a Large Method, so f991f43 moves the missing-info alert into MissingInfoAlert (no behavior change); the incremental re-review of that commit found no blockers and CodeScene passes.

Findings deliberately not addressed (and why):

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 /agent-review:review command locally and fixed any relevant suggestions
  • The github-actions bot has approved the PR (it approves once /agent-review:review leaves no open blockers)
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

🤖 Generated with Claude Code

jeff-clay and others added 2 commits November 30, 2026 10:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeff-clay jeff-clay self-assigned this Nov 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeff-clay

jeff-clay commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 agent-review · ✅ no blockers · risk CRITICAL
advisory · 6 agents run (Code Review (/code-review xhigh), Security Review Agent, Testing & Quality Review Agent, Standards Compliance Review Agent, Financial Correctness Review Agent, UX & Accessibility Review Agent) · incremental since 9fcbc60

BLOCKERS: fix or dismiss to pass

✅ No blockers.

OTHER FINDINGS (22)

  • #1 · 5/10 · src/components/HrTools/NsoMpdQuestionnaire/Shared/NewStaffQuestionnaire.graphql:25 · The fragment selects trainingName and trainingStartDate, which the PR body says ship in mpdx_api#3842, but the PR carries only the On Hold label, not Staging API. CI codegens against production and will fail on the missing fields, and nothing blocks a merge before the API deploys. (api-contracts,code-review)
  • #14 · 5/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:104 · handleSubmit calls applyMonthlyGoal() without await or catch, so a failed location update is an unhandled rejection while the success toast and redirect still run. (code-review)
  • #2 · 4/10 · src/components/HrTools/NsoMpdQuestionnaire/PersonalInformation/TrainingDates.tsx:66 · trainingStartDate is formatted with no isValid check, so an unparseable value makes Intl.DateTimeFormat throw a RangeError and crashes Step 1 (same in SubmittedNotice line 38). (code-review,data-integrity)
  • #3 · 4/10 · src/components/HrTools/NsoMpdQuestionnaire/Shared/DeadlineNotice.tsx:18 · The per-step 'Due ... After that you can't change or submit it' alert was removed, so only Step 1 shows the deadline and nothing warns that the form locks after it. (code-review,ux)
  • #4 · 4/10 · src/components/HrTools/NsoMpdQuestionnaire/Shared/NsoMpdQuestionnaireLayout.tsx:64 · The new max width (sm + spacing(8), about 664px) stacks with LabeledField's md 50% TextField rule, so desktop fields shrink to about 330px, narrower than on tablets. (code-review)
  • #15 · 4/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:98 · The readOnly guard in handleSubmit claims to catch a spouse's later submit, but nothing refetches the questionnaire so readOnly will not flip. (code-review)
  • #16 · 4/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:157 · The new MissingInfoAlert receives handleStepChange through an onSelect prop, but no test clicks a section link in the warning, so a miswired onSelect would pass the suite. (testing)
  • #5 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/PersonalInformation/Settings.test.tsx:24 · Two existing Settings tests now render inside the mocked GraphQL provider but end before the query resolves, which can cause act warnings. (code-review)
  • #6 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/PersonalInformation/TrainingDates.test.tsx:15 · renderDates hand-writes a Partial questionnaire type instead of using the generated test wrapper prop type. (code-review)
  • #7 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/PersonalInformation/TrainingDates.tsx:50 · TrainingDates recomputes !locked && !completed instead of using the context's readOnly, so the two rules must be kept in sync by hand. (code-review)
  • #8 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Shared/DeadlineNotice.test.tsx:33 · The open-form test only checks that /deadline|Due/ is absent, so any other alert rendering for unlocked forms would still pass. (code-review)
  • #9 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Shared/DeadlineNotice.tsx:27 · Choosing between 'goal already sent' and 'deadline passed' uses the browser clock, so a client clock behind the server can show the wrong lock reason. (code-review)
  • #10 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/SubmittedNotice.tsx:31 · The future-tense 'You'll receive your support goal at ...' line shows for every submitted questionnaire, even after the goal was sent or the training started. (code-review)
  • #11 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/SubmittedNotice.tsx:33 · The mailto link text is 'Email the MPD Team.' so the address never shows on the page, unlike DeadlineNotice which spells out mpdhelp@cru.org. (code-review)
  • #12 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/SubmittedNotice.tsx:46 · One sentence is built from two t() keys joined with a space, so translators cannot reorder or punctuate it for their language. (ux)
  • #17 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:41 · The extracted MissingInfoAlert has no focused test, and only the Financial Information link is clicked in existing tests. (code-review)
  • #18 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:67 · Extracting the alert only trims Summary's length; the submit, toast, redirect, and location-update logic still live in the component. (code-review)
  • #19 · 3/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:154 · The alert shows on !canSubmit but lists only steps that also have a Summary section, so an incomplete step with no section would show an empty list. (code-review)
  • #13 · 2/10 · src/components/HrTools/NsoMpdQuestionnaire/PersonalInformation/TrainingDates.test.tsx:7 · LoadedProbe is copied from DeadlineNotice.test.tsx. (code-review)
  • #20 · 2/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:42 · MissingInfoAlert's prop is named sections though it must receive only incomplete sections. (code-review)
  • #21 · 2/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:48 · MissingInfoAlert uses MUI Alert's default role=alert, so screen readers announce it on every load of an incomplete form. (code-review)
  • #22 · 2/10 · src/components/HrTools/NsoMpdQuestionnaire/Summary/Summary.tsx:83 · getIncompleteSteps runs on every render while the context already runs the same checks in a useMemo. (code-review)
🔧 Fix suggestions (0)

No automated fixes for this review.

📦 Dependency impact

Blast radius: 22 files. Highest impact: NsoMpdQuestionnaireTestWrapper.tsx (16 dependents), NsoMpdQuestionnaireLayout.tsx (4), Summary.tsx (2), VariantQuestions.tsx (1), Settings.tsx (1).

📊 Review detail & stats

Generated: 2026-11-30 · Day: Monday · Files changed this pass: 1 (+31 -17 lines); whole PR 18 files
Risk score: 36 · CRITICAL · Required reviewer: senior maintainer

Risk factors detected: HrTools paths (src/components/HrTools/), GraphQL operation change (/*.graphql)

Deterministic evidence:

  • AST/static rules: none
  • CI snapshot: CodeScene passes on f991f43 (Summary.tsx Large Method fixed by extracting MissingInfoAlert); codegen-dependent checks (eslint, typescript, tests, bundle-analyzer) still fail until trainingName and trainingStartDate reach the staging API (finding Tasks #1)
  • Cross-repo context: none

Agent summary (bands: Critical 9-10 · High 7-8 · Important 5-6 · Suggestions 3-4):

Agent Critical High Important Suggestions Confidence
Code Review (/code-review xhigh) 0 0 1 10 M
Security Review Agent 0 0 0 0 H
Data Integrity Review Agent 0 0 0 1 H
Testing & Quality Review Agent 0 0 0 0 M
Standards Compliance Review Agent 0 0 0 0 M
Financial Correctness Review Agent 0 0 0 0 M
API Contract Review Agent 0 0 1 0 M
UX & Accessibility Review Agent 0 0 0 2 M
Total 0 0 2 13 -

Engine: code-review (from config) · effort xhigh (from config) · model opus (from config)
/code-review findings: found 13 · scored 12 · dropped 1

  • public/locales/en/translation.json:9 new translation keys not in sorted slot: excluded path: public/locales/**

Review quality:

  • Average agent confidence: High · Consensus rate: 100% · Review time: 10 minutes
  • Findings suppressed by approved learnings: 0
💬 How to act on this review

Every finding above is numbered. Severity ≥ 7 findings carry a checkbox and must each be fixed or
dismissed
before this review counts as passed; lower severities are advisory. This repo runs
reviews locally only, so work this ledger with /agent-review:address in a Claude Code session.
It fixes or dismisses findings (a reason code and explanation are required for a dismissal) and
keeps this comment in sync. Valid codes: false-positive, intentional, pre-existing,
deferred, duplicate, insufficient-evidence, other.

github-actions[bot]
github-actions Bot previously approved these changes Nov 30, 2026

@github-actions github-actions Bot 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.

Auto-approved: the agent-review report for this head passes with no open blockers, and no repo rule or recorded check needs a person.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot dismissed their stale review November 30, 2026 18:48

agent-review: the bot took back its approval of 9fcbc60 because the PR's base branch is not the repo's default branch. Run /agent-review:re-review (or /agent-review:review) and post the report. The bot approves again when the report passes for the new head.

@github-actions github-actions Bot 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.

Auto-approved: the agent-review report for this head passes with no open blockers, and no repo rule or recorded check needs a person.

@jeff-clay jeff-clay added On Staging Will be merged to the staging branch by Github Actions Staging API Run GraphQL codegen against the staging API labels Nov 30, 2026

This branch has not been deployed

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

Labels

On Hold On Staging Will be merged to the staging branch by Github Actions Staging API Run GraphQL codegen against the staging API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant