fix: make footer newsletter signup submit - #632
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@nyxsky404 is attempting to deploy a commit to the Durgeshwar's projects Team on Vercel. A member of the Team first needs to authorize it. |
Resolve Readme conflict by keeping both the footer newsletter note and same-name PDF merge wording. Co-authored-by: Cursor <cursoragent@cursor.com>
Backend CI failed because conftest replaced PIL with MagicMock, leaving img.size unpackable. Use the real Pillow install in tests instead. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@Durgeshwar-AI The CI issue has been fixed. What was failing
What we changed
Current status
|
nyxsky404
left a comment
There was a problem hiding this comment.
Review (cannot approve own PR as @nyxsky404)
Looks good to merge from a code perspective.
- Footer Stay Updated form has validation + loading/success/error feedback
- Local mailto compose keeps the flow zero-storage / no third-party newsletter API
- Helper unit tests cover validation and mailto construction
- GitHub Actions
backend+frontendare green after the conftest Pillow mock fix and main merge - Remaining red check is Vercel fork deploy authorization only (not a code failure)
|
@Durgeshwar-AI This PR is mergeable (no conflicts with The remaining Vercel failure is a team authorization/ |
|
Hi @Durgeshwar-AI — gentle nudge. This PR is ready for review and merge from my side (conflicts resolved / up to date; remaining red checks if any are non-blocking deploy/preview noise like Vercel). Could you please review and merge when you get a chance? Thank you! |
There was a problem hiding this comment.
Pull request overview
This PR fixes the landing-page footer “Stay Updated” newsletter signup by adding controlled form state, validating email input, and initiating a privacy-preserving “subscription” via a local mailto: compose (no backend storage / no external newsletter API), aligning with the repo’s project rules.
Changes:
- Added shared utilities to validate email input and construct a newsletter
mailto:link. - Wired the footer form to controlled state with loading/success/error feedback on submit.
- Added Vitest coverage for the new newsletter utility functions and updated README feature list.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Readme.md | Documents the footer newsletter signup behavior in the feature list. |
| frontend/src/utils/newsletterSignup.ts | Adds email validation + mailto: link builder helpers. |
| frontend/src/utils/newsletterSignup.test.ts | Adds Vitest tests for email validation and mailto generation. |
| frontend/src/components/Landing/Footer.tsx | Implements controlled newsletter form state and submit handler with UI feedback. |
| backend/conftest.py | Adjusts test module mocking list (removes PIL from mocked modules). |
Suppressed comments (1)
frontend/src/components/Landing/Footer.tsx:212
- The feedback message uses
role="status"even for validation/configuration failures. For error states,role="alert"(or assertive live region) is more appropriate so the message is announced immediately to screen readers.
<p
id="footer-newsletter-status"
role="status"
className={`mt-2 text-xs ${
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| try { | ||
| // Privacy-first: no backend storage or third-party newsletter API. | ||
| // Open the local mail client so the visitor can confirm interest. | ||
| window.location.href = buildNewsletterMailto(email, contactAddress); | ||
| setStatus("success"); | ||
| setStatusMessage("Thanks! Confirm the message in your email client."); | ||
| setEmail(""); | ||
| } catch { | ||
| setStatus("error"); | ||
| setStatusMessage("Could not open your email client. Try again."); | ||
| } |
| autoComplete="email" | ||
| aria-invalid={status === "error"} | ||
| aria-describedby="footer-newsletter-status" | ||
| disabled={status === "loading"} |
| **PDF Tools:** | ||
|
|
||
| - Convert PDF pages to PNG (single page, range, or all pages) | ||
| - Footer “Stay Updated” signup validates email and opens a local mailto compose (no server storage) |
Pull Request
Issue Reference
Closes #610
Summary
Screenshots (if applicable)
NA
Checklist
Related Issues / PRs
NA
Open Source Program Participation
Program Name: GSSoC
Additional Notes
No third-party newsletter API and no backend email storage, matching the project privacy rules. Focused Vitest checks, typecheck, and production build pass.