feat(surveys): add optional intro screen before the first question - #515
Open
jakesciotto wants to merge 2 commits into
Open
feat(surveys): add optional intro screen before the first question#515jakesciotto wants to merge 2 commits into
jakesciotto wants to merge 2 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. Rendered by the Dart survey UI; the native bridges forward the new fields (requires posthog-ios >= 3.70.0 and posthog-android >= 3.59.0). Advancing past it records no response and sends no survey event. Generated-By: PostHog Code Task-Id: 50ceca51-4b90-4b94-8e72-e01bce50073c
|
Reviews (1): Last reviewed commit: "feat(surveys): add optional intro screen..." | 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
Contributor
posthog-flutter Compliance ReportDate: 2026-08-06 22:50:14 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
|
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.
This is the posthog-flutter part of the cross-SDK intro screen rollout tracked in PostHog/posthog#74064. The web/RN renderer shipped in PostHog/posthog-js#4436, and the native SDK parts are in PostHog/posthog-ios#754 and PostHog/posthog-android#677.
What it does:
PostHogDisplaySurveyAppearance/ resolved inSurveyAppearance:displayIntroScreen,introScreenHeader,introScreenDescription,introScreenDescriptionContentType,introScreenButtonText(button defaults to "Get started").IntroMessagewidget, the leading mirror ofConfirmationMessage, shown bySurveyBottomSheetbefore the first question whendisplayIntroScreenis on. The description follows the existing text-only rendering rule.onResponsecall, no method-channelsurveyAction, so no survey event. The X button keeps closing the survey with the normal dismissed event, and the confirmation branch still wins for completed surveys.PostHogDisplaySurvey+Dict.swift,PostHogDisplaySurveyExt.kt) forward the five new keys, since the appearance maps are hand-enumerated.PostHog >= 3.70.0andcom.posthog:posthog-android:[3.59.0,4.0.0)— please confirm the exact Android artifact version once its release ships (the changesets cascade may produce a different number). CI stays red until both are published; the Dart-only changes are green-path.💚 How did you test it?
Unit and widget tests added:
surveys_test.dart:fromDictparses the five intro keys (including the int-coded content type) and defaults to disabled when absent.survey_bottom_sheet_test.dart(new): presents the sheet viashowModalBottomSheetlikeSurveyServicedoes, and asserts the intro shows before question 1, advancing fires noonResponse/onClosedcallback, the off-flag skips the intro, and closing from the intro still notifiesonClosed.Written on Linux without a Flutter toolchain, so the suite was not executed locally — please rely on CI (
flutter test,dart analyze, format checks).📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file (.changeset/survey-intro-screen.md, minor)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
late boolstate field on_SurveyBottomSheetStateinitialized from the appearance; its "Get started" handler is a puresetState, deliberately not routed throughonResponse/_handleCloseso no method-channel call (and therefore no event) can occur on the advance path.Created with PostHog Code