feat: add PostHog custom survey modal on second app launch#4604
Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Open
feat: add PostHog custom survey modal on second app launch#4604devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
- Add AppOpenCount and SurveyDismissed store keys in Rust backend - Add increment_app_open_count, get/set_survey_dismissed Tauri commands - Create SurveyModal component with 4 select/multi-select questions - Show survey on second app open, capture 'survey sent' PostHog event - Questions: discovery source, why Char, role, current note-taking Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote canceled.
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[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.
Summary
Adds a 4-question onboarding survey that appears as a modal dialog on the user's second app launch (after a full quit). Responses are captured as PostHog custom survey events via the existing analytics plugin.
Backend (Rust): Two new persisted store keys (
AppOpenCount,SurveyDismissed) with Tauri commands to increment the open count and track whether the survey was dismissed/submitted.Frontend (React):
SurveyModalcomponent rendered insideEventListeners. On mount, it increments the app open count and shows the dialog when count is ≥ 2 and the survey hasn't been dismissed. The modal steps through 4 questions (select/multi-select), then fires a"survey sent"event with PostHog's$survey_id/$survey_responseproperty convention.Questions:
Review & Testing Checklist for Human
SURVEY_IDis set to"onboarding_survey_v1"— you'll need to create a matching API-mode survey in the PostHog dashboard (or replace with the actual UUID) for responses to appear correctly in the PostHog survey UI.tauri.gen.ts). Runcargo test export_typesinapps/desktop/src-taurito regenerate and confirm the manual additions match specta's output.analyticsCommands.eventpayload cast: The PostHog event payload is built asRecord<string, unknown>then cast viaas. Verify the analytics plugin actually accepts arbitrary properties, or the extra$survey_response_*keys may be silently dropped."survey sent"event appears in PostHog. Relaunch a third time and confirm the survey does not reappear. Also test dismissing (clicking X / closing) and confirm"survey dismissed"fires and the modal does not return.Notes
$survey_responsefor Q1 and$survey_response_Nfor subsequent questions. Multi-select answers are sent as arrays; single-select as strings.>= 2(not strict equality) combined with theSurveyDismissedflag, so if something goes wrong on the second launch the user will still see the survey on subsequent launches.libpipewire-0.3in CI environment) and unrelated to these changes. macOS desktop_ci and fmt checks pass.Link to Devin session: https://app.devin.ai/sessions/3f4f1d83f2dd40a5aa6d39fd8b0bbe9f
Requested by: @ComputelessComputer