Skip to content

Make the onboarding email preview readable for chapter leads - #1137

Merged
RisingOrange merged 27 commits into
PauseAI:mainfrom
RisingOrange:feat/onboarding-email-preview-for-chapter-leads
Sep 18, 2026
Merged

RisingOrange merged 27 commits into
PauseAI:mainfrom
RisingOrange:feat/onboarding-email-preview-for-chapter-leads

Conversation

@RisingOrange

@RisingOrange RisingOrange commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Rewrites /onboarding-email-preview for the people who will actually use it — Irina and chapter leads deciding whether to write their own welcome email — instead of for developers checking a render. The page now explains the email, tells chapters how to write or translate their own, and keeps the code detail in a collapsed "For developers" section. Same route and query-string state; the email rendering is untouched apart from two copy changes, noted below.

What a chapter lead sees

  • Intro saying what the email is, that most countries get the shared email with a short part about their local chapter, and which chapters write their own (named from the override data, capped at four names), and a line saying the chapter part's links are the ones on pauseai.info/national-groups and can be changed by sending new ones to PauseAI Global.
  • "Writing your chapter's own email", open above the form: translate the shared email or write your own, one email or one per group, translate the confirmation line and newsletter lines (quoted from FIXED_COPY, so they match what is sent), mention PauseAI Global's welcome calls and Discord, branded card unless you ask for the plain note, and send your text and social links to PauseAI Global.
  • Controls: first name, country (chapters that write their own are marked), Intent (None / Act now / Volunteer / Lead), Language, Layout. Every change re-renders; no submit button.
  • Language shows the language the email is actually in, locked with the reason when it isn't a choice: a chapter's own email, the None / Act now email (English only), or a volunteer from a Spanish-speaking country (always Spanish).
  • A one-sentence summary of what the signup gets, matching copy.ts: e.g. "This is the welcome email for people who want to volunteer, in English. It says PauseAI Germany will be in touch, and lists the chapter's links, the same ones as on pauseai.info/national-groups."
  • Copy text, a Desktop / Phone width toggle, and "Show as text". Copy HTML is in the developer section.
  • Opens on the shared email rather than PauseAI UK's own; one-column layout on phones.

Code changes worth a look

  • describeChapterOverride() returns { name, scope } instead of a string; only the preview page calls it.
  • fitFrame.ts: one Svelte action sizing the email iframe, now shared with /onboarding-email-compare, which had its own copy. It re-measures on image load and on width change instead of after a fixed 500 ms.
  • The load runs its three calls in Promise.all, drops the subscribed handling the page no longer exposes, and drops the preview-origin asset rewrite: the email images are already on pauseai.info. (The compare page keeps its own rewrite; untouched here.)
  • Non-volunteers outside the Spanish-speaking countries are routed to English in the load, so a locked (unsubmitted) language control can't carry a hidden Spanish route that changes the chapter part.

Changes to live email copy

  • fixed.ts: the shared email's line for people who left the newsletter box unticked loses its em dash: "You didn't opt in to our newsletter, so we won't add you to it. We may still occasionally send you a critical alert."
  • A chapter's own email now always carries one newsletter line, the conditional "If you opted in, we'll keep you posted. Either way, we may occasionally send you a critical alert." (and its Spanish / Swedish equivalents), whatever the signup chose. Before, subscribers got a third, definite line, and Spanish and Swedish spelled out "you didn't subscribe" while English hedged. Affects PauseAI Sverige, PauseAI UK and PauseAI Canada's emails.

Checks

pnpm check 0 errors, eslint / stylelint / prettier clean, onboardingEmail tests pass (19). Exercised against live National Groups data across countries, intents and languages, and reviewed by Codex (three rounds) and Fable (two rounds; the second also drove the page in headless Chrome).

Review findings

From simplify, Codex (three rounds), Fable (two rounds) and our own checks.

