## Lead routing (1.9.0)

Connect accepted enquiries to assigned deals and optional follow-ups in Results & domains. See [routing rules and setup](FUNNEL_LEAD_ROUTING.md) and [upgrade instructions](../UPGRADE_1.9.0.md).

## Domains and results (1.8.0)

Custom funnel domains and opt-in conversion tracking are now implemented. See [setup, definitions and limits](FUNNEL_DOMAINS_AND_RESULTS.md) and [upgrade instructions](../UPGRADE_1.8.0.md). Native checkout, split testing and confirmed external booking/payment conversions remain separate work.

# AI and visual funnel builder

The **Guided creator** adds a five-step path from audience and offer to editable
pages. Choose Offer first, Customer story, or Explain & invite, with original tips
and attributed educational sources. See [guided creator](FUNNEL_GUIDED_CREATOR.md)
for the flow, source material, and naming boundaries.

The gallery opens with 25 [industry campaigns](FUNNEL_INDUSTRIES.md), including
dental, fitness, restaurants, weddings, legal, home services, beauty, hospitality,
retail, and community organizations. The original 32 general funnel structures
are under **Funnel frameworks**. Industry templates use business-specific
imagery, typography, colors, offer copy, and enquiry flows. A separate **Ad campaigns**
catalog contains 142 [ad-focused campaigns](FUNNEL_AD_RESEARCH.md), including challenge
posters, book opt-ins, video offers, product/package reveals, and local offer cards.
Use `/demo/funnels?catalog=ads` to open that collection directly.

Choose **All campaigns** or **New designs**, then combine industry, goal, and text
filters. Goal labels are Free guides, Video funnels, Events & classes, Service
enquiries, and Product discovery. The earlier numbered batch collections have
been removed. Legacy release links now open all campaigns; template IDs and saved
drafts remain available. No-match reset clears all the ad discovery filters.

The [latest 30 designs](FUNNEL_CREATIVE_30.md) add 15 composition directions with
two versions each (30 distinct native structures), 22 generated photographs, and
offer-specific copy. Open `/demo/funnels?catalog=ads&view=new` to review them.
The [first fifty](FUNNEL_EXPANSION_50.md) and [second fifty](FUNNEL_SECOND_EXPANSION_50.md)
document earlier design work, all retained in the current catalog.

Local feature development based on Hyperchat 1.6.0, restored from the private
`codex/workspace-backup-2026-10-24` branch (`63051b2bbbf4`). This is an additive
source change; the buyer release version and existing published workflows are
unchanged.

## Use the builder

Open **Funnels** in a connected workspace, or visit
http://127.0.0.1:3215/demo/funnels for the isolated browser demo. Choose a local
service, live workshop, consultation, or digital offer template from the 199-template
library. The full library includes 597 ad concepts.
[Research and template catalog](FUNNEL_TEMPLATE_RESEARCH.md) and
[industry campaigns](FUNNEL_INDUSTRIES.md) explain the inspiration and references. The demo stores drafts only in this browser and does not call AI or
publish pages.

New starters include original generated photography/resource imagery, photo-led
heroes, event/video treatments, benefit cards, and split lead sections. Click an
image or video and open **Choose an image** to select a bundled scene, or supply
your own HTTPS asset. Video posters are editable; publishing a video still
requires a real video URL. Section settings expose column proportions and card
treatments. Stock scenes illustrate the offer and do not establish customer,
team, or project proof. Full prompts and asset records are in
[FUNNEL_ASSET_PROMPTS.json](FUNNEL_ASSET_PROMPTS.json). Existing saved drafts are
preserved; start a new template to see the refreshed designs.

The current designs include form-first opt-ins, narrow sales letters, cinema
VSLs, photo-background quote pages, workshop posters, product stages, editorial
appointments, and other distinct compositions. Gallery cards are screenshots of
the actual pages. Use **Open full page** in a desktop template preview to review
a clean example. Section **Page composition** settings edit content width,
minimum height, background scenes and overlays, and individual column panels;
image crop, form layout, and font weight are available on their elements.

The left panel has **Pages**, **Layers**, and **Insert** tabs. Pages switches
between funnel steps. Layers shows the page's sections, rows, columns, and elements;
select an item to jump to it and open its own settings. The clickable ancestry
path above the canvas returns to any parent or to page settings. Row controls
change only that row; column controls change only its panel.

