fix(onboarding): point no-events banner to env token page#60534
Merged
Conversation
The "real_project_with_no_events" banner linked to urls.settings() which
defaults to /settings/project. Loading that URL on the Settings scene
immediately redirects to the first available section (project-details).
For users already on project-details (e.g. after copying their project ID),
clicking the link was a no-op — the same-page redirect produced no visible
state change.
Point the link directly at /settings/environment-details#variables, which
is where TeamVariables actually renders the project token and ID. That
matches the banner copy ("grab your project API key/HTML snippet") and
ensures the link always navigates somewhere useful.
Generated-By: PostHog Code
Task-Id: 3d91c685-accf-4951-bcff-50aa0adcd0cc
Contributor
|
Reviews (1): Last reviewed commit: "fix(onboarding): point no-events banner ..." | Re-trigger Greptile |
Contributor
|
Size Change: 0 B Total Size: 80.7 MB ℹ️ View Unchanged
|
rafaeelaudibert
approved these changes
May 28, 2026
Contributor
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
rorylshanks
pushed a commit
that referenced
this pull request
May 29, 2026
Co-authored-by: posthog[bot] <206114724+posthog[bot]@users.noreply.github.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.
Problem
Brand-new users see a banner on every page when their project has no events: "This project has no events yet. Go to the onboarding flow or grab your project API key/HTML snippet from Project Settings to get things moving." The "Project Settings" link points at
urls.settings(), which defaults to/settings/project.That URL loads the Settings scene, whose
urlToActionhandler immediately redirects to the first available project-level section —project-details. For a user who's already landed onproject-details(for example after navigating to the Settings page to copy their project ID), clicking the banner link just rewrites the URL to the page they're already on with no visible state change, so the click looks broken. Worse, the project token and SDK snippet aren't even onproject-details— they live atenvironment-details#variables, rendered byTeamVariables.A signal report (see Agent context below) flagged a real session where a new user repeatedly clicked the banner on the same page, accumulating 8 pageviews on
/settings/project-detailsand 7 on/settings/projectwith no other navigation.Closes signal report
019dc70c-48c7-7fb9-96ed-0f74a0b1d32c.Changes
frontend/src/layout/navigation/projectNoticeLogic.tsx: change theLinkfor thereal_project_with_no_eventsnotice fromurls.settings()tourls.settings('environment-details', 'variables'). That deep-links straight to "Project token & ID" in the environment-level General settings, which matches the banner copy ("grab your project API key/HTML snippet") and guarantees the link always navigates somewhere visible — even when the user is already on/settings/project-details.How did you test this code?
I'm an agent (Claude Code / Opus 4.7). I did not run the dev server or test this in a browser. Verified:
SettingsMap.tsxexposes a section withid: 'environment-details'(line 168) containing a setting withid: 'variables'(line 172), rendered byTeamVariables.urls.settings(section, setting)produces/settings/<section>#<setting>viacombineUrl, so the link resolves to/settings/environment-details#variables.projectNoticeLogic.test.tscover this code path; the existing test file only exercises proxy-record loading.Automatic notifications
🤖 Agent context
019dc70c-48c7-7fb9-96ed-0f74a0b1d32c.inbox-reports-retrieve) to fetch the report; Read/Grep/Edit for codebase navigation and the fix;git_signed_commitfor the signed commit./settings/*and the destination still shows the project token. Keeping the diff minimal — text-only changes can ride on a separate PR if the design team wants them.'snippet'instead of'variables'. Picked'variables'because the banner mentions the API key first and the SDK snippet second, and "Project token & ID" is the canonical credential page.