# Finding Found by Outcome
1 Summary told Spanish non-volunteers their country had no chapter simplify Fixed
2 Summary called the chapter part a block "at the end"; volunteers get "will be in touch", non-volunteers with no links get none Codex Fixed
3 Page opened on PauseAI UK's own email, not the shared one Fable Fixed
4 Layout hint said every chapter gets one layout or the other Fable Fixed
5 Intent hint said each intent gets its own wording Codex Fixed
6 Copy HTML copied preview-only image URLs simplify Fixed; the rewrite was later dropped (images are on pauseai.info)
7 Copy could copy the previous email mid re-render Codex Fixed
8 Blank selects for a country not in the list or an unknown intent Codex, Fable Fixed
9 Empty first name gave "Welcome to PauseAI, !" Fable Fixed
10 Frame sizing guessed 500 ms for images; duplicated in the compare page simplify, Codex Fixed (fitFrame.ts, shared)
11 Frame sizing threw while a new srcdoc was loading Fable Fixed
12 Three Airtable calls in sequence per re-render simplify Now parallel; caching not done
13 Form cramped on phones; radio groups, hints and copy status not accessible Codex, Fable Fixed
14 toSorted would break the page on pre-2023 browsers Fable Fixed
15 Spain etc. previewed an English email nobody there gets Codex, Fable Fixed: Spanish forced, control locked
16 Español shown next to an English email (None / Act now) owner Fixed: control shows the actual language
17 Locked language dropped a hidden Spanish choice, changing the email on the next click Codex, Fable Fixed: routed on the server
18 Sweden's language couldn't be shown by the radios Codex Fixed: locked language shown as text
19 "Spain and Latin America" wrong (Brazil gets English) Codex Fixed
20 Padded ?intent= showed a different choice from the one rendered Codex Fixed
21 "Active chapters" count included the US, which gets no chapter part Fable Fixed
22 Summary pointed to /communities, which lists different links owner Fixed: /national-groups
23 Guide didn't say which lines to translate Fable Fixed: quoted from FIXED_COPY
24 Guide quoted chapter-only lines as if every email had them Codex Fixed
25 Chapter emails' newsletter line: Spanish and Swedish contradicted the comment owner Changed: one conditional line for all chapter emails (live copy)
26 Stale subscribed comments; no Swedish test Codex Fixed
27 Preview shows the hedged newsletter line; live shared emails state the opt-in Codex, Fable Kept: no control, by decision
28 Copy HTML is noise for chapter leads Codex, Fable Moved to the developer section
29 Hardcoded "as PauseAI UK and PauseAI Sverige did" owner Replaced
30 No contact given for sending text Codex, Fable Left for now, by decision
31 Guide above the form delays the preview Codex Kept, by decision
32 Separate Volunteer and Lead options Codex Declined: they render the same email

Link to share

https://main--pauseai.netlify.app/onboarding-email-preview (the page 404s on pauseai.info by design).

…iew the copy

The preview is about to be handed to chapter leads and organisers deciding
whether to write their own welcome email, so the page now explains the email
rather than the code that renders it.

- Plain-language intro: what the email is, when it is sent, that a chapter
  block is appended to the shared copy and that some chapters replace it.
- Example chips for the cases worth seeing side by side: no chapter, a chapter
  block, keeping informed, Spanish, and one per chapter that writes its own.
  They carry the reader's own name and opt-in setting over.
- Controls read as questions about the signup ("Why they signed up") rather
  than Airtable field names, each with a line on what it changes.
- The resolved panel becomes a sentence naming the chapter; the bucket/group
  breakdown moves into a developer section with the module paths and the
  compare-page link.
- Copy text / Copy HTML, so a chapter can take the current wording as a basis
  for translating or rewriting, plus a phone-width preview.
- A section on what a chapter supplies versus the two lines always added for
  them, since losing the confirmation line leaves the reader unconfirmed.

describeChapterOverride() now returns the chapter's name alongside its scope,
so the country picker can say who writes its own email rather than that
someone does.
@netlify

netlify Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pauseai canceled.

Name Link
🔨 Latest commit 20fb070
🔍 Latest deploy log https://app.netlify.com/projects/pauseai/deploys/6aac2dac843ec2000717867a

- Drop the newsletter opt-in control: the sign-up form won't pass the answer
  through, so only the hedged wording is ever sent.
- Drop the Update preview button; every control re-renders on change, and
  Enter in the name field still submits.
- Label the intent field Intent with the Airtable values, as reviewers know them.
- Point to pauseai.info/communities for where chapter links come from, and
  reword the message shown when the chapter list fails to load.
…d of offering example presets

The presets mostly set one field the form already offers, and the one
shared-copy example was just the alphabetically first chapter. What they
did add, pointing reviewers at the chapters that write their own email,
now sits in the intro, built from the same override data so it stays
current.
…o link PauseAI Global

- Say which render to copy as a base (their country, Volunteer / Lead) and
  that a chapter can write one email or one per group.
- Ask chapters to point new volunteers to the global welcome calls and
  Discord, as PauseAI Sverige's email does. The links come from brand.ts
  through the load, so the advice can't drift from what the emails send.
- Drop the line about self-service editing in the CRM.
…ne, not Volunteer

A chapter's own email covers None and Act now as one version, and the
shared copy for those two differs only in subject, first line and closing.
…bing a base email

PauseAI UK's and Sverige's own emails aren't adaptations of the shared copy,
so the page offers translating it or writing from scratch rather than naming
an intent to start from. Where chapter links live is ours to decide; the
chapter's part is to send them.
…djust it

- Show it open under the intro rather than collapsed at the bottom, where
  it was easy to miss.
- Ask chapters writing in another language to translate the confirmation
  line and newsletter note, instead of leaving them out.
- Drop the pointer to the Swedish email as a model for the global line;
  readers elsewhere can't read it.
- Say non-volunteers rather than everyone else.
…ntro names

