Files
co-lite/openspec/changes/add-hero-signup-form/proposal.md
T
ngqileandClaude Opus 5.5 417af36227 feat(pages): a hero section can carry the sign-up form beside its text
A HERO block may name an event. services-counter checks it belongs to the
page's company; mobile-api serves and accepts the form for it like a FORM
block; the portal shows the form in a card beside the hero text (below it on
phones), with the hero's own event picker, "No form" by default.

OpenSpec change: add-hero-signup-form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
2026-12-03 19:36:16 +08:00

2.1 KiB

Proposal

Why

Event pages convert best when the sign-up form is visible as soon as the page opens. INS's standalone landing page (~/Projects/ins-landing-page) puts the form in a card beside the hero text. In Co-Lite the form is always its own section, so on a page built from Custom HTML it lands below the hero, and the hero tells visitors to "scroll down to the form". Custom HTML cannot hold the real form: it runs in a sealed frame that cannot send leads into Co-Lite.

What Changes

  • A HERO block gains an optional event (eventUuid). When it is set, the hero shows Co-Lite's sign-up form for that event in a card beside the heading, text and button on wide screens, and below them on phones.
  • The hero form behaves exactly like the FORM block:
    • the same fields, interests and privacy notice;
    • the same submit rules and limits;
    • the same lead source, UTM values and closing rules.
  • The server checks a hero's event like a FORM block's: it must be an event of the page's company.
  • In the editor, the Hero's settings gain the same event picker as the Sign-up form, with "No form" as the default. The canvas shows the form card in place.
  • Switching company in the editor clears a hero's event, as it already clears a FORM block's.

Not changing:

  • The FORM block stays as it is.
  • A page may have a hero form and a FORM block together, and each registers for its own event.
  • The form card has no heading of its own; the hero's heading and text introduce it.

Capabilities

New Capabilities

None.

Modified Capabilities

  • landing-pages: hero blocks may carry the sign-up form, and the event-reference rule covers them.

Impact

  • services-counter: CmsBlockValidator, which now checks a HERO's optional eventUuid.
  • mobile-api: PublicPageService, which attaches form info to, and accepts submits for, any block with an event (FORM or a HERO that has one).
  • admin-portal:
    • the HERO rendering in CmsBlocks.tsx;
    • the Hero fields in BlockFields.tsx;
    • the company-switch reset in usePageDraft.ts;
    • two labels, in English and Chinese.
  • No schema change: blocks are JSON.
  • No new dependency.