Skip to content

feat(newsletter): add signup modal with HubSpot integration#1758

Open
samuv wants to merge 7 commits intomainfrom
newsletter-modal
Open

feat(newsletter): add signup modal with HubSpot integration#1758
samuv wants to merge 7 commits intomainfrom
newsletter-modal

Conversation

@samuv
Copy link
Collaborator

@samuv samuv commented Mar 18, 2026

Still WIP, we are fine tuning some things

Adds a one-time newsletter signup modal shown on startup. Subscribing persists the state permanently, dismissing suppresses it for 15 days.

  • Add newsletter electron-store and SQLite dual-write for newsletterSubscribed and newsletterDismissedAt, reconciled on startup
  • Expose getNewsletterState, setNewsletterSubscribed, setNewsletterDismissedAt via IPC and preload API
  • Allow https://api.hsforms.com in CSP for HubSpot form submissions
  • Add NewsletterModal component with Zod email validation, HubSpot v3 API submission, success message display, Sentry error capture, and analytics tracking
  • Mount modal in root layout, hidden on /shutdown and /cli-issue routes
Kapture.2026-03-18.at.18.35.24.mp4
Screenshot 2026-03-18 at 18 36 03 Screenshot 2026-03-18 at 18 35 41

@samuv samuv self-assigned this Mar 18, 2026
@samuv samuv changed the title feat(newsletter): add newsletter signup modal with HubSpot integration feat(newsletter): add signup modal with HubSpot integration Mar 18, 2026
@samuv samuv force-pushed the newsletter-modal branch from db908da to d6c9af9 Compare March 18, 2026 15:37
@samuv samuv marked this pull request as ready for review March 18, 2026 17:36
Copilot AI review requested due to automatic review settings March 18, 2026 17:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a startup newsletter signup modal integrated with HubSpot, with persisted “subscribed” / “dismissed” state stored via electron-store and dual-written to SQLite, exposed to the renderer via IPC/preload APIs.

Changes:

  • Implement newsletter state persistence in the main process (electron-store + SQLite dual-write + reconcile-on-startup).
  • Expose newsletter state getters/setters over IPC and add renderer modal UI + HubSpot submission flow.
  • Update CSP to allow connecting to HubSpot submissions endpoint, and add renderer/main tests for the new functionality.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
renderer/src/routes/__root.tsx Mounts NewsletterModal in the root layout (hidden on shutdown/CLI issue routes).
renderer/src/common/mocks/electronAPI.ts Extends Electron API test stub with newsletter state methods.
renderer/src/common/components/newsletter-modal.tsx New modal UI + HubSpot submission + persistence calls via window.electronAPI.
renderer/src/common/components/tests/newsletter-modal.test.tsx New component tests covering visibility, validation, submit, and dismiss behavior.
preload/src/api/app.ts Adds preload IPC API surface for newsletter state get/set methods.
main/src/tests/newsletter.test.ts New unit tests for main-process newsletter store behavior and dual-write.
main/src/newsletter.ts New main-process newsletter store module + SQLite read flag support + dual-write setters.
main/src/ipc-handlers/app.ts Registers IPC handlers for newsletter state operations.
main/src/db/reconcile-from-store.ts Adds newsletter keys to reconcile flow from electron-store to SQLite.
main/src/db/tests/reconcile-from-store.test.ts Extends reconcile tests to assert newsletter keys are synced.
main/src/csp.ts Allows https://api.hsforms.com in connect-src for HubSpot submissions.

You can also share your feedback on Copilot code review. Take the survey.

@samuv samuv linked an issue Mar 19, 2026 that may be closed by this pull request
5 tasks
Copy link
Collaborator

@peppescg peppescg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] Onramp: Periodic newsletter signup prompt

3 participants