← Back to Pull requests

Submitted lead form builder #4639

Closed
unknown closed this pull request without merging on Oct 08, 2026 00:02 UTC
View on GitHub
unknown unknown commented on Oct 07, 2026 14:03 UTC
Author

Summary

Adds a submitted lead form builder to the Submitted Leads page (Figma). Workspaces pick the form fields and which partner groups can submit leads.

  • The form is stored per group (PartnerGroup.submittedLeadFormData and submittedLeadsEnabledAt), like applicationFormData. For now, a save writes one form to all groups.

  • The workspace side uses the submittedLeads beta flag instead of a hardcoded program list. The partner side uses the partner's group.

  • Partners in a group that is turned off can still see their old leads.

  • New field options: URL type, min/max for numbers, and "Allow multiple selections" for multiple choice.

  • The builder no longer offers Phone. Existing phone fields open as text fields.
  • Not included: Legal fields and "Create lead". Program.referralFormData is removed in a follow-up.

    Deployment

  • New PartnerGroup columns deployed to production (PlanetScale deploy request 595)

  • Column renamed to submittedLeadFormData (PlanetScale deploy request 596)

  • Backfill run on production: 46 groups in 6 programs

  • Backfill run again after the rename: 46 groups in 6 programs

  • Those 6 workspaces added to betaFeatures.submittedLeads in Edge Config
  • How to test

    1. In apps/web, run pnpm prisma:push, and leave EDGE_CONFIG empty in .env.local.
    2. On http://localhost:8888/acme/program/leads, click the sliders button, add fields, turn on the groups, and save.
    3. As an Acme partner, open http://partners.localhost:8888/programs/acme/leads and submit a lead with the new fields.
    4. Turn off the partner's group. The tab is hidden, and partners without leads are redirected to the program overview.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Added a lead-form builder that lets teams customize fields and choose which partner groups can collect submitted leads.
    Added URL fields and configurable character limits, numeric bounds, and selection options.
    Lead forms now follow group-level settings, and newly created campaign groups inherit the default group’s form settings.

    Improvements
    Added clearer validation for required fields and configured limits.
    Submitted Leads access is now controlled by workspace and group settings rather than a fixed program list.
    Improved scroll fades in payout tables.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Screenshots

    <img width="664" alt="Submitted Leads page header with the form button" src="https://github.com/user-attachments/assets/f5455f6d-189b-4678-9bd0-281c9159366a" />

    <img width="540" alt="Edit submitted lead form drawer" src="https://github.com/user-attachments/assets/7df497f5-384e-4842-b68d-f9663239c860" />

    <img width="540" alt="Partner submit lead form with a custom field" src="https://github.com/user-attachments/assets/f52bd519-8cbe-4d75-975c-b2d05530d53a" />

    Diff: 398 lines (+298 / -100) across 4 files Reviewer: Joker666 Review duration: 599m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 398 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4639"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.2% (MEDIUM) · Higher = larger blast radius
    43.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.1% · Safe to merge
    17.1%
    Repository