Add nao newsletter subscription in account settings#721
Open
ClaireGz wants to merge 6 commits into
Open
Conversation
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>
Contributor
There was a problem hiding this comment.
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.
Contributor
🚀 Preview Deployment
Preview will be automatically removed when this PR is closed. |
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>
Contributor
There was a problem hiding this comment.
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.
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>
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.
Summary
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.Changes
Test plan
🤖 Generated with Claude Code
Related issue
#570