Repository navigation
feat(surveys): add Skip button to optional questions #758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gantoine
wants to merge
3
commits into
main
Choose a base branch
from
posthog/survey-skip-button
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+423
−12
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "posthog_flutter": minor | ||
| --- | ||
|
|
||
| Optional open text, rating, single choice and multiple choice survey questions now show a separate Skip button below Submit, and Submit stays disabled until the question is answered. Skip sends the empty response (`""` for open text, no answer for the other types) and discards any answer already entered. Optional questions that submit automatically also show Skip. The Skip label comes from the survey's `skipButtonText` appearance setting and defaults to "Skip". |
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
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
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
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
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
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
36 changes: 36 additions & 0 deletions
36
posthog_flutter/lib/src/surveys/widgets/survey_button.dart
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up: Pre-existing cross-SDK divergence worth a policy decision in
PostHog/sdk-specs(not a regression or merge blocker for #758 — merge base28c95988already emitted''for empty optional open-text submit, matchingposthog-js#5995).Observed behavior across the native bridges and backend:
''→ Android (PostHogFlutterSurveysDelegate.kt:168-169) wraps it asPostHogSurveyResponse.Text("")and iOS (PosthogFlutterPlugin.swift:811-812) wraps it as.openEnded("").PostHogSurveysIntegration.kt:1036,1060-1062andPostHogSurveyIntegration.swift:794,817-829),""is non-null, sosurveyHasResponsesreturnstrue. If a user skips Q0 (optional open text) and then dismisses Q1 without answering anything,survey dismissedis captured with$survey_partially_completed: trueand$survey_response_<id>: "".PostHog/posthog(products/surveys/backend/responses/fetch_rows.py:125-128),RESPONSE_EVENT_FILTERincludessurvey dismissedevents where$survey_partially_completed = 'true', counting the skip-then-dismiss as a partial response row.null, and both delegated native cores' own UIs sendnull/nilon open-text skip (posthog-android#1030SurveySheet.kt:189,posthog-ios#1146QuestionTypes.swift:138), keeping$survey_partially_completed: false.Because
posthog-js#5995(browser & RN) also sends"", consider opening a cross-SDK policy decision inPostHog/sdk-specs(Client Libraries / Surveys teams) on whether skipped optional open-text should emitnull/omitted or""(and whethersurveyHasResponsesshould treat""as unanswered) rather than changing it ad hoc here.