Skip to content

Add nao newsletter subscription in account settings#721

Open
ClaireGz wants to merge 6 commits into
mainfrom
claude/confident-goldberg-4d893e
Open

Add nao newsletter subscription in account settings#721
ClaireGz wants to merge 6 commits into
mainfrom
claude/confident-goldberg-4d893e

Conversation

@ClaireGz
Copy link
Copy Markdown
Contributor

@ClaireGz ClaireGz commented May 4, 2026

Summary

  • Adds a "nao Newsletter" row in Settings > Account > General Settings that lets logged-in users subscribe to the nao newsletter.
  • Calls the same https://sunshine.getnao.io/api/waitlist/ endpoint as the "Keep me updated" form on the getnao.io website footer, so signups land in the same database.
  • Persists subscription state in localStorage so the row shows a "Subscribed" check after signing up.

Changes

  • New component: `apps/frontend/src/components/settings/newsletter-subscription.tsx`
  • Wired into the Account settings page next to the Theme selector
  • Added a search index entry so it shows up in settings search

Test plan

  • Visit `/settings/account`, click Subscribe — confirm "You're subscribed!" message and the row switches to a "Subscribed" check
  • Click subscribe again with the same email — confirm "You're already subscribed!" handling
  • Verify the entry appears when searching "newsletter" in the settings search

🤖 Generated with Claude Code

Related issue

#570

ClaireGz and others added 2 commits May 4, 2026 23:01
Lets users subscribe to the nao newsletter directly from Settings > Account
using the same waitlist endpoint as the getnao.io website footer, so signups
land in the same database.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/frontend/src/components/settings/newsletter-subscription.tsx">

<violation number="1" location="apps/frontend/src/components/settings/newsletter-subscription.tsx:9">
P2: Subscription state is stored in a global localStorage key, so it can leak across different user accounts on the same browser.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/frontend/src/components/settings/newsletter-subscription.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🚀 Preview Deployment

URL https://pr-721-10ccd1d.preview.getnao.io
Commit 10ccd1d

⚠️ No LLM API keys configured - you'll see the API key setup flow when trying to chat.


Preview will be automatically removed when this PR is closed.

ClaireGz and others added 2 commits May 4, 2026 23:28
Adds a new "nao" section in the settings sidebar after "Context", with an
"Updates" sub-page that links to the GitHub releases page and lets users
subscribe to the nao newsletter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously the localStorage key was global, so the "Subscribed" state
from one account would persist for any other account signing in on the
same browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/frontend/src/components/settings/newsletter-subscription.tsx">

<violation number="1" location="apps/frontend/src/components/settings/newsletter-subscription.tsx:14">
P2: `subscribed` can become stale when `email` changes because `useLocalStorage` does not re-read from the new storage key. This can show the wrong subscription state until a reload.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Comment thread apps/frontend/src/components/settings/newsletter-subscription.tsx Outdated
ClaireGz and others added 2 commits May 4, 2026 23:44
The previous fix scoped the storage key by email but kept using
useLocalStorage, whose state initializer only runs once. If the
component remounts with a different email, the displayed state was
stale until reload. Switch to plain localStorage with a useEffect
that re-reads on email change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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