refactor: Extract collagen signup logic from join.md#657
Open
RisingOrange wants to merge 2 commits intoPauseAI:mainfrom
Open
refactor: Extract collagen signup logic from join.md#657RisingOrange wants to merge 2 commits intoPauseAI:mainfrom
RisingOrange wants to merge 2 commits intoPauseAI:mainfrom
Conversation
…nup component Moves the collagen campaign logic (URL param detection, state management, conditional banners, newsletter pre-fill) out of join.md into a dedicated CollagenSignup.svelte component. Exports userHasUid, subscribeEmail, and newsletterEmail as bound props so join.md can share state with the bottom newsletter signup and conditional note.
✅ Deploy Preview for pauseai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…cking on:submit is more semantically correct than detecting click events on the submit button. submit events bubble and cover all submission paths regardless of browser-specific synthetic click behaviour.
539b662 to
9a93b9a
Compare
Collaborator
|
Thank you! I'd like Anthony to review and perform the testing because he knows more about the requirements, but it'll probably take a while because of PauseCon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #529
Summary
src/posts/join.mdinto a newsrc/lib/components/CollagenSignup.sveltecomponentuserHasUid,subscribeEmail, andnewsletterEmailas bound props sojoin.mdcan share state with the bottom newsletter signup and conditional noteon:clicksubmit detection withon:submiton the wrapper div — more semantically correct and doesn't rely on the synthetic click behaviour specified in the HTML implicit submission algorithmNote on submit tracking
The original code used a click handler to detect newsletter submission. This works because per the HTML spec, pressing Enter in a form field fires a click event on the default submit button before firing the form's submit event. The
on:submitapproach is cleaner and more direct, but this is a code quality change rather than a bug fix.Test plan
/join— page renders correctly, no banner shown/join?collagen_uid_sayno=xxx&subscribe-email=test@example.com— welcome banner shown, email pre-filled in top and bottom newsletter forms, share link visible