Skip to content

GitHub star nudge after export, and a cookieless returning-visit metric - #52

Merged
joancomadran merged 1 commit into
mainfrom
cursor/star-nudge-returning-visit-8424
Nov 30, 2026
Merged

joancomadran merged 1 commit into
mainfrom
cursor/star-nudge-returning-visit-8424

Conversation

@joancomadran

Copy link
Copy Markdown
Owner

After the second successful export, the editor shows a one-time GitHub star card. On editor load, a later calendar day sends a cookieless returning-visit event. Photo data, privacy copy, titles, and the Amazon affiliate links are unchanged. No new dependencies.

Changed files

  • src/lib/analytics.ts — star_nudge_shown, star_nudge_clicked, and returning_visit
  • src/lib/starNudge.ts — once-per-device export count and card state
  • src/lib/returningVisit.ts — first and last visit calendar days
  • src/lib/editorCopy.ts — English and Spanish card copy
  • src/components/StarNudge.tsx — non-modal card (focusable, Escape dismisses)
  • src/App.tsx — mounts the card
  • src/hooks/useEditorSession.ts — counts an export where export_completed fires
  • src/EditorRoot.tsx — records the visit on editor load
  • src/index.css — card layout, including the phone dock
  • scripts/star-nudge.test.mjs
  • scripts/returning-visit.test.mjs
  • e2e/engagement.spec.ts

localStorage keys

  • lightframes:star-nudge — { "exports": number, "outcome"?: "shown" | "dismissed" | "clicked" }. The first successful export only stores the count. The second sets outcome to shown and opens the card. Dismiss sets dismissed. The star link sets clicked. Any outcome means the card never returns.
  • lightframes:visits — { "first": "YYYY-MM-DD", "last": "YYYY-MM-DD" }, local calendar days. The first visit only writes the key. A new day updates last and fires the event at most once that day.

No cookies, ids, or photo data.

Analytics events

Sent through the existing emit helper in src/lib/analytics.ts:

  • star_nudge_shown — no properties
  • star_nudge_clicked — no properties
  • returning_visit — days_since_first: 1, 2-7, 8-30, or 30+

1 is the next calendar day, 2-7 is days 2 through 7, 8-30 is days 8 through 30, and 30+ is day 31 onward.

Checks

npm test, npm run lint, and npm run build passed. Playwright e2e/engagement.spec.ts passed on desktop and mobile Chromium.

Star card on desktop after the second export
Star card on a phone, above the dock

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

…sits.

The star card is once per device and the visit metric stays in localStorage, sending only a day bucket through the existing analytics helper.

Co-authored-by: Joan Comadran <joancomadran@users.noreply.github.com>
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lightframes Ready Ready Preview Nov 30, 2026 6:14pm UTC

Request Review

@joancomadran
joancomadran merged commit 796b211 into main Nov 30, 2026
5 checks passed
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.

2 participants