Skip to content

feat: desktop workbench, paid gating, read-only studio, and live plan sync#6

Merged
shashank03-dev merged 7 commits into
mainfrom
feat/login-motion-field
Jun 30, 2026
Merged

feat: desktop workbench, paid gating, read-only studio, and live plan sync#6
shashank03-dev merged 7 commits into
mainfrom
feat/login-motion-field

Conversation

@shashank03-dev

Copy link
Copy Markdown
Owner

What this ships

The desktop workbench plus paid-tier gating end to end. Free users analyze motion and get a read-only studio; paid users get saved projects, workspaces, and a fully editable/exportable code studio.

Authentication

  • New login experience + modal with motion-field/particle-field background; login-form handles every state (signed-out, auth-error, invalid-credentials, Google OAuth, OTP).
  • Every protected page calls requireDashboardUser; the (workbench) layout defers the auth redirect to each page so next is correct. APIs reject UNAUTHENTICATED before doing work.

Tier / plan gating (enforced server-side, not just UI)

  • Pages: resolvePlanGate(user.id)UpgradeGate for free tier.
  • Analyze API gates on allowedModels + reserves the daily quota before the model runs, releasing it on any failure (no quota-bypass window).
  • Projects/workspaces APIs enforce plan limits + workspace-ownership FORBIDDEN. Free-project cap enforced at DB + API.
  • Editor editable flag sourced from the server entitlement summary.
  • PlanSync keeps the rendered tier live via Supabase Realtime (RLS-respecting) with a focus/visibility refresh fallback.

Analysis

  • Order: auth → model entitlement → project-ownership preflight → abuse guard → reserve quota → run model → release on failure. Bounded body reads (413 on oversize), Zod validation on input and model output.

Editor

  • Free tier: read-only (Copy only, "Upgrade to edit"). Paid: Format / Copy / Download / Reset / Run. CodeMirror respects editable.

Migrations (idempotent, security definer, locked-down grants)

  • release_analysis_usage_event RPC (quota rollback on failed analysis).
  • Realtime publication for profiles + subscriptions with replica identity full.

Verification

Gate Result
tsc --noEmit pass
eslint . clean
vitest 211 tests / 31 files pass
next build 21 routes compiled

New tests: plan-gate, editor-pane-readonly, workbench-tree, buildPreviewDoc, plus expanded analyze/workspace API coverage. Playwright e2e not run (needs a live server).

Note: branch name (feat/login-motion-field) is narrower than the contents — this PR is the full workbench/gating feature set.

🤖 Generated with Claude Code

codex and others added 6 commits June 30, 2026 15:39
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the supporting layer the new surfaces build on:
- lib/preview (preview doc builder + console bridge) and lib/workbench/tree
- analysis usage reserve/release recorder in lib/server/audit
- migrations: release_analysis_usage_event RPC (quota rollback on failure)
  and realtime publication for live plan-tier sync
- CodeMirror/codemirror deps, brand + auth assets, theme tokens

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UI layer for the desktop workbench and paid gating:
- Workbench shell with workspace/project explorer tree
- Analyze studio: CodeMirror editor (read-only on free tier, full
  edit/format/export on paid), preview pane, console panel
- UpgradeGate paywall, FreeSaveNoticeModal, RouteModal
- Billing + account content, PlanSync (Realtime + focus refresh)
- Login experience/modal with motion-field + particle-field background

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Route group (workbench) layout + projects/workspaces/versions pages,
  each server-gated via requireDashboardUser + resolvePlanGate
- Intercepted @modal routes for account/billing
- Analyze API: model-entitlement gate + daily quota reservation that
  releases on failure; workspaces API ownership checks
- Account/billing/dashboard/login/onboarding/pricing page wiring

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
motion-code Ready Ready Preview, Comment Jun 30, 2026 8:54pm

The collapsible sidebar split the brand into two spans separated by a
CSS flex gap, so the anchor's text content was "</>MotionCode" (no
space). Restores the literal space so the brand reads "</> MotionCode"
in the DOM, matching what users see and the app-smoke e2e assertion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shashank03-dev
shashank03-dev merged commit 4b1411f into main Jun 30, 2026
1 of 3 checks passed
@shashank03-dev
shashank03-dev deleted the feat/login-motion-field branch June 30, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants