# AI Editor RSP — Frontend auth affordance stale Preview repair closeout

Task: `t_0e8cbeb3`
Production: https://aieditorrsp.net
Code repair commits: `def1d4cca1c517f310ddd9af17fb31d8da963e40`, `7853ccbe4f75c71bc8f4d58e5de6ad19ee3c5e1d`
Final closeout commit and Cloudflare Worker version are recorded in Kanban metadata for this task.

## Changes

- Replaced the desktop Studio/header `Preview access` CTA with an explicit `Sign in` auth affordance.
- Replaced the mobile menu `Preview access` entry with the same auth affordance.
- Added `src/components/AuthStatusLink.tsx`:
  - Anonymous state: `Sign in` → `/api/auth/login?return_to=/pricing`.
  - Authenticated state: account/plan/credits label → `/pricing`.
  - Uses `/api/credits` at runtime and keeps `Sign in` as the safe fallback when credit state is unavailable.
- Removed stale public support copy `preview access` from `/contact`.
- Updated the credit account panel fallback copy so it no longer says paid checkout/OAuth configuration is unavailable.

## Files changed

- `src/components/AuthStatusLink.tsx`
- `src/components/StitchStudio.tsx`
- `src/components/MobileStudioMenu.tsx`
- `src/components/CreditAccountPanel.tsx`
- `src/components/PublicPages.tsx`

## Verification

Local gates:

- `npx eslint src/components/AuthStatusLink.tsx src/components/StitchStudio.tsx src/components/MobileStudioMenu.tsx src/components/CreditAccountPanel.tsx` — PASS
- `npx eslint src/components/PublicPages.tsx src/components/AuthStatusLink.tsx src/components/StitchStudio.tsx src/components/MobileStudioMenu.tsx src/components/CreditAccountPanel.tsx` — PASS
- `npx tsc --noEmit` — PASS
- `npm run verify` — PASS: `{"ok":true,"routes":11,"hrefPlaceholders":0,"forbiddenCopy":0,"analyticsRuntimeHooks":11,"runtime_architecture":"workers_first_frontend_with_api_stubs"}`
- `npm run build` — PASS
- `npm run deploy` — PASS

Production marker checks:

- Routes checked: `/`, `/ai-photo-prompt-editor`, `/prompt-library`, `/pricing`, `/ai-photo-editing-prompts`, `/chatgpt-photo-editing-prompts`, `/contact`, `/privacy`, `/terms`.
- Every checked route has `Sign in` and `/api/auth/login?return_to=/pricing`.
- Every checked route has no `Preview access` / `preview access`.
- Every checked route has no stale checkout strings: `paid checkout disabled`, `paid checkout is unavailable`, `paid checkout is off`, `wait verification`, `paid checkout and paid credits remain off`.

Mobile checks:

- `npm run test:mobile-nav -- --base-url https://aieditorrsp.net` — PASS, viewport `390x844`, 6 routes × 4 nav targets = 24 click checks.
- Browser/CDP mobile check at `390x844` — PASS:
  - menu button present, height `44px`
  - horizontal overflow `0`
  - `Sign in` visible in header/mobile menu
  - mobile menu `Sign in` href `https://aieditorrsp.net/api/auth/login?return_to=/pricing`
  - `Preview access` absent from visible page text

## Deployment sync

- Branch: `main`
- Code repair commit: `7853ccbe4f75c71bc8f4d58e5de6ad19ee3c5e1d`
- Deployed from current local checkout after push.
- Cloudflare deployment source display: `Unknown (deployment)` because OpenNext direct deploy does not attach a Git source label; `npx wrangler deployments list --config wrangler.jsonc` confirms a new deployment is created after the deploy command.
- Git status after verification: `## main...origin/main`

## Residual risk

- This repair verifies auth affordance visibility and links, not a full Google OAuth callback E2E or Stripe checkout/webhook entitlement E2E.
- Cloudflare deployment listing reports source as `Unknown (deployment)` for direct Worker deploys, so same-commit provenance is established by the command sequence and git state rather than a Cloudflare Git source field.

## Next inputs

- Product/QA can run a separate logged-in OAuth + Stripe checkout entitlement E2E if final launch GO requires payment-flow proof.
