feat(header): reflect signed-in state in the marketing header - #52
feat(header): reflect signed-in state in the marketing header#52sweetmantech wants to merge 1 commit into
Conversation
The marketing header always showed Sign In + Sign Up, even for a signed-in user. Read Privy auth state (`usePrivy`) and, once resolved, show a single "Open app" CTA instead. Gated on `ready` so the server and first client render both show the signed-out CTAs (no hydration mismatch), then swap in place. Moves `<Header />` inside `<PrivyAuthProvider>` in the root layout so the header can consume Privy context; the provider is SSR-safe (plain context on the server) so pages stay statically prerenderable. Refs chat#1885. Co-Authored-By: Claude Opus 4.8 (1M context) <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: 41 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 Plus Run ID: 📒 Files selected for processing (2)
✨ 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 |
Preview verification — 2026-07-27Preview: https://marketing-4bbca0fux-recoup.vercel.app — built from Results
Signed out Signed in Row 1 is the one worth calling out: the How the signed-in state was reached (and the caveat that comes with it)The marketing header has no login control of its own — it only links out to chat. The single I first tried the zero-side-effect route: reusing a browser context already authenticated against a chat preview. It stayed signed out. That means this preview cannot reproduce the production condition this PR actually targets: a session established on To keep the forced valuation cheap I picked the smallest artist I could find — Sound of Fractures StemsDAO, 5 followers. The run returned $389 (range $267–$547) across 6 measured tracks, and it also confirms the flow still works end-to-end under the reparented provider. Note on the
|


What
The marketing site header always rendered Sign In + Sign Up, even for a user who is already signed in. This makes the header reflect the signed-in state: once Privy resolves and the user is authenticated, the header shows a single "Open app" CTA (→
siteConfig.appUrl) instead of the sign-in/sign-up pair. The mobile menu's auth link swaps to "Open app" too.Changes
components/layout/Header.tsxusePrivy()(ready,authenticated).signedIn = ready && authenticated— gated onreadyso the server render and first client render both show the signed-out CTAs, avoiding a hydration mismatch; the header then swaps in place once Privy resolves.app/layout.tsx<Header />inside<PrivyAuthProvider>so the header can consume Privy context (it previously sat outside the provider). The provider is documented SSR-safe — it renders a plain context on the server — so pages stay statically prerenderable.Achromatic chrome preserved (no new color); reuses the existing pill styles per DESIGN.md.
Verification
pnpm exec tsc --noEmit— clean for both changed files.pnpm build— compilation + TypeScript pass (✓ Compiled successfully,Running TypeScript ...).Cannot initialize the Privy provider with an invalid Privy app IDbecause there is no realNEXT_PUBLIC_PRIVY_APP_IDsecret in this environment (Privy rejects placeholder IDs at init). This is pre-existing and env-driven —PrivyAuthProvideralready wraps every page onmain, so any static page throws the identical error without the production secret; it is not introduced by this change. Vercel builds/previews with the real app id prerender normally.Scope
Implements only the "marketing header signed-in state" slice of the P3 long tail in chat#1885. Explicitly out of scope (remaining P3 follow-ups):
bash/skilltool components, and "Unknown artist" rows (needssong_artistsingestion).Targets
main. Part of chat#1885.🤖 Generated with Claude Code
Summary by cubic
Make the marketing header reflect the signed-in state. When Privy resolves, show a single “Open app” CTA instead of “Sign In” + “Sign Up”, and update the mobile menu.
New Features
usePrivy(ready,authenticated) from@privy-io/react-auth; usesignedIn = ready && authenticatedto avoid hydration mismatch, then swap to “Open app” linking tositeConfig.appUrl.Refactors
<Header />,<Footer />, andViewModeBarinsidePrivyAuthProviderinapp/layout.tsxso the header can consume Privy context (SSR-safe).Written for commit 5f0e193. Summary will update on new commits.