feat: header auth state — signed-in indicator, Open app + Log out (Privy)#43
feat: header auth state — signed-in indicator, Open app + Log out (Privy)#43sweetmantech wants to merge 1 commit into
Conversation
After authenticating through the valuation flow the header still showed Sign In / Sign Up, and the marketing surface had no logout at all (fresh funnel tests required clearing cookies). The header now renders inside the existing root PrivyAuthProvider: signed-in visitors get an avatar menu (session email, "Open app" into chat, "Log out" via the Privy SDK); signed-out visitors see the unchanged Sign In / Sign Up pair. Part of recoupable/chat#1850. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="components/layout/HeaderAccountMenu.tsx">
<violation number="1" location="components/layout/HeaderAccountMenu.tsx:36">
P2: Screen-reader users can be told this is an ARIA menu, but keyboard interaction stays like plain links/buttons because menu keyboard behavior isn’t implemented. Consider either implementing full WAI-ARIA menu keyboard/focus handling or removing `role="menu"`/`role="menuitem"` so semantics match actual behavior.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| </button> | ||
| {open && ( | ||
| <div | ||
| role="menu" |
There was a problem hiding this comment.
P2: Screen-reader users can be told this is an ARIA menu, but keyboard interaction stays like plain links/buttons because menu keyboard behavior isn’t implemented. Consider either implementing full WAI-ARIA menu keyboard/focus handling or removing role="menu"/role="menuitem" so semantics match actual behavior.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At components/layout/HeaderAccountMenu.tsx, line 36:
<comment>Screen-reader users can be told this is an ARIA menu, but keyboard interaction stays like plain links/buttons because menu keyboard behavior isn’t implemented. Consider either implementing full WAI-ARIA menu keyboard/focus handling or removing `role="menu"`/`role="menuitem"` so semantics match actual behavior.</comment>
<file context>
@@ -0,0 +1,69 @@
+ </button>
+ {open && (
+ <div
+ role="menu"
+ className="absolute right-0 top-full mt-2 w-56 rounded-xl bg-(--background) py-1.5"
+ style={{
</file context>
Part of recoupable/chat#1850 (valuation-first homepage + funnel fixes) — the "marketing header auth state" item. Independent of the sibling marketing PR #42 (valuation card $0-tail collapse); either can merge first.
What
After Privy authentication (e.g. via the valuation flow), the site header still showed Sign In / Sign Up and offered no way to log out — testing the funnel fresh required manually clearing cookies (observed in the 2026-07-06 funnel walkthrough on chat#1850).
components/layout/HeaderAuth.tsx— renders the signed-in state (account initial avatar) when a Privy session exists; signed-out visitors see the existing Sign In / Sign Up pair unchanged.components/layout/HeaderAccountMenu.tsx— account menu: Open app →siteConfig.appUrl(chat.recoupable.dev) and Log out via@privy-io/react-auth'slogout().contexts/PrivyAuthProvider.tsx+app/layout.tsx— the header previously rendered outside any Privy provider; the provider now wraps the layout so the header can read session state (same app id/config as the valuation flow).lib/format/accountInitial.ts(+ test) — pure helper for the avatar initial, TDD (RED→GREEN).components/layout/MobileSignInLink.tsx— mobile nav parity.Done when (from the issue)
recoupable.devand can log out (state flips back to Sign In / Sign Up).pnpm buildpasses (this repo's verification gate).Verification status:
pnpm buildgreen on this branch per the implementing run; logic helper unit-tested. Live signed-in verification on the Vercel preview requires a Privy OTP login — pending; will be exercised in the chat#1850 end-to-end funnel re-test.🤖 Generated with Claude Code
Summary by cubic
Header now reflects the Privy auth state: shows an avatar menu with “Open app” and “Log out” when signed in, and keeps “Sign In / Sign Up” when signed out. Addresses the “marketing header auth state” requirement from chat#1850.
HeaderwithPrivyAuthProviderso it can read session state.HeaderAuthto toggle between Sign In/Up and the signed‑in account menu.HeaderAccountMenuwith email, “Open app” (tositeConfig.appUrl), and “Log out” via@privy-io/react-auth’slogout().MobileSignInLinkto hide “Sign In” in the mobile menu when authenticated.accountInitialhelper (+ tests) for the avatar initial.Written for commit b3447a4. Summary will update on new commits.