[add] pitch 2.0#382
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR condenses the pitch landing page content and removes animation/icon deps, updates the invest CTA wiring, and hardens PaymentFlow by requiring an access token and distinguishing auth-related order failures (redirect to login) from other failures (show alert). ChangesPitch Page & Payment Flow Refinement
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/web/src/components/payment/PaymentFlow.tsx (1)
163-168: Update accessToken redirect rationale + make auth error handling less brittle
session.accessTokenis populated via NextAuth callbacks (callbacks.jwtsetstoken.jwtToken, andcallbacks.sessionassignsaccessToken: token.jwtToken), so the redirect is not triggered for normal authenticated sessions—only whenjwtTokenends up missing/undefined (e.g., token generation failure).- The auth-error redirect relies on regex over
error.message, but the backend is throwingTRPCErrorwith specificcode/messagevalues (e.g.,UNAUTHORIZED: "Invalid or expired token"/"Missing or invalid authorization header"). Prefer detectingUNAUTHORIZEDvia the tRPC error code/shape instead of message parsing to avoid drift.🤖 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 `@apps/web/src/components/payment/PaymentFlow.tsx` around lines 163 - 168, The current redirect triggers when session.accessToken is missing but that should only happen for genuine token-generation failures, so keep the accessToken check (accessToken on session) but clarify in the code comment and only redirect when accessToken is falsy/empty (as implemented around accessToken, session, callbackUrl, router.push); additionally, stop relying on regex-ing error.message for auth failures and instead detect tRPC auth errors by checking the tRPC error shape (e.g., inspect the thrown error for error.data?.code === 'UNAUTHORIZED' or error.code === 'UNAUTHORIZED' in your payment/error-handling code) and use that branch to trigger the login redirect—replace the regex logic with these explicit checks.
🤖 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 `@apps/web/src/app/`(main)/(landing)/pitch/page.tsx:
- Around line 25-27: Several heading spans currently use an inline arbitrary
font-family utility (e.g., the span wrapping "opensox manifesto" with className
"font-semibold [font-family:Helvetica,Arial,sans-serif]") which bypasses the
design-system typography; replace the arbitrary utility with the design token
class (use "font-sans" or the appropriate token class from the design system)
while keeping other utilities like "font-semibold" intact. Update the same
pattern at the other occurrences called out in the review (the spans at the
other listed locations) so all headings use "font-sans" (or the defined token)
instead of "[font-family:...]" to align with apps/web/src/lib/design-tokens.ts
and apps/web/tailwind.config.ts.
In `@apps/web/src/components/payment/PaymentFlow.tsx`:
- Around line 219-223: The code currently sets isAuthError by regex-matching
errorMessage; change the logic in PaymentFlow.tsx where
createOrderMutation.mutateAsync failure is handled to detect tRPC authentication
errors by checking if the thrown error is a TRPCClientError and then inspecting
error.data?.code for "UNAUTHORIZED" or "FORBIDDEN" (instead of regex on
error.message). Update the isAuthError/redirect branch to use this check (e.g.,
import TRPCClientError type, guard on instance and error.data?.code) and keep
the existing redirect behavior when those codes are present.
---
Nitpick comments:
In `@apps/web/src/components/payment/PaymentFlow.tsx`:
- Around line 163-168: The current redirect triggers when session.accessToken is
missing but that should only happen for genuine token-generation failures, so
keep the accessToken check (accessToken on session) but clarify in the code
comment and only redirect when accessToken is falsy/empty (as implemented around
accessToken, session, callbackUrl, router.push); additionally, stop relying on
regex-ing error.message for auth failures and instead detect tRPC auth errors by
checking the tRPC error shape (e.g., inspect the thrown error for
error.data?.code === 'UNAUTHORIZED' or error.code === 'UNAUTHORIZED' in your
payment/error-handling code) and use that branch to trigger the login
redirect—replace the regex logic with these explicit checks.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: eba75691-a9bf-450e-b5f2-31a8651acecc
📒 Files selected for processing (2)
apps/web/src/app/(main)/(landing)/pitch/page.tsxapps/web/src/components/payment/PaymentFlow.tsx
|
Actionable comments posted: 0 |
Summary by CodeRabbit
Bug Fixes
Refactor