feat(forms): obvious publish flow, member Forms surface, templates (P8)

- builder: draft/published/closed status banners; creating a form now
  lands on its edit page so Publish is immediately visible; a
  members-only form shows a "no public link" note instead of a dead URL
- member-facing forms: /my-forms list + /my-forms/[id] fill
  (MemberFillClient), "Forms" sidebar item for all members. Fixes the
  long-standing gap where members-only forms had no fill surface
- starter templates: lib/form-templates.ts + a picker on /forms/new
  (Liability waiver, Membership application, Event RSVP, Photo release,
  Blank) that seeds builder state (no table)
- forms-client relabels members-only forms (was showing a misleading
  /f/<space>/<slug> that always 404s for members-only)
- docs corrected per the audit pass: DATABASE_SCHEMA / DB_SCHEMA_MAP /
  ARCHITECTURE / API_REFERENCE now reflect migrations 014-029, per-space
  slug, /f/[space]/[slug], getPublicForm({space,slug}), invite roles;
  HANDOFF pass-19 added with residual gaps

337 tests; build verified (Compiled successfully, exit 0). No deploy.
This commit is contained in:
Moheeb Zara
2026-05-16 17:41:16 -07:00
parent df6951c323
commit 73eef7293a
14 changed files with 485 additions and 33 deletions
+5 -1
View File
@@ -65,7 +65,11 @@ export function FormsClient({ forms, spaceSlug }: { forms: FormRow[]; spaceSlug:
</Link>
{f.kind === 'waiver' && <Badge variant="secondary">Waiver</Badge>}
</div>
<p className="font-mono text-xs text-muted-foreground">/f/{spaceSlug}/{f.slug}</p>
<p className="font-mono text-xs text-muted-foreground">
{f.visibility === 'members'
? 'Members-only (filled from the in-app Forms page)'
: `/f/${spaceSlug}/${f.slug}`}
</p>
</div>
<Badge variant="outline">{VIS_LABEL[f.visibility] ?? f.visibility}</Badge>
<Badge variant={f.status === 'published' ? 'default' : 'secondary'}>
+2 -13
View File
@@ -1,6 +1,6 @@
import { requireFormsManagerPage } from '@/lib/forms-guard'
import { PageHeader, PageTitle } from '@/components/ui/page-title'
import { FormBuilder } from '@/components/forms/form-builder'
import { NewFormClient } from '@/components/forms/new-form-client'
export const dynamic = 'force-dynamic'
@@ -13,18 +13,7 @@ export default async function NewFormPage() {
<PageTitle>New form</PageTitle>
</PageHeader>
<div className="p-4 md:p-6">
<FormBuilder
initial={{
spaceSlug,
slug: '',
title: '',
description: '',
kind: 'form',
visibility: 'members',
legal_text: '',
schema: [],
}}
/>
<NewFormClient spaceSlug={spaceSlug} />
</div>
</>
)