pelagia-portal/App/app/(portal)
Hardik 34143b5e75
Some checks failed
PR checks / checks (pull_request) Failing after 15s
PR checks / integration (pull_request) Successful in 41s
fix(reports): chart series all rendered one colour (RSC boundary bug)
The comparison charts (and detail-page breakdown swatches) rendered every
series in recharts' default colour instead of the per-item palette.

Root cause: `SERIES_COLORS` was defined in `components/reports/charts.tsx`,
which is a "use client" module. The report **pages are server components** and
imported the palette from it. A plain value imported from a client module into
a server component is a client-reference proxy, not the real array — so
`SERIES_COLORS[i % SERIES_COLORS.length]` was `SERIES_COLORS[NaN]` → undefined,
every line got `stroke={undefined}`, and recharts fell back to #3182bd. (The
literal `strokeWidth={2}` still applied, which is why only the colour was wrong.
It passed jsdom tests because those import the array directly, not across the
RSC boundary.)

Fix: move the palette to a dependency-free shared module `lib/report-colors.ts`
(no "use client", no server-only imports) that resolves to the real array in
both server and client graphs. `charts.tsx` and all four report pages import it
from there. It can't live in `lib/reports.ts` (that imports Prisma `db`, which
must not enter the client bundle).

Verified in a real browser: line strokes now cycle the 10-colour palette
(#2563eb, #16a34a, …) instead of a uniform #3182bd.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 12:31:40 +05:30
..
admin fix(vendors): move GSTIN CAPTCHA into a popup 2026-06-24 06:37:29 +05:30
approvals Merge pull request 'fix: On new PO screen Vendors should have search' (#110) from claude/issue-109 into master 2026-06-23 23:52:47 +00:00
catalogue refactor(routes): move /inventory/{items,vendors} → /catalogue/{items,vendors} 2026-06-24 05:04:29 +05:30
crewing fix(crewing): make rank-held universal, ex-hand an admin-only flag 2026-06-23 21:33:50 +05:30
dashboard feat(dashboard): compact INR formatting for Total Approved Spend card 2026-06-21 02:02:41 +05:30
history feat(history): paginate PO history with items-per-page control 2026-06-24 03:26:47 +05:30
inventory/cart refactor(routes): move /inventory/{items,vendors} → /catalogue/{items,vendors} 2026-06-24 05:04:29 +05:30
my-orders fix(my-orders): correct closed PO filters for manager and submitter 2026-06-19 03:34:21 +05:30
payments feat(po): register line items in the product catalogue on approval 2026-06-24 04:59:47 +05:30
po feat(po): prompt to save as draft when leaving with unsaved changes 2026-06-24 06:37:33 +05:30
profile feat(crewing): foundations — SITE_STAFF role, ranks reference data + admin (flagged) 2026-06-22 13:26:04 +05:30
reports fix(reports): chart series all rendered one colour (RSC boundary bug) 2026-06-24 12:31:40 +05:30
layout.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30