Double-click a headline, eyebrow, or paragraph to type on the canvas, or focus its
outline and press Enter. Click away to commit, press Escape to cancel, or use
Ctrl/Cmd+Enter to finish a paragraph. Enter finishes a headline; Shift+Enter adds a
line break. Each completed editing session is one undo operation. Pasted content
is plain text, capped at the document's 6,000-character limit. Dragging is disabled
on the block while typing so text can be selected normally. The inspector remains
available for content and appearance changes.

Choose a **+** between blocks or **Add element** at the end of a column, then search
or filter Insert. The picker remembers that exact position. Clicking a palette
item without an explicit insertion marker appends to the selected column; dragging
can insert before another element or move a block between columns. Drag section
labels to reorder sections. Move, duplicate, and delete are available for all
container levels in the inspector and selection toolbar, with document limits
and at least one section/row/column preserved. Undo and redo retain a surviving
selection; deletion selects a neighbor or parent.

Ctrl/Cmd+S saves the draft, including a focused canvas text edit. Ctrl/Cmd+Z and
Ctrl/Cmd+Shift+Z (or Ctrl+Y) undo/redo document edits outside text inputs; native text
undo applies while typing. Escape outside an input selects the parent. The demo
continues to save only in this browser. Publish remains a separate connected
workspace operation.

Desktop/mobile preview, responsive visibility, padding, colors, alignment, font
size, columns, and corner radius use the same structured data as public pages.
On phones the editor panels stack. Headline settings include an optional **Mobile
heading size**, and section settings include **Mobile section padding**. Clear a
value to restore automatic responsive defaults; desktop values are independent.
Other mobile typography, alignment, and column-order overrides and a saved-section
library remain future work.

Each page has its own name, URL path, metadata, and sections. Add, remove, or
reorder steps in page settings. Forms and next-step buttons advance to the next
ordered step. Buttons can instead scroll to a lead form or open an explicit HTTPS
checkout/calendar URL. Images use HTTPS asset URLs and descriptive alt text;
videos use direct HTTPS video URLs rather than provider embed HTML. FAQ blocks
expand without executing custom code.

**SEO** adds per-page search and sharing previews, indexing/canonical controls,
language, business structured data, and actionable content checks. Public pages
include server-rendered metadata, semantic headings, automatic branded sharing
images, robots rules, and published-only sitemaps. See [Funnel SEO](FUNNEL_SEO.md)
for production-origin configuration, indexing defaults, and verification limits.

**Preview** now walks the whole draft, including unsaved changes. Page chips and
next-step CTAs move between pages; form CTAs focus the lead form; simulated form
submissions validate required fields and advance without creating contacts or
sending data. **Restart** clears preview fields. External buttons show their
configured destination before you choose to open it. Template preview dialogs use
the same walkthrough, while clean full-page template links remain design-only.

The external-arrow toolbar button opens a **private preview tab** with its own
snapshot and device controls. It expires after 30 minutes, survives reload only in
that tab, and never sends the draft document to a backend. Copying its URL to a
separate browser/tab does not expose the draft. Opening a preview neither saves
nor publishes. See [preview behavior and privacy](FUNNEL_PREVIEW.md).

Save persists a draft with optimistic revision checks. A conflicting save leaves
the local draft in place; export it before reloading to merge a teammate's work.
Undo/redo retains up to 40 local changes. JSON export/import allows reuse across
funnels and workspaces; imported content stays a draft until saved and published.

## AI generation

Configure the workspace's existing OpenRouter key and text model in **Settings**.
Use **Build with AI** to describe the business, audience, offer, visual direction,
and desired action, or request changes to the current funnel. Generation uses the
existing atomic workspace AI reservation (10 requests/minute, 200/day), keeps
credentials on the backend, and requires workspace membership. The model must
support JSON responses. The timeout is 60 seconds; truncated, malformed,
oversized, duplicate-ID, or unsafe-URL results are rejected without replacing the
current draft. A successful result remains editable, unsaved, and undoable.

The prompt includes only the supplied instruction, current funnel, and a sample
structure. It does not retrieve private conversations or business knowledge.
Review all claims and supply actual assets, prices, checkout/calendar links, and
proof. Automated acceptance uses mocked model responses; no live paid model call
has been certified for this increment.

## Publishing and lead intake

Workspace owners/admins publish and unpublish. Agents can edit drafts; reviewers
cannot access this feature. Publishing snapshots a validated saved revision;
subsequent draft edits do not change the live funnel. Missing media URLs, image
descriptions, external destinations, form consent text, and form/next-button
destinations block publishing. This validates structure, not the truth of copy or
availability of an external checkout.

Public routes are `/f/FUNNEL_ID` and `/f/FUNNEL_ID/STEP_SLUG`, on the buyer's
existing app origin. They render only the selected published step, with page
metadata and the shared renderer. The intentionally anonymous `publicPage` query
does not return drafts, workspace identifiers, staff identities, contacts, or
leads. Unpublishing disables public page lookup and intake immediately; a browser
with already loaded HTML may still display that snapshot.

Forms require name, email, and a checked contact-consent box; phone is optional.
The backend resolves the workspace, form, consent wording, and next step from
the active published snapshot. Stale page revisions and forged forms are rejected.
Successful submission IDs are idempotent. Consent wording, timestamp, form,
published revision, and campaign attribution are saved with the submission.
These are contact requests; they do not independently enroll an email campaign
or send an inbox message.

New contacts use the existing contact writer and its configured integration
events/Seedly behavior. Email matches are scoped to the workspace. Existing
contact profiles, tags (including suppression tags), phone numbers, and archived
status are preserved. Workspace-required custom fields still apply to new
contacts; configure those fields appropriately for public lead intake.

Attribution includes `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`,
`utm_term`, `gclid`, and `fbclid`, bounded to 300 characters each. The visitor's
current campaign parameters are preferred; session storage carries them across
steps when available. Attribution is visitor supplied, not verified ad-network
conversion data. **Leads** shows the most recent 100 submissions per funnel.
The funnel list loads 12 drafts per page to bound database reads.

Public intake includes a honeypot, payload bounds, and atomic per-funnel limits
of 30 accepted submissions/minute and 1,000/day. These are basic volume controls,
not a CAPTCHA or identity verification. Operators running high-volume campaigns
should adapt these controls to their traffic and hosting environment.

## Install and validate

Deploy the additive Convex schema/functions to the buyer's own Hyperchat backend
before serving the updated frontend. Keep all existing configuration and data.
Do not run fresh-install setup for this upgrade. Do not use the DevLaunch website
backend. The source package includes no provider credentials or configured
backend. Use your own installation for connected acceptance; local demo tests
do not certify live account, AI, or provider behavior.

Run `pnpm typecheck`, `pnpm test`, `pnpm test:backend`, and `pnpm build`.
`tests/funnels.test.ts` covers structured layouts, templates, safe URLs, unique
IDs, publishing prerequisites, and attribution. `tests/funnels.spec.ts` covers
workspace isolation, permissions, stale edits, immutable public snapshots,
unpublishing, intake validation, deduplication, suppression preservation, rate
limits, and mocked AI success/failure. Desktop and 390px browser review also passed template creation, block insertion,
text editing, undo/redo, drag/drop across columns, save/reload persistence, clean
preview, demo AI boundaries, and missing-page 404 behavior. Screenshots and the
local captures are under ignored `artifacts/funnels/`. The repeatable editor
acceptance harness is `tests/integration/funnel-editor.mjs` (run against the local
dev server with `node tests/integration/funnel-editor.mjs`; set `PUPPETEER_MODULE`
if Puppeteer is installed in a separate QA environment). It also checks
plain-text/multiline paste, exact-position insertion, Layers/ancestry navigation,
row/column settings, column copy/delete, shortcut save of a focused text edit,
selection versus dragging, and per-session undo. The public production SEO
harness uses synthetic HTTP fixtures and makes no cloud requests. Browser libraries
were unpacked under ignored `artifacts/browser-deps/`; no system packages or
provider credentials were installed.

The current release does not implement native payment/order processing, one-click
upsells, order bumps, A/B traffic allocation, pixel scripts, or ad-platform
conversion reporting. External payment and
booking buttons use the supplied provider URLs. It is a native funnel-building
foundation rather than a claim of full HighLevel/ClickFunnels feature parity.

## Design references

The page model follows the familiar section/row/column/element hierarchy documented
in [HighLevel's builder overview](https://help.gohighlevel.com/support/solutions/articles/155000001633)
and [ClickFunnels page layouts](https://support.myclickfunnels.com/docs/creating-a-page-layout/).
AI and manual controls operate on one editable page format, consistent with
[HighLevel's AI builder workflow](https://help.gohighlevel.com/support/solutions/articles/155000006713-funnel-website-ai).
These references informed the interaction model; no authenticated competitor
workspace or comparative conversion performance was tested.
