Skip to content

[MPDX-9696] - Add MPD Goal Calculator Admin Table page skeleton#1872

Open
wjames111 wants to merge 5 commits into
mainfrom
MPDX-9696
Open

[MPDX-9696] - Add MPD Goal Calculator Admin Table page skeleton#1872
wjames111 wants to merge 5 commits into
mainfrom
MPDX-9696

Conversation

@wjames111

@wjames111 wjames111 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the MPD Goal Calculator – Admin Table page skeleton (scaffold + static UI) under HR Tools, built from the New Staff Goal Calculation Figma. It mirrors the existing MpdSupervisorReport page pattern (route → ReportPageWrapper → context provider → SidePanelsLayout → content + right drawer).

  • New route pages/accountLists/[accountListId]/hrTools/mpdGoalAdmin/index.page.tsx
  • New feature components under src/components/HrTools/MpdGoalAdmin/:
    • MpdGoalAdminContext — page state (active tab, selected cohort, search, row selection, drawer)
    • CohortBar — training-cohort selector + summary stats (Training Size, NSO Date, Training Cost)
    • GoalsTableToolbar — search + bulk-action buttons (Print All / Run & Send All ↔ More Actions / Run & Send Selected)
    • GoalsTable — paginated MUI table with the design's columns, status Chips, currency-formatted MPD goal, row selection, and an "Assign Coach" prompt for unassigned rows
    • StaffDetailDrawer — right-panel placeholder
    • MpdGoalAdmin — main content: sticky header, Active/Scenario tabs, client-side search filtering
    • mockData.ts / mpdGoalAdminHelpers.ts — typed mock cohort data + enums
  • HR Tools nav entry mpdGoalAdmin in src/hooks/useHrToolsNavItems.ts, gated by inMpdGoalCalcIneligibleGroup
  • i18n strings extracted to public/locales/en/translation.json

Intentionally out of scope (deferred): all GraphQL/data fetching (mock data only), real button actions (Print All, Run & Send, View/Edit training cost, row Actions menu, Assign Coach), Scenario Goals tab content, the full staff-detail drawer, and the Edit-Training-Cost / Assign-Coach / Batch-Send side flows. The bulk-action buttons and links are present but inert by design for this first pass.

Jira: MPDX-9696

Testing

  • Go to HR Tools → MPD Goal Calculator Admin Table (/accountLists/<id>/hrTools/mpdGoalAdmin)
  • Check the header reads "MPD Goal Calculator - Admin Table" and the Active Goals / Scenario Goals tabs switch (Scenario shows a placeholder)
  • Check the cohort selector shows "Fall NSO 2026" with Training Size / NSO Date / Training Cost stats
  • Check the table renders 5 staff rows with currency-formatted goals; the unassigned row shows "Assign Coach" and an "Incomplete" chip
  • Type in the Search box and confirm rows filter by name/email (and the table returns to page 1)
  • Select rows and confirm the toolbar swaps to "More Actions" / "Run & Send Selected"
  • Click a name and confirm the right-hand detail drawer opens; the close button dismisses it

Automated: yarn test src/components/HrTools/MpdGoalAdmin (21 passing), yarn lint:ts (clean).

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

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 5e57129

Route Size (gzipped) Diff
/accountLists/[accountListId]/hrTools/mpdGoalAdmin 133.83 KB added

@wjames111 wjames111 changed the title MPDX-9696 Add MPD Goal Calculator Admin Table page skeleton [MPDX-9696] - Add MPD Goal Calculator Admin Table page skeleton Jun 30, 2026

@wjames111 wjames111 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 — Verdict: ✅ APPROVED WITH SUGGESTIONS

6 specialized agents (Security, Architecture, Data Integrity, Testing, UX, Standards) + Financial Reporting domain agent + dependency analysis. No blockers. Clean, well-structured, fully-tested UI skeleton on mock data — highest finding severity is 6.5 (Medium).

Risk

Rubric score 10/10 (CRITICAL) is driven entirely by file count (10 new component/hook files) + volume. Genuine risk is LOW–MEDIUM: mock data only, no GraphQL/mutations/auth-logic/money-math wired, every component has a colocated test, and the one modified file (useHrToolsNavItems.ts) is purely additive (LOW dependency impact, no breaking changes, nav id → route confirmed consistent).

Medium-priority (worth fixing now — cheap, prevents latent bugs once real data lands)

  1. Selection set never pruned on search/cohort change — toolbar count can read "N selected" with nothing visible; clearSelection is wired to nothing. (Data Integrity + Testing + UX) — see inline comment.
  2. "Select all" header checkbox missing indeterminate state — partial selection looks like "none". (UX + Data + Testing) — see inline comment.
  3. Page-reset effect keys on rows.length, not filter identity — latent: an equal-length filter/cohort switch on a later page won't reset. (Architecture + 3 others) — see inline comment.

Suggestions (informational)

  • Brittle non-RTL test query (inline).
  • Inert interactive controls (Print All, Run and Send All, Assign Coach, View/Edit, MoreVert) have no handlers — expected for a skeleton; consider disabled+tooltip or a tracked follow-up so focusable controls don't read as broken.
  • Missing test branches: Incomplete status Chip, rows-per-page change, select-then-filter selection.
  • Consider a thin useMpdGoalCohorts() hook now so the eventual GraphQL swap is contained to one file.
  • Forward-looking for real-data wiring: hardcoded 'USD' + no currencyCode on StaffGoalRow; nullable goal should render "not set" not $0.00; drawer should become a focus-trapped Dialog/Drawer; stricter cross-staff admin authz on future queries.

Clean bills of health

  • Security: no secrets/env-exposure/XSS/redirects/GraphQL; blockImpersonatingNonDevelopers matches all 10 sibling HrTools pages.
  • Standards: full PASS — named exports (page export default is the required Next.js convention), i18n complete & extracted, no any/@ts-ignore/new Date()/console/TODO, tests colocated.
  • Financial: no calculation code — single display-boundary currencyFormat call, no arithmetic/aggregation/date math.

Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTableToolbar/GoalsTableToolbar.tsx Outdated
Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.tsx
Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.tsx
Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.test.tsx Outdated
@wjames111

Copy link
Copy Markdown
Contributor Author

@EJTison Here's the MPD Goal Calculator Admin Table page's basic skeleton, nothings wired in yet but this will probably be what we want to work off of. I'll try to merge it today but if not you can just branch off this.

@wjames111 wjames111 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 — Verdict: ✅ APPROVED WITH SUGGESTIONS

6 agents (Security · Architecture · Testing · UX · Standards · Financial Reporting) · Standard mode · consensus reached with no cross-agent challenges, so no debate round was needed.

This is a clean, unusually well-tested UI skeleton. All data is mock (mockData.ts), the whole feature is gated behind DISABLE_MPD_GOAL_ADMIN (404 via getServerSideProps + hidden nav item), and no data crosses a trust boundary. Access control, i18n, TypeScript, and MUI conventions match sibling HR Tools exactly.

Verdict rationale

0 blockers. No Critical/High/Important (≥7.0) findings. Everything below is Medium/Suggestion — informational, none block merge.

Risk

Mechanical score: 10/10 (CRITICAL) — inflated by file count (next.config.ts +3, ~10 medium component/page/hook files +10, 300+ non-test lines +3). Actual blast radius is LOW: isolated net-new feature, flagged to 404, mock data only, zero GraphQL/mutation/auth changes. Because the mechanical level is CRITICAL, the auto-approve workflow was intentionally not triggered — a 20-file / +1500-line PR merits a human glance regardless.

Highest-value items

  1. Page can go out of range from non-filter data changes — the reset effect keys on [search, selectedCohortId] but page slices rows; clamp on render instead (GoalsTable.tsx).
  2. Two untested feature-flag branchesgetServerSideProps notFound gate (index.page.tsx) and the nav-item hideItem (useHrToolsNavItems.ts).
  3. clearSelection never called after Run & Send — sent rows stay checked, inviting a duplicate send once wired (GoalsTableToolbar.tsx).
  4. Six inert skeleton controls (View/Edit, Assign Coach, MoreVert, More Actions, Print All) — focusable enabled buttons with no handler; wire or disabled before un-flagging.

All are latent (masked by mock data) rather than currently-breaking. No money arithmetic exists in this PR — sendableCount counts rows, not amounts.

Prior review

The 4 findings from the previous agent-review run (selection pruning, indeterminate checkbox, rows.length page-reset, brittle test query) have all been resolved in the current code. 👍

Summary

Agent Crit High Important Med/Sugg Confidence
Security 0 0 0 1 High
Architecture 0 0 0 5 High
Testing 0 0 0 6 High
UX 0 0 0 5 High
Standards 0 0 0 1 High
Financial 0 0 0 2 High

Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.tsx
Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.tsx
Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.tsx Outdated
Comment thread src/components/HrTools/MpdGoalAdmin/GoalsTable/GoalsTable.tsx
Comment thread src/components/HrTools/MpdGoalAdmin/RunAndSendModal/RunAndSendModal.tsx Outdated
Comment thread src/components/HrTools/MpdGoalAdmin/mockData.ts Outdated
Comment thread src/components/HrTools/MpdGoalAdmin/MpdGoalAdmin.test.tsx Outdated
Comment thread src/components/HrTools/MpdGoalAdmin/RunAndSendModal/RunAndSendModal.test.tsx Outdated
Comment thread public/locales/en/translation_old.json Outdated
@wjames111 wjames111 self-assigned this Jul 1, 2026
@wjames111 wjames111 added On Staging Will be merged to the staging branch by Github Actions Preview Environment Add this label to create an Amplify Preview labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

@wjames111 wjames111 requested a review from canac July 1, 2026 17:42
@wjames111

Copy link
Copy Markdown
Contributor Author

@canac do you mind giving this a once over? It should all be self contained, and it's really just a jumping off point/rough draft.

@wjames111 wjames111 force-pushed the MPDX-9696 branch 2 times, most recently from a020511 to df4c0ea Compare July 2, 2026 19:20
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.

1 participant