feat(surveys): add optional intro screen before the first question - #754
Open
jakesciotto wants to merge 6 commits into
Open
feat(surveys): add optional intro screen before the first question#754jakesciotto wants to merge 6 commits into
jakesciotto wants to merge 6 commits into
Conversation
Adds the leading mirror of the confirmation message: an optional intro screen shown before question 1, configured via the new displayIntroScreen / introScreenHeader / introScreenDescription / introScreenDescriptionContentType / introScreenButtonText appearance fields. Advancing past it records no response and sends no survey event. Intro copy is translatable like the thank-you message. Generated-By: PostHog Code Task-Id: 50ceca51-4b90-4b94-8e72-e01bce50073c
5 tasks
SwiftPM discovers sources automatically but the example apps and CodeQL build the SDK through PostHog.xcodeproj, which lists files explicitly, so every xcodeproj-based job failed with "cannot find 'IntroMessage' in scope". Generated-By: PostHog Code Task-Id: 50ceca51-4b90-4b94-8e72-e01bce50073c
Written by hand following the snapshot format (the mangling model was validated against the existing thankYouMessageDescriptionContentType entry); the Build workflow's apiCheck verifies it against the compiler's own symbol graph. Generated-By: PostHog Code Task-Id: 50ceca51-4b90-4b94-8e72-e01bce50073c
jakesciotto
marked this pull request as ready for review
August 6, 2026 18:51
Contributor
Prompt To Fix All With AI### Issue 1
PostHog/Surveys/IntroMessage.swift:26
**HTML intro descriptions disappear**
When an intro description uses the supported `html` content type, this guard renders nothing, causing respondents to see the intro header and button without the configured description.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "chore(surveys): add intro screen fields ..." | Re-trigger Greptile |
Parity with the web renderer: the intro has no default header, so an intro with neither header nor description would draw an empty sheet with a lone button. Skips straight to question 1 instead. Generated-By: PostHog Code Task-Id: 50ceca51-4b90-4b94-8e72-e01bce50073c
Member
|
moving to draft until we hear from @PostHog/team-surveys |
marandaneto
marked this pull request as draft
August 10, 2026 10:13
Contributor
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
Generated-By: PostHog Desktop Task-Id: de8974e0-537f-4189-a799-66a7bc98cb10
Contributor
posthog-ios Compliance ReportDate: 2026-08-19 21:53:25 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
Main added a PostHogSurveyTranslation call site that predates the three intro screen fields, so the memberwise initializer no longer type-checks. Pass nil for the new fields. Also correct the mangled symbol for introScreenDescriptionContentType in the public API snapshot so the apiCheck diff is clean. Generated-By: PostHog Desktop Task-Id: de8974e0-537f-4189-a799-66a7bc98cb10
jakesciotto
marked this pull request as ready for review
August 19, 2026 21:42
Contributor
|
Reviews (2): Last reviewed commit: "fix(surveys): repair intro screen build ..." | Re-trigger Greptile |
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.
💡 Motivation and Context
Surveys can show a confirmation ("thank you") screen after the last question, but there is no equivalent screen before the first one — the built-in survey sheet drops respondents straight into question 1 with no framing.
This is the posthog-ios part of the cross-SDK intro screen rollout tracked in PostHog/posthog#74064. The web/RN renderer shipped in PostHog/posthog-js#4436; this PR brings the native SwiftUI rendering to parity.
What it does:
SurveyAppearancefields decoded from the API and exposed onPostHogDisplaySurveyAppearance(for custom delegates too):displayIntroScreen,introScreenHeader,introScreenDescription,introScreenDescriptionContentType,introScreenButtonText.IntroMessageSwiftUI view, the leading mirror ofConfirmationMessage, rendered bySurveySheetbefore the first question whendisplayIntroScreenis on.dismissIntroScreen) is a pure UI transition: no response recorded, no survey event sent, no effect on$survey_partially_completed. The X button on the intro still dismisses the survey with the normalsurvey dismissedevent, and the confirmation branch still wins for completed surveys.introScreenHeader/introScreenDescription/introScreenButtonTextin survey translations), wired throughPostHogSurveyTranslation, the resolver's change gate, and the display-appearance overlay.getAppearanceWithDefaultsnever passedthankYouMessageDescriptionthrough to the sheet appearance, so the thank-you description never rendered in the built-in UI. Fixed while mirroring the field for the intro screen.💚 How did you test it?
Unit tests added:
PostHogSurveysTest.swift).PostHogSurveyTranslationsTest.swift).Written on Linux, so the suite was not executed locally — please rely on CI (
make test/ iOS simulator tests). The public API snapshot (api/posthog-ios.public-api.txt) was updated by hand following the snapshot format; the Build workflow'sapiCheckverifies it, andmake apiUpdateon macOS produces the canonical version if it disagrees.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file (.changeset/survey-intro-screen.md, minor)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
@Published showingIntroScreenflag onSurveyDisplayController, initialized inshowSurveyand flipped by a dedicateddismissIntroScreen()that deliberately does not touchdismissSurvey()/onSurveyClosed, so no event can leak from the advance path. The confirmation branch stays first insurveyContentso a completed survey never shows the intro.Created with PostHog Code