Skip to content

fix: repair Next.js 16 build on main and add review suggestions#2

Merged
mackeh merged 4 commits into
mainfrom
claude/upbeat-brahmagupta-7gQHU
May 21, 2026
Merged

fix: repair Next.js 16 build on main and add review suggestions#2
mackeh merged 4 commits into
mainfrom
claude/upbeat-brahmagupta-7gQHU

Conversation

@mackeh

@mackeh mackeh commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

PR #1 merged only the first commit, which left main with a broken build (the current CI failure). This brings the remaining verified commits onto main.

Build fixes (main currently fails CI without these)

  • Merge the IP allowlist from middleware.ts into proxy.ts; Next.js 16 forbids both files coexisting — this is the exact CI error on main.
  • Add the missing components/ui/button.tsx primitive that Onboarding.tsx imports but was never created.
  • Parse the metadata JSON string in the code-quality insights route instead of casting a string to an object.
  • Sync package-lock.json version with package.json (0.4.0).
  • Replace setState-in-effect in Onboarding.tsx with useSyncExternalStore — SSR-safe (no hydration mismatch) and lint-clean.

Feature: Smart Review Suggestions

  • Ranks the teammates best placed to review a pull request by matching its changed files against captured activity history (direct edits weigh more than same-directory edits, recent work more than old, PR author excluded).
  • New /api/insights/review-suggestions route and ReviewerSuggestions dashboard widget.
  • Shared lib/integrations/activityMetadata.ts helpers, also adopted by the existing PR review-context route to remove duplication.

Verification

  • npm run build passes; tsc --noEmit clean; npm run lint reports 0 errors.
  • The new endpoint was tested end-to-end against a throwaway DB seeded with multi-user, PR-linked data — correct reviewer rankings, author exclusion, and directory-level matching all confirmed.

https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK


Generated by Claude Code

claude added 4 commits May 21, 2026 18:47
- Merge the IP allowlist check from middleware.ts into proxy.ts; Next.js
  16 forbids both files coexisting. Rate limiting now gates to /api/*,
  the IP check covers all routes.
- Add the missing components/ui/button.tsx primitive that Onboarding.tsx
  imported but was never created.
- code-quality insights route: parse the metadata JSON string instead of
  casting a string to an object.

https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK
The lockfile version field was left at 0.1.4 when the package was
bumped to 0.4.0.

https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK
The hydration fix reintroduced setState inside useEffect, which the
project's eslint config rejects. Switch to useSyncExternalStore so the
localStorage check stays off the server (no hydration mismatch) without
calling setState in an effect.

https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK
Ranks the teammates best placed to review a pull request by matching its
changed files against the team's captured activity history. Direct file
edits weigh more than edits elsewhere in the same directory, recent work
weighs more than old, and the PR author is excluded from their own review.

- lib/analytics/reviewers.ts: file-scoped reviewer ranking
- api/insights/review-suggestions: discovers PR changesets from activity
  metadata, or accepts an explicit ?files=/?author= changeset
- ReviewerSuggestions dashboard widget
- lib/integrations/activityMetadata.ts: shared metadata parsing helpers,
  now also consumed by the existing PR review-context route

https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK
@mackeh mackeh merged commit e605cf9 into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants