feat: add ?city and ?languages prefill params to onboarding embed#951
feat: add ?city and ?languages prefill params to onboarding embed#951hturnbull93 wants to merge 2 commits into
Conversation
Allows the iframe host to prefill the city field and languages multiselect via URL query params, consistent with the existing ?country param. - ?city=Berlin → prefills city input - ?languages=German,English → prefills languages (comma-separated stored values) Invalid/unrecognised language values are silently dropped; falls back to ['English'] if nothing valid is provided. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015aKhZeP6x8pgBkDEraXGUs
✅ Deploy Preview for pauseai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Implementation of logic for defaulting an empty set of valid languages to just Englush looks wrong? Check size after filter, no? L122-124.
There was a problem hiding this comment.
well spotted, fixed :)
There was a problem hiding this comment.
I see the existing pattern being extended with more specific cases, but seems possibly better to generalize and simplify. Why not allow an initial value for any field?
There was a problem hiding this comment.
the fields country, city and languages are the only fields that can sensibly be prefilled, the rest of the fields would be particular to an individual
There was a problem hiding this comment.
How are we currently documenting or tracking who embeds and what we support? External interfaces need curation.
There was a problem hiding this comment.
sure, documented now
Language default check ran before filtering invalid values, so an all-invalid ?languages= param produced an empty selection instead of falling back to English. Also removes the unused/dead initialEmail prop and documents the /embed/onboarding-form route and its query params in ONBOARDING_EMBED.md, linked from the README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018hV7D3mAfDrxytSxnaXZXf
|
@anthonybailey happy to rereview? |

Summary
?city=<value>query param to prefill the city field in the onboarding embed iframe?languages=<comma-separated>query param to prefill the languages multiselect (e.g.?languages=German,English)['English']if nothing valid is provided?country=param behaviourTest plan
?city=Berlin→ city field prefilled with "Berlin"?languages=German,English→ languages multiselect prefilled with German and English?languages=InvalidLang→ falls back to English (invalid value dropped)?country=Germany&city=Berlin&languages=German→ all three params work together🤖 Generated with Claude Code
https://claude.ai/code/session_015aKhZeP6x8pgBkDEraXGUs