refactor: audit-driven surgical cleanup (dead code, React keys, CI, security headers)#233
Merged
jinglescode merged 8 commits intomainfrom May 1, 2026
Merged
Conversation
- Delete src/components/ui/chart.tsx (recharts wrapper, zero consumers) - Remove recharts from dependencies - Remove busboy and @types/busboy (formidable is the actual uploader) - Move swagger-ui CSS imports out of _app.tsx into api-docs.tsx
Replaces array index with signer address (which is unique and stable across reorder/edit) on both desktop TableRow and mobile card view, preventing form-state misalignment when signers are removed or reordered.
- Add .github/workflows/pr-checks.yml (lint/typecheck/test/build, continue-on-error initially) - Add basic security headers in next.config.js (X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy). CSP and HSTS intentionally omitted. - Add comment to src/env.js explaining why NextAuth env vars are commented (PrismaAdapter only, no providers configured)
Used by .github/workflows/pr-checks.yml and developer workflow. - typecheck: tsc --noEmit - format: prettier --write . - format:check: prettier --check .
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… at root) Reverts only the swagger-overrides.css move from commit 4abe300. The swagger-ui-react/swagger-ui.css import (from node_modules) remains local to api-docs.tsx, so the original goal of keeping that bundle out of every page is still achieved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit-driven, behavior-preserving refactor across three streams. No behavior changes, no API changes, no logic changes. All 14 acceptance criteria independently verified by parallel QA agents against
main.Stream A — Dead code & bundle
src/components/ui/chart.tsx(368 lines, 0 consumers)recharts(saves ~45 KB),busboy,@types/busboyfrompackage.json(0 consumers each —formidableis the actually-used uploader)swagger-ui-react/swagger-ui.cssimport (was loaded in both_app.tsxandapi-docs.tsx; now onlyapi-docs.tsx)Stream B — React stable key
ReviewSignersCard.tsx:key={index}→key={signer}at both render sites (desktopTableRowL266 + mobile card view L377). Avoids stale state when signers are reordered/removed during wallet creation.Stream C — DX, CI, security
typecheck/format/format:check.github/workflows/pr-checks.yml— install / typecheck / lint / test / build (currently advisory:continue-on-error: trueon each step until baseline is cleaned, matching today's main behavior)next.config.js—X-Frame-Options=SAMEORIGIN,X-Content-Type-Options=nosniff,Referrer-Policy=strict-origin-when-cross-origin,Permissions-Policy=camera=(), microphone=(), geolocation=(). CSP and HSTS intentionally omitted to avoid breaking inline scripts/styles + premature HTTPS lock-in.src/env.jsdocumenting whyNEXTAUTH_SECRET/NEXTAUTH_URL/DISCORD_*env vars are commented (PrismaAdapter only, no providers configured yet).Parity verification (vs
main)The pre-existing build failure on
/wallets/[wallet]/transactions/newis the documented Next.js 16_document HtmlSSG bundling issue (see commit f1b4964). Reproduced onmainwith this branch's source reverted — not a regression from this PR.Deferred (separate efforts)
High-risk items intentionally not in this PR — each needs a dedicated regression test plan:
anycasts cleanupballot.tsx1728L,new-transaction1480L)z.any()→ strict schemas in routers/api/discord/send-messageauth gateSameSite=Lax→Strict(would break email-link login)react-hooks+jsx-a11ypluginsTest plan
npm run typecheckreturns 20 errors (matches main baseline)npm run test:cireturns 17 failed / 129 passed (matches main baseline)/api-docs) — confirm Swagger UI styling intactcurl -Iagainst deployed preview🤖 Generated with Claude Code