Clean up plaintiff workflow and footer UI#47
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📝 WalkthroughWalkthroughRenames and copy updates shift product language to “Plaintiffs” and reference the class action “Humanity v. Government.” UI components, pages, and site footer/config were updated (text, small behavior tweaks, sorting, responsive footer rendering). A new "Mike UI Complaint Checklist" was added to AGENTS.md. No public API function signatures were added or removed. ChangesPlaintiffs / Represented People UI
Footer, Site Config, and Exports
Documentation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
packages/web/src/components/Footer.tsx (1)
26-30: 💤 Low valueUse
replaceAllso multiple{year}placeholders all substitute.
String.prototype.replacewith a literal string replaces only the first match. No current config uses{year}more than once, butreplaceAllis the same cost and avoids a future footgun (e.g. "© {year} … rev. {year}").♻️ Proposed change
const bottomText = config.bottomText.trim().length > 0 - ? config.bottomText.replace("{year}", String(year)) + ? config.bottomText.replaceAll("{year}", String(year)) : `© ${year} ${site.organizationName}.`;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/web/src/components/Footer.tsx` around lines 26 - 30, The bottomText construction uses config.bottomText.replace("{year}", String(year)) which only replaces the first occurrence; change it to use replaceAll (i.e., config.bottomText.replaceAll("{year}", String(year))) so every "{year}" token is substituted (refer to the bottomText constant, the year variable, and config.bottomText in Footer.tsx); ensure the runtime environment supports String.prototype.replaceAll or add a small fallback if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/web/src/app/people/`[id]/page.tsx:
- Around line 88-96: Extract the duplicated label logic into a single helper and
import it where needed: move the implementation of getRepresentedLifeStatusLabel
(the mapping for PersonLifeStatus -> string) into a new shared module (e.g.,
lib/represented-life-status.ts) and export it, remove the local copy in
packages/web/src/app/people/[id]/page.tsx and delete the identical
lifeStatusBadge logic from PersonFaceTile.tsx, then replace both usages to
import and call the shared getRepresentedLifeStatusLabel function (ensure you
import PersonLifeStatus enum where required).
In `@packages/web/src/components/people/PeopleFilterBar.tsx`:
- Around line 137-147: The details open state is currently tied to hasFilter,
causing the panel to collapse when Clear flips hasFilter to false; replace that
coupling by adding a local state (e.g., const [isOpen, setIsOpen] =
useState<boolean>(hasFilter)) and use {...(isOpen ? { open: true } : {})} on the
<details> element instead of hasFilter. Update the Clear handler (the function
that runs on the "Clear" click) so it clears filters but does not set isOpen to
false, and add a useEffect that sets setIsOpen(true) when hasFilter becomes true
(so applying a filter opens the panel). Ensure summary toggles still call
setIsOpen(!isOpen) (or rely on onToggle) so the user can open/close the panel
independently of hasFilter.
In `@packages/web/src/lib/represented-people.server.ts`:
- Around line 275-283: The "recent" ordering currently returns an orderBy that
uses person.image with a nulls: "last" option (case "recent" -> person.image),
which is unsupported in Prisma 7.x and causes P2009; fix it by removing the
nulls option or by moving the nullable field to a top-level order (e.g., order
by personId image presence or createdAt) so you do not traverse a relation with
nulls, and update the return for case "recent" (the block returning person: {
image: { sort: "desc", nulls: "last" } }, { createdAt: "desc" }) to instead use
a supported ordering expression without nulls or a different top-level scalar.
---
Nitpick comments:
In `@packages/web/src/components/Footer.tsx`:
- Around line 26-30: The bottomText construction uses
config.bottomText.replace("{year}", String(year)) which only replaces the first
occurrence; change it to use replaceAll (i.e.,
config.bottomText.replaceAll("{year}", String(year))) so every "{year}" token is
substituted (refer to the bottomText constant, the year variable, and
config.bottomText in Footer.tsx); ensure the runtime environment supports
String.prototype.replaceAll or add a small fallback if needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 82d71663-b7d5-487b-9d1f-5980f59ee667
📒 Files selected for processing (11)
packages/web/src/app/people/[id]/page.tsxpackages/web/src/app/people/manage/page.tsxpackages/web/src/app/people/page.tsxpackages/web/src/components/Footer.tsxpackages/web/src/components/people/ManageRepresentedPeopleClient.tsxpackages/web/src/components/people/PeopleFilterBar.tsxpackages/web/src/components/people/PersonFaceTile.tsxpackages/web/src/config/__tests__/site-variant-ui.test.tspackages/web/src/lib/represented-people.server.tspackages/web/src/lib/routes.tspackages/web/src/lib/site.ts
💤 Files with no reviewable changes (1)
- packages/web/src/config/tests/site-variant-ui.test.ts
✅ Files skipped from review due to trivial changes (1)
- packages/web/src/app/people/manage/page.tsx
Summary
/peopleconversion surface around plaintiffs and Humanity v. Government while keeping the public path stableVerification
pnpm --filter @optimitron/web run typecheck:fastpnpm --filter @optimitron/web exec vitest run src/config/__tests__/site-variant-ui.test.tspnpm --filter @optimitron/web exec prettier --check ...git diff --checkpackages/web/output/playwright/people-audit/review.htmlRoute note
I did not rename
/peopleto/plaintiffsin this PR./peopleis still the broader person/profile namespace; a later PR can add/plaintiffsas a focused conversion/gallery route once/peoplehas a true general directory.Summary by CodeRabbit
Documentation
UI / Content Updates
Profile & Evidence
Footer & Layout