Follow-up to the ad-conversion-rules feature (SURF-1500, PRs surface_forms #4831 / scripts #68).
The form's Conversion Events setting ("Send conversion events to ad platforms when a lead reaches a step you choose") today only lets a rule fire when a lead reaches a chosen form step. The firing-trigger dropdown was deliberately made steps-only (commit 4ce81ad6a), so customers can't tie an ad-platform conversion to the natural Surface form events documented at https://docs.withsurface.com/docs/events/form-events (SurfaceFormStarted, SurfaceFormStepSubmitted, SurfaceFormEmailProvided, SurfaceFormMeetingBooked, SurfaceFormSubmitEvent). Common asks like "fire the Meta conversion when a meeting is booked" or "when an email is captured" are impossible. The dropdown also has no grouping/iconography to distinguish a step from an event.
Add a second "Form Events" group to the trigger dropdown (ads/TriggerSelect.tsx) alongside the existing Steps group, with its own per-group icon set + accent color (react-icons/ri, following existing ads/ + StepBadge conventions), and wire full runtime firing:
packages/types/v1/formSetting/model/adsConversions.ts): add form-event trigger types, mapping the 5 documented events to trigger keys, reusing the existing form_submitted for SurfaceFormSubmitEvent and adding form_started / step_submitted / email_provided / meeting_booked. Keep new fields optional (permissive schema is parsed on every debounced keystroke); enforce completeness at runtime.packages/form-render/src/lib/client/adConversions/): add selectFiringEvents branches so each event fires its rule once per response (no back-nav refire, not in preview), reusing existing form-render signals (email captured, booking/meeting) rather than adding new tracking. Where a usable signal doesn't already exist, surface the option in the dropdown but mark that event's firing as a follow-up.reached_qualified / form_submitted triggers from schema/runtime; published rules parse against them.Verification: extend the existing evaluateRules/selectFiringEvents unit tests with a case per new event; tsc; manual UI screenshot of the grouped dropdown + confirm a form-event rule fires at the right moment.
surface_forms only. Approach may change during implementation.