feat(pages): a hero section can carry the sign-up form beside its text #69

Merged
ngqile merged 2 commits from add-hero-signup-form into main 2026-12-03 11:45:48 +00:00
Owner

OpenSpec change add-hero-signup-form. A HERO block may now name an event. Its sign-up form then shows in a card beside the hero text, or below it on phones, the way INS's standalone landing page has it.

What changed

  • services-counter: a hero's optional eventUuid must be an event of the page's company (PagesBadEvent).
  • mobile-api: PublicPageService treats a HERO with an event like a FORM block. It attaches form info or closed, and accepts submits. A hero without an event is refused as not found.
  • portal, hero layout: a two-column hero with the LandingForm card. The image and shade are kept, and the text is top-aligned.
  • portal, editor: the Hero gets a "Sign-up form" event picker, set to "No form" by default. It shares one helper with the FORM block's picker. A company switch clears a hero's event too.
  • Labels: PagesHeroForm and PagesNoForm, in English and Chinese. sql/01-hero-form-labels.sql and a release note are in docs/deployment.md.

Tests

  • Red first: the new validator, service, render, editor and hook tests all failed before the code.
  • Existing test touched: one editor query was scoped to the FORM picker, because the event name now appears in two pickers. Its assertions are unchanged.
  • Results: Maven verify passed for both modules, vitest 1985 passed (exit 0), tsc clean, lint 0 errors.

Live check (Playwright, port 3001, rebuilt services)

  • The picker shows on the hero, and the canvas shows the card.
  • At 1280 px the published form sits beside the text; at 390 px it sits below.
  • A visitor signed up from the hero, and the lead appears under INS website enquiries with source Web page and the page path.
  • The test page was deleted.

Not checked live: the closed state and the other-company refusal. The picker cannot reach either one; unit tests cover both.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs

OpenSpec change `add-hero-signup-form`. A HERO block may now name an event. Its sign-up form then shows in a card beside the hero text, or below it on phones, the way INS's standalone landing page has it. **What changed** - **services-counter:** a hero's optional `eventUuid` must be an event of the page's company (`PagesBadEvent`). - **mobile-api:** `PublicPageService` treats a HERO with an event like a FORM block. It attaches form info or `closed`, and accepts submits. A hero without an event is refused as not found. - **portal, hero layout:** a two-column hero with the `LandingForm` card. The image and shade are kept, and the text is top-aligned. - **portal, editor:** the Hero gets a "Sign-up form" event picker, set to "No form" by default. It shares one helper with the FORM block's picker. A company switch clears a hero's event too. - **Labels:** `PagesHeroForm` and `PagesNoForm`, in English and Chinese. `sql/01-hero-form-labels.sql` and a release note are in `docs/deployment.md`. **Tests** - **Red first:** the new validator, service, render, editor and hook tests all failed before the code. - **Existing test touched:** one editor query was scoped to the FORM picker, because the event name now appears in two pickers. Its assertions are unchanged. - **Results:** Maven verify passed for both modules, vitest 1985 passed (exit 0), tsc clean, lint 0 errors. **Live check (Playwright, port 3001, rebuilt services)** - The picker shows on the hero, and the canvas shows the card. - At 1280 px the published form sits beside the text; at 390 px it sits below. - A visitor signed up from the hero, and the lead appears under INS website enquiries with source Web page and the page path. - The test page was deleted. **Not checked live:** the closed state and the other-company refusal. The picker cannot reach either one; unit tests cover both. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile added 2 commits 2026-12-03 11:45:45 +00:00
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile merged commit d4a2646786 into main 2026-12-03 11:45:48 +00:00
ngqile deleted branch add-hero-signup-form 2026-12-03 11:45:48 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ngqile/co-lite#69