fix: repair Next.js 16 build on main and add review suggestions#2
Merged
Conversation
- 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
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
PR #1 merged only the first commit, which left
mainwith a broken build (the current CI failure). This brings the remaining verified commits ontomain.Build fixes (
maincurrently fails CI without these)middleware.tsintoproxy.ts; Next.js 16 forbids both files coexisting — this is the exact CI error onmain.components/ui/button.tsxprimitive thatOnboarding.tsximports but was never created.package-lock.jsonversion withpackage.json(0.4.0).setState-in-effect inOnboarding.tsxwithuseSyncExternalStore— SSR-safe (no hydration mismatch) and lint-clean.Feature: Smart Review Suggestions
/api/insights/review-suggestionsroute andReviewerSuggestionsdashboard widget.lib/integrations/activityMetadata.tshelpers, also adopted by the existing PR review-context route to remove duplication.Verification
npm run buildpasses;tsc --noEmitclean;npm run lintreports 0 errors.https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK
Generated by Claude Code