Skip to content

MPDX-10389 Show average lines on the Supervisor Report chart - #2310

Open
jeff-clay wants to merge 17 commits into
mainfrom
MPDX-10389-supervisor-chart-12mo-averages
Open

jeff-clay wants to merge 17 commits into
mainfrom
MPDX-10389-supervisor-chart-12mo-averages

Conversation

@jeff-clay

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

Copy link
Copy Markdown
Contributor

Links

  • Work item: https://jira.cru.org/browse/MPDX-10389
  • Spec: none (agreed with the requester on 11/19: two averages on the chart, each with its amount). Design changes from Joanna Catanus on the Jira ticket (11/30), with mockups.

Description

The Supervisor Report's Monthly Summary chart (a staff member's drawer > Monthly Summary > Chart view) shows average contributions and average expenses as two lines across the bars, with their amounts in a key above the chart.

Key and note (Joanna's design, 11/30):

  • One key row between the title and the chart: a bar swatch and "Contributions", a line swatch and "avg $5,104.55", the same for Expenses, a divider, then "Avg. difference +$245.46" (contributions average minus expenses average, signed). Amounts are 14px, weight 600. On a phone, each series gets its own row (name left, average right), then a divider and the difference row.
  • The difference uses the two averages rounded to cents, so the three numbers on screen add up.
  • A note under the key (13px, #757575) says which months the averages cover:
    • "Monthly averages for the last 11 full months (Dec 2025 – Oct 2026). November is still in progress."
    • For newer staff: "Monthly averages for the 4 full months on record (Jul – Oct 2026). November is still in progress." (singular for one month)
    • No full month yet: "Averages will show after your first full month."
    • No data at all: "No data available.", the same as the table view.

Chart:

  • Bar colors: Contributions #43A047 (MUI green[600]) and Expenses #B71C1C (MUI red[900]), added as chart-only theme colors chartContributions and chartExpenses. success and error are unchanged.
  • Average lines: Contributions #1B5E20 with long dashes (12px dash, 6px gap), Expenses #B71C1C with dots (3px, 4px gap). Both are 3px thick on a 1px white edge, so they read over their own bars and differ by more than color. The key swatches draw the same lines.
  • Months before a staff member's first activity have no bars (the API sends them as $0), their month names are gray (#9E9E9E), and the average lines start at the first recorded month.
  • Phone: the plot gets clamp(200px, 60vw, 280px) of height however the title and key wrap (about 225px at 390px, up from about 60px). The y-axis reads $6K, $4.5K (compact currency format), and the months are single letters.
  • Month labels are formatted from each month itself (short name, or one letter on a phone), so they work in every locale. Cutting the "Mon YYYY" label at the first space broke in Japanese, Korean, Vietnamese and Chinese.

How months count (unchanged from the earlier review):

  • The API always returns 12 rows ending on the current month, which is still in progress. That last row is left out, the same way the Dashboard's donation average ignores the current month (averageIgnoreCurrent). So an established staff member's averages cover the 11 finished months.
  • The API sends the months before a staff member joined as $0, not empty. The empty months at the start of the window (contributions and expenses both $0) are left out, so a new staff member's averages cover only the months since their first activity. A $0 month after that still counts. A null month (not synced) is left out of that average.

Code:

  • The Supervisor chart is now its own component, IncomeExpensesChart (with AverageKey.tsx and averageLines.tsx) in the Supervisor Report's MonthlySummary folder. Almost every item above is Supervisor-only, and the MPGA Income and Expenses report must stay unchanged, so the shared MPGA MonthlySummaryChart is back to main except that its tooltip moved to MonthlySummaryTooltip.tsx, which both charts use.
  • The Supervisor screen has no print view, so its chart drops the MPGA chart's print-only net labels. Nothing on screen changes from that.
  • chartData.ts holds the data mapping, the averages and the note (toChartData, monthlyAverages, averagesNote).
  • dateFormatMonthOnly in intlFormat.ts takes an optional 'narrow' month for the one-letter labels.
  • In theme.ts, the existing chart colors are now one line each, the same style the file uses for the Cru colors, so createTheme stays under CodeScene's size (209 lines, main 217). No values changed.
  • Strings: new note strings (one and other forms), "Avg. difference" and "Averages will show after your first full month."; "avg" and "No data available." already existed. The earlier {{name}} average and (last {{count}} full months) are gone.
  • This PR has the size-override label (about 1,300 changed lines, over half of them tests). Jeff chose that over splitting it.

Testing

  • Go to HR Tools > MPD Supervisor Report and open a staff member. On the Monthly Summary tab, click Chart view.
  • Check the key row above the chart: "Contributions" with a green square, a dark green dashed swatch and "avg $X"; "Expenses" with a red square, a red dotted swatch and "avg $Y"; then a divider and "Avg. difference" with a signed amount equal to X minus Y. X and Y should be the averages of the bars, leaving out the current month and any empty $0 months at the start.
  • Check the note under the key names the months covered and says the current month is still in progress.
  • Check the bars are green and dark red, and the two lines (long dashes and dots) cross the bars with a thin white edge.
  • For a staff member who joined during the last year: the months before they started have no bars and gray names, the lines start at their first month, and the note says "N full months on record".
  • Narrow the window to about 390px: each series is its own key row, the chart still has a usable height, the y-axis reads $6K-style amounts, and the months are single letters. Nothing overlaps and the page doesn't scroll sideways.
  • Open the MPGA Income and Expenses report and check its Monthly Summary chart is unchanged (old colors, legend inside the chart, no lines, no key).

Local QA (11/30): the local API was behind main's schema, so I stubbed only ManagedStaff and MonthlyPayrollSummary in the browser with a made-up staff member and ran the real frontend.

  • Established staff member: key reads "avg $5,104.55" (56,150 / 11), "avg $4,859.09" (53,450 / 11), "Avg. difference +$245.46"; note "Monthly averages for the last 11 full months (Dec 2025 – Oct 2026). November is still in progress." Matches Joanna's first mockup.
  • Staff member who started in July: "avg $5,187.50", "avg $4,875.00", "+$312.50", "4 full months on record (Jul – Oct 2026)", December to June gray with no bars, lines start at July. Hovering an empty month shows no tooltip; August shows its tooltip. Matches her second mockup.
  • 390x844: stacked key, plot about 225px tall, no sideways scroll, no console errors.
  • Before and after screenshots are in the comment "Joanna's design changes": desktop and phone, for both cases.
  • Jest: chartData.test.ts (averages, empty months before the first activity, the note in each case, no data, unnamed months), AverageKey.test.tsx (key text, 14px/600 amounts, signed and zero differences, swatch colors and patterns, note style, no averages), IncomeExpensesChart.test.tsx (bar colors, line patterns and white edge, no bars and gray names for empty months, lines start at the first recorded month, short and one-letter months, $6K axis on a phone, labels from the month not its text, no data), MonthlySummaryTooltip.test.tsx, MonthlySummary.test.tsx. Breaking each piece on purpose fails a test.

Staging QA

Design round, 11/30/2026 (5373155 on stage): partial. The new build is live and the empty state is right, but stage has no payroll data to check the averages with.

  • Stage has no monthly payroll data right now. Every Supervisor Report row checked shows "No data" for Jul to Oct 2026, and the Monthly Summary table is blank for every month. That held for all 4 of Tammy's staff and for 51 of Daniel Bisgrove's (a name search; the Healthy and Spending filters returned nobody). On 11/19 the same screens had data.
  • What could be checked passed: the Chart view shows the new key with only the bar swatches ("Contributions", "Expenses"), the note "Averages will show after your first full month.", all 12 month labels gray (#9E9E9E), no bars and no lines, and a 325px chart box at desktop width (the 280px plot plus the axis). That confirms 5373155's chart is what stage serves.
  • Not checked on stage: the averages and Avg. difference against the table, the line patterns, an established vs a newer staff member, and 390px (Jeff's Chrome window would not resize below desktop width). Local QA with made-up data covers these (see Testing and the screenshots comment). This needs a re-check once stage has payroll data again.
  • Tammy Doci (the requester), impersonated on stage: her nav has no HR Tools tab, and the Reports menu doesn't list the report, so she can only reach it by URL (/accountLists/<her list>/hrTools/mpdSupervisorReport). There she sees 4 staff rows (5 people), all with no data. Click path once there: click a staff member's name, then in the drawer's Monthly Summary tab click the chart icon next to "Income vs expenses · last 12 months". Her chart showed the empty state correctly. A "Is this your user group?" (Cru US Staff) dialog came up for her and was closed without answering.

Earlier runs, for history (all replaced by the design round):

  • 44ee033 (new-staff months): passed on stage on 11/19. Established staff "(last 11 full months)" matched the table to the cent; a staff member with $0 first months showed the shorter count and matching averages; 390px clean; MPGA unchanged.
  • b01019d (key row), 75470f3 (amounts in the legend) and 8902d3c (labels on the lines): each passed on stage on 11/19.

AI Review

Agent-review on this PR (/agent-review:review, code-review engine at xhigh plus the specialist lanes). Report, updated in place each round; finding numbers below match its ledger. Every ledger entry is now fixed or dismissed with a code (29 fixed, 39 dismissed, 0 open); the reasons are in the report.

Design round (11/30):

Dismissed findings worth knowing (all below 7):

Earlier rounds (11/19), for history:

  • Local rounds before the first push (fresh claude -p, /code-review high): 4 rounds; one must-fix (leave the current, partial month out of the averages).
  • Agent-review round 1 on 8902d3c: 0 blockers. Round 2 on 75470f3: 0 blockers. Round 3 (full review) on b01019d: 1 blocker, Bump @storybook/addon-knobs from 6.1.17 to 6.1.18 #13 (7/10): the API sends pre-join months as $0, so new staff averages came out too low; fixed in 44ee033. Round 4 on 44ee033: 0 blockers; bot approved 44ee033.

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 8 commits November 19, 2026 08:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 19, 2026
@jeff-clay

Copy link
Copy Markdown
Contributor Author

Before and after

Made-up staff member and amounts (local QA with stubbed data), not real people.

Supervisor Report > staff drawer > Monthly Summary > Chart view (desktop drawer width). The bars are unchanged. New: a dark green and a dark red dashed line for the contributions and expenses averages, each labelled with its amount, and one note above the chart.

Before (main) After (this PR)
Before: Monthly Summary chart with bars only After: the same chart with two dashed average lines and the note above it
No average lines, no note "Averages: last 11 full months" above the chart; "Contributions average: $5,104.55" and "Expenses average: $4,859.09" on the lines (56,150 / 11 and 53,450 / 11; the partial current month, Nov, is left out)

Same chart at phone width (390px). Both labels fit inside the chart. The chart is only about 110px tall here, so the top label sits close to the legend.

After at 390px: both labels fit inside the small chart

The MPGA Income and Expenses report's chart is unchanged (it doesn't pass averages).

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against c8a4738

No significant changes found

@jeff-clay

jeff-clay commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 agent-review · ✅ no blockers · risk CRITICAL
Advisory rollout · 7 agents run (Code Review (/code-review xhigh), Security Review Agent, Data Integrity Review Agent, Testing & Quality Review Agent, Standards Compliance Review Agent, Financial Correctness Review Agent, UX & Accessibility Review Agent) · incremental since 74c9caf

BLOCKERS: fix or dismiss to pass

✅ No blockers.

OTHER FINDINGS (67)

  • #39 · 6/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:54 · MonthTick takes the text before the first space of the localized 'Mon YYYY' label, so in ko and vi every desktop tick shows the same text, and in ja and zh-Hans-CN every phone tick shows '2'. The x-axis stops telling months apart in those supported locales. · ✅ fixed in 317ad01
  • #1 · 5/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.test.tsx:221 · The masked-amounts test checks for 'average' text only inside the chart region, but the legend with averages now renders above ChartFrame, outside that region. If masking stopped hiding the legend entries, the test would still pass. · ✅ fixed in b01019d
  • #14 · 5/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:47 · Only the current month is dropped, but last month can still hold a partial mid-month amount when the daily sync stops, and it is averaged as a full month. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: A stalled sync is an operations problem that also shows in the table.
  • #30 · 5/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:42 · isEmpty needs both fields to be zero, so months with contributions but $0 expenses before payroll starts stay in the expenses average and pull it far down. · 🚫 dismissed by @jeff-clay [intentional]: A month counts as active when contributions or expenses are above $0, per Jeff's first-activity rule.
  • #40 · 5/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:67 · The new ChartTooltip (returns null for months before the staff member started, otherwise renders MonthlySummaryTooltip) has no test. The shared MonthlySummaryTooltip, extracted from MPGA and now used by two charts, also has no colocated test. · ✅ fixed in 317ad01
  • #2 · 4/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/averageReferenceLines.tsx:48 · With the on-line labels removed, both average lines use the same 6 4 dash and differ only by red vs green. Colorblind users cannot tell which line is contributions and which is expenses. · ✅ fixed in 74c9caf
  • #3 · 4/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.tsx:203 · With the legend moved above the chart, the plot top is only margin.top 15, so the print-only net label over a bar that reaches the top tick can be clipped. · ✅ fixed in 74c9caf
  • #15 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:44 · The averages are rebuilt in the frontend from guesses about the API's rows, while the API knows the first payroll month and the current month. · 🚫 dismissed by @jeff-clay [deferred]: Server-side averages or a first payroll month from the API is a two-repo change; the web rule covers the found case.
  • #16 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.tsx:129 · The note is hardcoded as '(last 11 full months)', but monthlyAverages skips null months and the window may hold fewer rows (new staff). The key then claims 11 months were averaged when fewer were. · ✅ fixed in 44ee033
  • #31 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:53 · The first active month is kept even though a join month is often partial, so new-staff averages are pulled down and still labeled full months. · 🚫 dismissed by @jeff-clay [intentional]: Guessing which month was partial would trade one guess for another.
  • #32 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:58 · months counts every row after the first active month, but average() skips null rows per field, so the note can claim more months than an average used. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: Mid-window null months are rare.
  • #41 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:124 · The left margin dropped from 20 (old chart) to 0 while YAxis keeps its 60px default width, so wide dollar tick labels such as '$100,000' can be clipped at the SVG's left edge. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: Monthly staff contributions and expenses stay well under $100,000; not seen with real-shaped data.
  • #42 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.tsx:124 · When the API returns no rows, the chart says 'Averages will show after your first full month.' while the table view says 'No data available.', which wrongly implies a new staff member. · ✅ fixed in 317ad01
  • #43 · 4/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryTooltip.tsx:54 · MonthlySummaryTooltip is now shared by the HrTools supervisor chart but lives in the MPGA report tree, and its hard-coded success/error net colors do not match the new bar colors. · 🚫 dismissed by @jeff-clay [intentional]: Extracted in place from the MPGA chart; net text keeps success/error like the table for text contrast.
  • #59 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.test.tsx:234 · The unnamed-month test never checks that the first tick is blank, so a fallback to the 'Label 2025-12' text would still pass. · 🚫 dismissed by @jeff-clay [deferred]: Small test tightening; next change to this file.
  • #60 · 4/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:62 · MonthTick parses isoMonth in Luxon's default zone, then dateFormatMonthOnly formats the JS Date with Intl in the engine zone, so a non-UTC Settings.defaultZone would show the previous month. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: The app never sets Settings.defaultZone; parse and format both use the browser zone.
  • #4 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.tsx:123 · The 'Averages: last 11 full months' note shows whenever hasData is true, even when there are no averages to show (one API row). · ✅ fixed in b01019d
  • #5 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/averageReferenceLines.tsx:41 · Equal averages now draw one dashed line exactly on top of the other, so one average vanishes from the plot. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: The lines now differ in pattern (dashes vs dots), so equal averages still show both; needs equal amounts to the cent.
  • #6 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/averageReferenceLines.tsx:71 · chartLegend also builds the bar legend entries, adding a barColors param and tuple type, inside a file named averageReferenceLines.tsx. · ✅ fixed in b01019d
  • #7 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.test.tsx:160 · The legend-above test only checks the list is not inside .recharts-wrapper, so a legend rendered below the chart would also pass. · ✅ fixed in 74c9caf
  • #8 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.tsx:109 · The above-chart legend renders outside ChartFrame, so it shows average amounts while the frame shows a loading spinner. · ✅ fixed in 74c9caf
  • #9 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.tsx:203 · The legend has two render paths switched by whether averages exist, which changes plot layout per state instead of fixing placement once. · ✅ fixed in 74c9caf
  • #17 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.test.ts:29 · monthlyAverages has no test for an empty list or a single row, where slice(0, -1) leaves no finished months. · ✅ fixed in 44ee033
  • #18 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:32 · A new average helper duplicates the average in filterFunds.ts and lodash mean. · 🚫 dismissed by @jeff-clay [intentional]: This average returns undefined for no amounts (no line); filterFunds and lodash mean return 0 or NaN.
  • #19 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/AverageKey.tsx:18 · The head commit replaced the reviewed legend design with a key row, but the PR description and QA notes still describe the old design. · 🚫 dismissed by @jeff-clay [other]: PR description rewritten on 11/30 for the design round.
  • #20 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/AverageKey.tsx:28 · The key row has no rowSpacing and the bar legend ul outside Recharts keeps default margins, so wrapping at phone width may look cramped or uneven. · ✅ fixed in 74c9caf
  • #21 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/AverageKey.tsx:139 · The swatch svg uses style={{ marginRight: 8 }}, which bypasses the theme spacing the repo requires via sx. · ✅ fixed in 74c9caf
  • #22 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/averageReferenceLines.tsx:4 · averageReferenceLines imports MonthlySummaryAverages from MonthlySummaryChart, which imports it back, making a cycle that only works because the type import is erased. · 🚫 dismissed by @jeff-clay [intentional]: Type-only import between the chart and its helper file; the type belongs with the chart props.
  • #23 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.test.tsx:139 · The test named 'between the key and the chart' never checks that the legend comes before the chart, so a legend moved below the chart would still pass. · ✅ fixed in 74c9caf
  • #24 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.test.tsx:172 · The key test finds the amount through .parentElement of the bold label, which ties the test to DOM nesting instead of an accessible name. · ✅ fixed in 74c9caf
  • #25 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.test.tsx:207 · The reference line tests count lines and check dash style but never check each line's y value, so a line drawn at the wrong average would still pass. · ✅ fixed in 74c9caf
  • #26 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.tsx:93 · The shared chart now has two legend paths chosen by whether averages exist, so legend changes must be made and tested twice. · ✅ fixed in 74c9caf
  • #27 · 3/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.tsx:129 · With averages, the in-chart Legend is gone, so the print-only net label over the tallest bar has only the 15px top margin and may clip. · ✅ fixed in 74c9caf
  • #33 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:54 · Only leading empty months are trimmed, so trailing $0 months (leave, departure) still count toward the averages. · 🚫 dismissed by @jeff-clay [intentional]: $0 months after someone starts (leave, departure) are real months and count.
  • #34 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.test.tsx:253 · The new plural note has a singular form ('(last full month)') but no test renders a count of 1, so the _one translation key and its pluralization are unexercised. · ✅ fixed in 74c9caf
  • #35 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.tsx:133 · No test renders the singular note, and test i18n falls back to keys, so a bad _one translation would pass CI. · ✅ fixed in 74c9caf
  • #44 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.test.ts:5 · toChartData has no case for an unnamed or invalid month, though the code has a separate branch returning an empty label (averagesNote has one). · ✅ fixed in 317ad01
  • #45 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:35 · Leading months with $0 contributions and $0 expenses are now grayed out with no bars or tooltip, on the guess that they are before the staff member joined. Real $0 months at the start of the window would be shown as pre-join. · 🚫 dismissed by @jeff-clay [intentional]: The API sends pre-join months as $0, so leading empty months are treated as before the start (Jeff's rule).
  • #46 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:89 · The month-range text builds a bespoke Intl.DateTimeFormat, which the repo checklist forbids in favor of src/lib/intlFormat.ts. · 🚫 dismissed by @jeff-clay [deferred]: A month-range helper in intlFormat.ts can come with its second user.
  • #47 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:104 · The empty-state note says 'your first full month', but the reader is a supervisor looking at another staff member's data. · 🚫 dismissed by @jeff-clay [intentional]: Joanna's specified wording.
  • #48 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:115 · If the API sends null month strings, the note reads '... full months (). is still in progress.', and a new test locks that output in. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: The API always names the month; the guard only keeps the page from crashing.
  • #49 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:115 · The note always says the last row's month 'is still in progress', even when the API's last row is an earlier, finished month. · 🚫 dismissed by @jeff-clay [false-positive]: The API's last row is always the current month (PayrollHistory#payroll_by_month runs through today's month end).
  • #50 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/AverageKey.tsx:52 · Avg. difference subtracts averages that can cover different months when one field is null in some months, and the note's count includes those months. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: Needs a null month mid-window in one field only; rare.
  • #51 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/AverageKey.tsx:55 · averageDifference rounds with Math.round(x * 100), which disagrees with Intl's rounding of the shown averages on some half-cent values, so the difference can be a cent off from the two amounts shown. · 🚫 dismissed by @jeff-clay [insufficient-evidence]: Needs a half-cent average that floats below .5; not seen.
  • #52 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:38 · Month tick labels for pre-join months use grey[500] (#9E9E9E, about 2.7:1 on white), below the 4.5:1 text minimum. · 🚫 dismissed by @jeff-clay [intentional]: #9E9E9E is Joanna's spec for months with no data.
  • #53 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:57 · Pre-join month labels use grey[500] (#9e9e9e) on white, about 2.7:1 contrast, below the WCAG AA 4.5:1 minimum for small text. · 🚫 dismissed by @jeff-clay [duplicate]: Same as Mpdx 6975 add tag chips to contact detail tab #52.
  • #54 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:108 · formatAxisAmount hardcodes 'USD' for the axis while the key and tooltip use useFormatters().formatCurrency, so the two could disagree if the staff currency differs. · 🚫 dismissed by @jeff-clay [intentional]: The Supervisor Report is USD only; useFormatters also uses USD.
  • #61 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:35 · isoMonth keeps the raw API string even when it does not parse, unlike the type comment's 'or empty', and no toChartData test covers a null or invalid month. · 🚫 dismissed by @jeff-clay [intentional]: MonthTick blanks an isoMonth that does not parse; toChartData has a null-month test.
  • #62 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.test.tsx:218 · The new month-tick tests never set a non-UTC Settings.defaultZone, which the repo testing rule asks date tests to do. · 🚫 dismissed by @jeff-clay [deferred]: Add a non-UTC zone case with the next change to these tests.
  • #63 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:27 · Each chart row now stores the month twice, as a formatted label and as isoMonth, and every builder must keep them in step. · 🚫 dismissed by @jeff-clay [intentional]: The label feeds the tooltip; the ISO month feeds locale-correct axis labels.
  • #64 · 3/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.test.tsx:266 · The ar-EG case sets Settings.defaultLocale, which production never does, and Luxon toFormat falls back to en-US without it, so the test and the MonthlySummary.tsx comment name a cause real browsers do not hit. · 🚫 dismissed by @jeff-clay [false-positive]: Luxon's default locale is the browser's locale, so an ar-EG browser writes Arabic digits without any setting; the test sets it to stand in for that.
  • #65 · 3/10 · src/lib/intlFormat.ts:202 · dateFormatMonthOnly gained a month-width param, but the monthly chart ticks now depend on Intl in the browser locale only through this helper; no direct unit test covers the 'narrow' option. · 🚫 dismissed by @jeff-clay [deferred]: intlFormat.test.ts is already over CodeScene's 300-line limit; the narrow option is covered by the chart's phone test.
  • #66 · 3/10 · src/theme.ts:277 · The chart palette entries are collapsed from multi-line to one-line objects, which is unrelated to the ticket and adds diff noise. · 🚫 dismissed by @jeff-clay [intentional]: Needed to keep createTheme under CodeScene's Large Method limit after adding the two chart colors (209 lines, main 217).
  • #10 · 2/10 · Reports/MPGAIncomeExpensesReport/Charts/ChartLegendContent/ChartLegendContent.tsx:30 · The new decorative svg swatch lacks aria-hidden, so some screen readers may announce an unnamed graphic before each average item. · ✅ fixed in b01019d
  • #11 · 2/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/averageReferenceLines.tsx:56 · averageSeries runs twice per render, once for the legend and once for the lines. · ✅ fixed in b01019d
  • #12 · 2/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/MonthlySummaryChart.tsx:109 · The above legend centers on the full Box while ChartFrame is width% wide and left aligned, so for width below 100 it is off center. · ✅ fixed in 74c9caf
  • #28 · 2/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/AverageKey.tsx:24 · AverageKey takes a legend prop only to render the bar legend, so the averages key also owns the bar legend. · ✅ fixed in 74c9caf
  • #29 · 2/10 · Reports/MPGAIncomeExpensesReport/Charts/MonthlySummaryChart/averageReferenceLines.tsx:23 · averageSeries takes the whole t function just to translate 'Expenses', which the chart already translates. · 🚫 dismissed by @jeff-clay [intentional]: averageSeries translates both series names, so it takes t.
  • #36 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:30 · The average() comment says a reported $0 counts, while leading $0 months are now dropped earlier in monthlyAverages. · 🚫 dismissed by @jeff-clay [intentional]: That comment is about null months; the leading $0 rule is documented on averagedMonths.
  • #37 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:51 · The return type mixes a months count into the averages object and reuses the name months for both input and output. · ✅ fixed in 74c9caf
  • #38 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.tsx:85 · monthlyAverages now runs on every render, including Table view, without memoization. · 🚫 dismissed by @jeff-clay [intentional]: 12 rows per render; no memo needed.
  • #55 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.test.ts:5 · The test re-registers the English i18n bundle with a six-level relative import, duplicating shared test setup. · 🚫 dismissed by @jeff-clay [intentional]: A plain .ts test without the render wrapper, registering the bundle the same way testingLibraryReactMock does.
  • #56 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:89 · formatMonths calls formatRange(start, start) for a single month, and MonthTick gets the whole data array only to check a leading-prefix condition. · 🚫 dismissed by @jeff-clay [intentional]: formatRange(start, start) gives one month in the locale's own style; MonthTick needs the row to gray it.
  • #57 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:134 · Hovering a grayed pre-join month draws the Tooltip cursor band but no tooltip, which looks like something should show. · 🚫 dismissed by @jeff-clay [deferred]: Cosmetic; the cursor band on empty months can go with a later chart change.
  • #58 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/MonthlySummary.tsx:123 · monthlyAverages and averagesNote each run averagedMonths on every render without useMemo, and formatAxisAmount builds a new Intl.NumberFormat per tick. · 🚫 dismissed by @jeff-clay [intentional]: 12 rows per render; no memo needed.
  • #67 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/chartData.ts:97 · averagesNote's doc comment and the note prop comments still say it names the months the averages cover, but it can now return 'No data available.' · 🚫 dismissed by @jeff-clay [deferred]: Comment wording; next change to chartData.ts.
  • #68 · 2/10 · HrTools/MpdSupervisorReport/StaffDetailsTabs/MonthlySummary/IncomeExpensesChart/IncomeExpensesChart.tsx:68 · dateFormatMonthOnly builds a new Intl.DateTimeFormat for each of the 12 ticks on every render. · 🚫 dismissed by @jeff-clay [intentional]: 12 ticks; not worth caching.
🔧 Fix suggestions (0)

No automated fixes for this review.

📦 Dependency impact

Blast radius: 200 files (traversal truncated). Top impacted changed files: src/theme.ts (one-line formatting of existing chart colors, no value changes), src/lib/intlFormat.ts (dateFormatMonthOnly gains an optional third argument; existing callers unchanged), MonthlySummary.tsx. No breaking changes reported.

📊 Review detail & stats

Generated: 2026-11-30T23:03:50.189Z · Day: Monday · Files changed: 9 in this pass (0365fbe, 317ad01, 5373155)
Risk score: 31 (full PR) · CRITICAL · Required reviewer: senior maintainer

Risk factors detected: path score from the HR Tools and Reports folders, src/theme.ts and src/lib/intlFormat.ts; no special patterns, no unmatched paths.

Deterministic evidence:

  • AST/static rules: none
  • CI snapshot: not captured in this local run
  • 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 0 8 H
Security Review Agent 0 0 0 0 H
Data Integrity Review Agent 0 0 0 0 H
Testing & Quality Review Agent 0 0 0 1 M
Standards Compliance Review Agent 0 0 0 2 M
Financial Correctness Review Agent 0 0 0 0 H
UX & Accessibility Review Agent 0 0 0 0 H
Total 0 0 0 11 -

(One pair merged in consensus, so the ledger adds 10 new entries, #59 to #68.)

Engine: code-review (from config) · effort xhigh (from config) · model opus (from config)
/code-review findings: found 8 · scored 8 · dropped 0

Notes:

  • An earlier pass over 74c9caf..317ad01 was not posted: its one blocker (7/10, the no-data chart built its months with Luxon toFormat('yyyy-MM'), which writes Arabic, Burmese or Persian digits in those locales, so every month label went blank) was fixed in 5373155 before posting.

Review quality:

  • Ledger matcher: 0 of 9 reworded pairs matched
  • 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 19, 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.

@jeff-clay jeff-clay added the On Staging Will be merged to the staging branch by Github Actions label Nov 19, 2026
jeff-clay and others added 2 commits November 19, 2026 12:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions
github-actions Bot dismissed their stale review November 19, 2026 20:39

agent-review: the bot took back its approval of 8902d3c because the PR changed beyond merging in the 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.

@jeff-clay

Copy link
Copy Markdown
Contributor Author

Legend fix (ae6de5c, 75470f3): before / after

Supervisor Report > staff member > Monthly Summary > Chart view. Made-up staff member and made-up amounts, run locally.

What changed: the average amounts moved off the dashed lines and into the legend, with dashed swatches in the lines' colors. The lines stay, with no text. With averages shown, the legend sits above the chart, so it can wrap without covering the bars or the top y-axis label. The MPGA report chart is unchanged.

Before (8902d3c) After (75470f3)
Desktop drawer (728px chart) before-desktop after-desktop
Phone, 390px wide (shown at 2x) before-phone after-phone

Before: "Contributions average: $X" and "Expenses average: $X" were printed on the lines. On a phone they ran over the bars and into the legend, and the legend touched the "$6,000" label.
After: the legend reads "Contributions", "Expenses", "- - Contributions average: $X", "- - Expenses average: $X". On a phone it wraps to three lines above the chart and nothing overlaps.

github-actions[bot]
github-actions Bot previously approved these changes Nov 19, 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.

@github-actions
github-actions Bot dismissed their stale review November 19, 2026 21:37

agent-review: the bot took back its approval of cd48f71 because the PR changed beyond merging in the 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.

@jeff-clay

Copy link
Copy Markdown
Contributor Author

Key row like the Dashboard (b01019d): before / after

Supervisor Report > staff member > Monthly Summary > Chart view. Made-up staff member and made-up amounts, run locally.

What changed: the two averages moved out of the legend into their own key row above the chart, styled like the Dashboard's Monthly Giving key: a dashed swatch, the name in bold, then the amount, then "(last 11 full months)" in gray on the same row. The separate gray "Averages: last 11 full months" line is gone. The legend lists only Contributions and Expenses again. The dashed lines on the chart are unchanged. The MPGA report chart is unchanged.

Before (75470f3) After (b01019d)
Desktop drawer (728px chart) before-desktop after-desktop
Phone, 390px wide (shown at 2x) before-phone after-phone

Before: one legend line read "Contributions", "Expenses", "- - Contributions average: $X", "- - Expenses average: $X", with a gray "Averages: last 11 full months" line above it.
After: a key row reads "- - Contributions average $X - - Expenses average $X (last 11 full months)", and the legend below it reads "Contributions", "Expenses". On a phone the key wraps to one item per line, and nothing overlaps the chart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions[bot]
github-actions Bot previously approved these changes Nov 19, 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.

github-actions[bot]
github-actions Bot previously approved these changes Nov 19, 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 stale reviews from themself November 30, 2026 22:11

agent-review: the bot took back its approval of 44ee033 because the PR changed beyond merging in the 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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeff-clay jeff-clay added the size-override Lets a PR over pr-guard's line limit pass (CruGlobal/.github pr-guard default) label Nov 30, 2026
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 22:40

agent-review: the bot took back its approval of 74c9caf because the PR changed beyond merging in the 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.

@jeff-clay

Copy link
Copy Markdown
Contributor Author

Joanna's design changes (74c9caf, 0365fbe, 317ad01): before / after

Supervisor Report > staff member > Monthly Summary > Chart view. Made-up staff member and amounts (local QA with stubbed data), not real people. Before is 44ee033, the version on stage when Joanna reviewed it.

1. Desktop, established staff member (11 full months). One key row now: bar swatch and name, line swatch and "avg" amount, a divider, then "Avg. difference +$245.46". The note moved under the key. New bar colors (green #43A047, red #B71C1C). Long dashes for contributions and dots for expenses, each 3px on a white edge.

Before After
Before, desktop, 11 months: bold average labels and a separate legend After, desktop, 11 months: one key row with avg amounts and Avg. difference

Note text: "(last 11 full months)" became "Monthly averages for the last 11 full months (Dec 2025 – Oct 2026). November is still in progress."

2. Desktop, newer staff member (started in July). Months before the first activity have no bars (before: $0 bars), their names are gray, and the average lines start at July.

Before After
Before, desktop, July start: empty months shown as zero bars After, desktop, July start: gray empty months, lines start at July

Note text: "(last 4 full months)" became "Monthly averages for the 4 full months on record (Jul – Oct 2026). November is still in progress."

3. Phone (390px), established staff member. The plot was about 60px tall; it now gets about 225px however the key wraps. Each series gets its own key row (name left, average right). Y-axis reads $6K, $4.5K and so on, and months are single letters.

Before After
Before, phone, 11 months: squeezed plot After, phone, 11 months: stacked key and taller plot

4. Phone (390px), newer staff member. Same phone layout, with the gray empty months and lines starting at July.

Before After
Before, phone, July start After, phone, July start

The after shots are from fa38c6c1f. The later commits don't change these screens in English: 0365fbe only reformats theme.ts, and 317ad01 formats the month letters from the month itself (same output in English, fixes Japanese, Korean, Vietnamese and Chinese) and shows "No data available." when there is no data at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

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

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 Staging Will be merged to the staging branch by Github Actions size-override Lets a PR over pr-guard's line limit pass (CruGlobal/.github pr-guard default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant