feat(forms): add local Form A presentation preview

This commit is contained in:
DeCentN2Madness committed 2026-10-25 13:04:00 -07:00
1 parent b102a061fe
commit 7a6cab29db
13 files changed
+983 -8

No files matched your search

@@ -0,0 +1,121 @@
# Phase 9 Form A Meeting Preview — 2026-10-22
## Scope and baseline
This report records a local, non-submitting preview of the new Jotform Form A visitor journey. The repository remained on `faithful-astro-migration` at `ce17728e0b9a0e148941cfa47b2d074859b24456` when this work began. The Git index was empty, and no production configuration or Jotform account setting was changed.
The preview is available only when all of the following are true:
```text
PUBLIC_AIA_FORMS_MODE=mock
PUBLIC_AIA_FORM_A_PREVIEW=true
PUBLIC_ALLOW_INDEXING is not true
```
Default builds remain `off`. `live` remains fail-closed because no approved live adapter or production form identifier is present. Indexing-enabled builds omit the preview and retain the ordinary inactive fallback.
## Placements and fields
The full Form A preview is rendered on `/contact` and `/es/contact`. It contains the required name, required phone, conditionally required email, preferred contact method, optional message, sensitive-information caution, and a local demonstration control. It intentionally does not include an enquiry-category field. Spanish labels, including the dynamic email-requirement text and internal-preview label, are supplied through the existing locale message architecture.
The compact preview is rendered on `/lp/aba-therapy`, `/lp/aba-insurance`, `/lp/aba-ahcccs`, and `/lp/aba-private-pay`. It contains only name, phone, conditional email, and preferred contact method. It has no message, enquiry-category, or sensitive-information notice. `/lp/early-intervention` was not changed and remains outside this meeting-preview override.
The contact buttons use `Submit` and `Enviar`. Campaign buttons use the approved page CTA: `Request a Free Consultation`, `Request Insurance Verification`, `Request a Benefits Check`, or `Discuss Private-Pay Options`. The production route contract still assigns all four campaign pages to Form B; Form A is a temporary mock-only review override.
Final copy cleanup was verified on 2026-10-23 UTC. In mock mode, each compact campaign preview has one short status line beneath its controls: “Preview only — nothing is submitted.” The same line retains the telephone and privacy-policy links. In off mode, the four campaign panels contain no form-availability notice; a plain support line retains the telephone and privacy-policy links. The compact panels contain no free-text field and therefore contain no sensitive-information disclaimer. Early Intervention likewise contains no free-text field, disclaimer, or unavailable-form notice; its existing telephone CTAs, hours, clinic address, and directions remain available. The hero and separate clinic-contact block retain their contact information without repeating form status.
## Visual fidelity
The mock now uses the established AIA form values from the existing Astro components and tokens: `#ffbd59` button fill and border, transparent hover/focus fill, `#ff914d` hover/focus border, `#254080` text, four-pixel corners, `#fcf9f5` input backgrounds, and `#edeef3` input borders. Keyboard focus retains a separate three-pixel outline. The compact variant relies on the campaign page's existing white form container instead of introducing a nested card surface.
`integrations/jotform/aia-form-a.css` translates these values to narrowly scoped Jotform Classic Forms selectors. `integrations/jotform/README.md` documents installation, iframe/mobile comparison, multilingual verification, honeypot checks, and the multiple-native-Submit-button pattern needed for context-specific accessible labels. The Jotform selectors still require verification against the form's actual generated DOM.
The component does not contain a form element, action, iframe, Jotform URL, form ID, fetch call, persistence mechanism, logging call, email operation, analytics event, or advertising event. The control is `type="button"`; its success state explicitly says that no information was sent or saved. The preview's fields are disabled in the ordinary/off build.
## Validation behavior
Chromium verifies that:
- Name, phone, and preferred contact are required.
- Selecting Email makes the email field required and validates its format.
- Phone preference permits the optional email field to remain empty.
- The local success state is shown only after the local checks pass.
- English and Spanish labels render in their respective pages.
- Every placement uses its approved contextual button text as actual accessible text.
- The rendered button begins with `#ffbd59` fill and border, changes to a transparent fill with `#ff914d` border on hover/focus, retains `#254080` text, and keeps a visible focus outline.
- The sensitive-information caution appears only with the contact-page message field.
- No native `<form>` or iframe is emitted by the preview.
- The six preview routes have one main H1 and no horizontal overflow at 390px and 1440px.
- JavaScript-disabled `/contact` and `/lp/aba-therapy` retain the preview content and an explicit local-preview/no-send notice.
- All five landing pages contain no unavailable/not-enabled form wording and no sensitive-information disclaimer without a free-text field.
- All five landing pages retain non-submitting controls and avoid horizontal overflow at 390px and 1440px in both off and mock builds.
## Guarded browser evidence
Command:
```bash
PLAYWRIGHT_MODULE=/home/alice/projects/wrk/aia/www/aia-aba-landing-pages/node_modules/playwright/index.mjs \
CHROMIUM_EXECUTABLE=/etc/profiles/per-user/alice/bin/chromium \
node tools/form-a-preview-browser.mjs
```
The final mock run completed 16 checks: 14 route/viewport checks (the two Contact pages, four campaign pages, and Early Intervention at 390px and 1440px) and two JavaScript-disabled checks. A separate off-mode run completed ten checks across all five landing pages at the same two widths. Both passed with zero failures and zero production API/form/analytics attempts. The mock run intercepted nine automatic Leaflet requests to `unpkg.com` from the Contact-page map; they were recorded as blocked external resources and did not transmit. No Jotform, AIA API, Google Analytics, Google Tag Manager, Google Ads, or other production request was observed or attempted.
The first preview pass is preserved as the before set in `/tmp/aia-form-a-preview-furat7/`. The final copy-cleanup evidence is in `/tmp/aia-form-a-preview-3YPMT1/`:
| Evidence | Before SHA-256 | After SHA-256 |
|---|---|---|
| `contact-390.png` | `8add0699084e6bced38a8cb0e1c3946da01c2af8695c68d436448fb6108aa1db` | `2a53669580143e0ce0f5fe284bd93b2023bf899e676e4863165e7930ed08b4fc` |
| `contact-1440.png` | `1955196fe16620a5d6e358b4d512989b391389cb3bf02e292f23364202dbb142` | `9d0433eeb76c3f120fd7f75cf8af3edc7e08835736946edbc23312bafc359d64` |
| `campaign-390.png` | `2ed1f939fe8c82a7c282e2568bd174bbe3f7bdf9dd9c3ac5e0107120439a9c0e` | `b63a2dbd9c4b1bf8266021044084a414673ffd6500e2f9a45d24034f77008c84` |
| `campaign-1440.png` | `e352eacd860530ec75cc887a2784dca7287d8520b351e0ed16bda4a340b9e597` | `138c5030e406af1f7689f9ba39fb17a3faf2339c077f86320ea8a9cb56f0bf67` |
The final mock result is `/tmp/aia-form-a-preview-3YPMT1/results.json` with SHA-256 `177711789606a776a747432b6f94d7c9281ac65a8580d20f4075bace933e10a7`. The off-mode result is `/tmp/aia-form-a-preview-e5FUCA/results.json` with SHA-256 `99ff3cb2837f650b72afc37f4c5ff0ad0927bb6117ebeb29af406b72fb1cd8ff`.
### Follow-up validation — 2026-10-25
The final implementation review corrected the Spanish internal-preview label and dynamic email-requirement text. A guarded Chromium mock run completed 16 checks across `/contact`, `/es/contact`, the four campaign pages, and Early Intervention at 390px and 1440px, plus two JavaScript-disabled checks. A separate off-mode run completed ten checks across the five landing pages at the same widths. Both runs passed with zero failures and zero Jotform, AIA API, analytics, advertising, or other production attempts. The Contact-page map made nine automatic Leaflet requests to `unpkg.com` during the mock run; the test guard blocked them before transmission.
## Automated validation
The following checks passed:
| Check | Result |
|---|---:|
| `npm run check` | 133 files, 0 diagnostics |
| `npm run test:markdown` | 20 passed |
| `npm run test:publication` | 33 passed |
| `npm run test:seo` | 35 passed |
| `npm run test:library` | 53 passed |
| `npm run test:routes` | 10 passed |
| Phase 9, Form A, and campaign tests | 21 passed |
| `npm run audit:links` | 0 broken internal links |
| `npm run audit:images` | 0 missing mapped images |
| `npm run audit:blog` | 0 audit failures |
| Normal build | 128 pages |
| Indexing-enabled build with preview flag set | 127 pages; preview omitted |
| `phase10-artifact-verify.mjs --mode=staging` | passed; 128 HTML routes, 0 sitemap URLs, 0 hreflang links |
The final normal staging output was restored after the indexing-enabled verification. Its six target pages contain no active Form A preview marker and retain `noindex,nofollow`. The temporary `/lp` review index remains a staging-only route.
## Files changed
- `src/components/FormAPreview.astro` — new full/compact local preview component.
- `src/components/pages/ContactPage.astro` — explicit gated full preview placement.
- `src/components/campaign/ConsultationForm.astro` — explicit gated compact preview placement for the four Form B campaign journeys.
- `src/utils/form-integration.ts` — non-indexing mock-only Form A preview gate.
- `src/utils/form-messages.ts` — English and Spanish preview labels and states.
- `.env.example` — default-disabled preview flag documentation.
- `tools/form-a-preview.test.mjs` — source-level safety and placement regression checks.
- `tools/form-a-preview-browser.mjs` — guarded Chromium, responsive, validation, no-JavaScript, and network checks.
- `tools/phase9-nonproduction.test.mjs` — preview-gate regression coverage.
- `integrations/jotform/aia-form-a.css` — scoped Jotform Classic Forms visual handoff.
- `integrations/jotform/README.md` — installation and conditional-button verification guide.
- `reports/phase-9-form-a-meeting-preview-2026-10-22.md` — this evidence report.
## Remaining approval requirements
This is suitable for an internal Clinical Director demonstration only. It is not a live intake path. The owner still must complete the new Form A Jotform configuration review, including minimum fields, required flags, English/Spanish behavior, PHI protection, notification and autoresponder contents, confirmation behavior, recipient access, retention, embedding, and synthetic acceptance. The Form A logical mapping remains distinct from the four campaign pages' production Form B mapping. No live Jotform ID or URL was added.
P9-03 privacy/security approval, P9-05 analytics and advertising approval, P9-07 privacy/legal approval, and Phase 10 production authorization remain open. The local preview does not establish HIPAA compliance, operational readiness, or successful submission handling.