Past four the sentence names three and counts the rest; each is still
marked in the country picker.
…for their own email

The branded card is the default when an override sets no htmlStyle.
Fixes from a simplify pass and Codex/Fable reviews of the page for chapter leads.

What the page says:
- The summary sentence follows copy.ts: a volunteer's chapter part says the
  chapter will be in touch; a non-volunteer's is left out when the chapter
  has no links; a Spanish non-volunteer gets English with no chapter part,
  where it used to claim the country had no chapter.
- The page opens on the shared email rather than PauseAI UK's own.
- The Layout hint no longer says every chapter gets one or the other: the
  shared email is always the branded card.
- The intent hint no longer says each intent gets its own wording.

Behaviour:
- Copy HTML copies the email as sent; the frame alone gets the preview's
  asset URLs, which stop resolving once the deploy preview is gone.
- Copy is disabled while a re-render is in flight, when it would copy the
  previous email; its status is announced and clears when the email changes.
- A country missing from the chapter list, or an unknown intent, keeps an
  option instead of leaving its select blank. An empty name falls back.
- One column on phones; hints tied to controls; radio groups labelled.
- "Show as text" instead of "Show plain text", next to the Plain note layout.

Code:
- fitFrame.ts replaces the frame-sizing code duplicated in the compare page,
  and re-measures on image load and width change instead of after 500ms.
- The three Airtable-backed calls in the load run in parallel.
- Lookup tables typed by their unions; Intl.DisplayNames for language names;
  one radio-group snippet; dead subscribed handling and CSS removed.
…king countries

A signup from one of those countries gets Spanish whatever languages they
listed, so previewing it in English showed an email nobody there receives.
The English option is disabled for them; elsewhere the choice stays and
stands in for having listed Spanish.
…w's language control

Español stayed selected for a Spanish-speaking country's None and Act now
signups, whose email is English: only the volunteer email has a Spanish
version. The control now shows the language the email is in and is locked,
with the reason, whenever the language isn't a choice: a chapter's own
email, a non-volunteer, or a volunteer from a Spanish-speaking country.
"None and Act now only exists" read as "now only exists"; the Spain hint
didn't say it is about volunteers or that listed languages don't change it.
- Route a non-volunteer outside the Spanish-speaking countries to English on
  the server. Their language control is locked, so it isn't submitted: a
  Spanish choice carried in from before (e.g. Volunteer + Español, then None)
  dropped the chapter part, and the next control change brought it back with
  nothing on screen saying why.
- Show a locked language as text instead of greyed radios, which could not
  show Swedish at all and did not read as locked.
- Trim the intent once, so a padded value shows the choice it renders.
- fitFrame: skip measuring while a new srcdoc has no document element yet,
  which threw on every switch back from the text view.
- Put the rendered HTML in the frame as is: the email images are on
  pauseai.info already, so the preview-origin rewrite, and the second copy
  of the HTML kept for Copy HTML, weren't needed.
- Say "Spanish-speaking countries", not "Spain and Latin America" (Brazil
  gets English, Equatorial Guinea Spanish), and that US signups get no
  chapter part because PauseAI US welcomes its own members.
- Array sort in place of toSorted, which would stop the page's script on
  browsers before 2023.
- Quote the confirmation line and both newsletter lines a chapter's own
  email carries, taken from FIXED_COPY so the guide can't drift from what
  is sent, instead of describing them.
- Point to "the chapters named above" rather than naming two of them,
  which left out Canada and would go stale.
- Say a chapter's email replaces the shared text, not that it does so
  "entirely": the fixed lines stay.
- Move Copy HTML into the developer section; chapter leads want the text.
…letter line

This line goes out in the live shared email to anyone who left the
newsletter box unticked.
A chapter-written email now always carries the conditional "If you opted
in, we'll keep you posted…" line, whatever the signup chose. English already
used it for anyone who hadn't subscribed, while Spanish and Swedish spelled
out "you didn't subscribe", against the comment that said they shouldn't; a
subscriber got a third, definite line. The shared email still states the
newsletter promise once the opt-in is known.

This changes live copy: PauseAI Sverige's email and the English chapter
emails lose their subscriber-specific lines. The preview guide now quotes
the single line.
…line

- Comments on `subscribed` said undefined keeps the hedged wording in
  general and cited an older preview link; it now only affects the shared
  email's line, and the preview pages never pass it.
- Test the Swedish chapter line across opt-in values, as well as the UK's.
- The preview guide quotes the chapter-email lines, so say it is chapter
  emails that carry them.
…mary

The sentence is about which email this is; the name only shows up in it.
… not /communities

The email's chapter links come from the National Groups table, which
/national-groups shows; /communities is built from a JSON file in the
repo with one link per chapter.
@RisingOrange
RisingOrange marked this pull request as ready for review September 18, 2026 18:15
@RisingOrange
RisingOrange merged commit beab6e9 into PauseAI:main Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant