Repository navigation
Conversation
Optional open text, rating, single choice and multiple choice questions now disable Submit until answered and show a separate Skip button. Adds the skipButtonText appearance field, parsed from the native appearance map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
posthog-flutter Compliance ReportDate: 2026-12-04T14:35:19.912132+00:00 ✅ All Tests Passed!232/232 tests passed Capture_V1 Tests✅ 105/105 tests passed View Details
Capture_Ai_V1 Tests✅ 110/110 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
dustinbyrne
left a comment
There was a problem hiding this comment.
The Dart survey UI changes (disabled Submit until answered, separate low-emphasis SurveySkipButton on optional open text, rating, single choice, and multiple choice questions including auto-submit, and answer discarding on Skip) are clean and well-tested.
One Concern on staged release / changelog accuracy (inline on .changeset/quiet-owls-skip.md), along with two optional Suggestions and a pre-existing cross-SDK Follow-up inline.
Follow-up (outside this repository): skipButtonText is not yet present in PostHog/posthog (products/surveys/backend/api/survey.py, products/surveys/backend/translation.py, frontend/src/scenes/surveys/surveyVersionRequirements.ts) or PostHog/posthog.com (contents/docs/surveys/creating-surveys.mdx). Tracking backend schema/translation/editor support, minimum SDK version requirements, and survey docs updates alongside stacked #759 and the peer SDK PRs (posthog-ios#1146, posthog-android#1030, posthog-js#5995) will be needed for end-to-end customer configuration (Surveys / Client Libraries teams).
AI-assisted review.
| "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. Adds `skipButtonText` to `PostHogDisplaySurveyAppearance`; the label defaults to "Skip". |
There was a problem hiding this comment.
Concern: Releasing #758 ahead of stacked #759 ships an untranslatable hardcoded "Skip" label on localized mobile surveys and an inaccurate changeset citing internal PostHogDisplaySurveyAppearance.
Trigger → actual → expected:
- Merging feat(surveys): add Skip button to optional questions #758 with this
minorchangeset triggers an automatedposthog_flutterrelease on pub.dev (RELEASING.md) ahead of stacked draft PR feat(surveys): pass skipButtonText from the native SDKs #759 (5938bb74, blocked on unreleasedposthog-ios#1146andposthog-android#1030). - On merge base (
28c95988), optional questions in non-English or translated mobile apps (survey translations shipped in6.0.0via nativeSurveyTranslationApplier/PostHogSurvey+Display) advanced via the localizedquestion.buttonTextorappearance.submitButtonText, both already forwarded by the native bridges. - Releasing feat(surveys): add Skip button to optional questions #758 alone disables that localized Submit button and displays a hardcoded English
"Skip"button that customers cannot customize or translate on iOS or Android (no Dart override API exists), because neitherPostHogDisplaySurveyExt.kt:67-93norPostHogDisplaySurvey+Dict.swift:55-125forwards"skipButtonText"yet (a['skipButtonText']inposthog_display_survey.dart:110is alwaysnullat runtime until feat(surveys): pass skipButtonText from the native SDKs #759 ships). - In addition, this changeset advertises "Adds
skipButtonTexttoPostHogDisplaySurveyAppearance; the label defaults to 'Skip'", even thoughPostHogDisplaySurveyAppearanceis an internallib/src/surveys/models/class not exported frompackage:posthog_flutter/posthog_flutter.dart(absent fromposthog_flutter/lib/posthog_flutter.dartandapi/posthog_flutter.api.json, unlikeposthog-ios#1146andposthog-android#1030where it is public API) and omits that neither native bridge passesskipButtonTextyet.
Governing contract: RELEASING.md and PostHog SDK Guidelines (Keep changelogs and version bumps accurate) require customer-facing release notes to accurately reflect observable changes and affected platforms. For precedent in this repo, see posthog_flutter/CHANGELOG.md:13 (6.2.0 / 22e6f33), which explicitly disclosed when native bridge forwarding was still pending ("Android keeps showing the bottom sheet until posthog-android passes the position through") and did not reference internal lib/src/ types.
Recommendation:
- Consider holding the release of feat(surveys): add Skip button to optional questions #758 to land together with feat(surveys): pass skipButtonText from the native SDKs #759 once
posthog-ios#1146andposthog-android#1030ship (so localized apps never receive an untranslatable English"Skip"button, matching all peer SDK PRs), while still removing the internalPostHogDisplaySurveyAppearancereference from the changeset. - Or, if shipping feat(surveys): add Skip button to optional questions #758 ahead of feat(surveys): pass skipButtonText from the native SDKs #759 with English-only
"Skip"is explicitly accepted, consider updating this changeset line to dropPostHogDisplaySurveyAppearanceand disclose the native bridge limitation, e.g.:The Skip button currently displays "Skip" on iOS and Android; custom and translated labels set via skipButtonText will take effect once the follow-up native SDK bridge update ships.
| ), | ||
| if (widget.optional) | ||
| SurveySkipButton( | ||
| onPressed: () => widget.onSubmit(''), |
There was a problem hiding this comment.
Follow-up: Pre-existing cross-SDK divergence worth a policy decision in PostHog/sdk-specs (not a regression or merge blocker for #758 — merge base 28c95988 already emitted '' for empty optional open-text submit, matching posthog-js#5995).
Observed behavior across the native bridges and backend:
- Skipping an optional open-text question sends
''→ Android (PostHogFlutterSurveysDelegate.kt:168-169) wraps it asPostHogSurveyResponse.Text("")and iOS (PosthogFlutterPlugin.swift:811-812) wraps it as.openEnded(""). - In both delegated native cores (
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>: "". - In
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. - By contrast, Flutter's rating/choice skip sends
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 in PostHog/sdk-specs (Client Libraries / Surveys teams) on whether skipped optional open-text should emit null/omitted or "" (and whether surveyHasResponses should treat "" as unanswered) rather than changing it ad hoc here.
A blank skipButtonText now shows "Skip" instead of an empty button. Adds tests for optional choice questions with an open choice (Submit gating, Skip discarding the text, auto-submit), deselecting an optional rating or choice, and an optional link question having no Skip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Motivation and Context
Part of #757 (the Dart side; bridging
skipButtonTextfrom the native SDKs is a follow-up).Optional survey questions in Flutter keep Submit enabled when nothing is answered, and that empty Submit quietly counts as a skip. Optional questions that auto-submit have no way to be skipped at all. This ports the behavior from PostHog/posthog-js#5995, PostHog/posthog-ios#1146 and PostHog/posthog-android#1030:
skipSubmitButton, single choice without an open choice) show Skip on its own.""for open text,nullfor rating, single choice and multiple choice. Skipping after answering discards the answer.PostHogDisplaySurveyAppearancegainsskipButtonText, parsed from the native appearance map. The label falls back to "Skip" when it's missing or empty.Not in this PR: the native bridge doesn't send
skipButtonTextyet. The field only exists in the unreleased posthog-ios#1146 and posthog-android#1030, so reading it now would break the build against the released 4.x SDKs. Until a follow-up raises the minimum native versions and adds it toPostHogDisplaySurveyExt.ktandPostHogDisplaySurvey+Dict.swift, Flutter always shows "Skip": custom and translated labels don't reach Flutter yet.💚 How did you test it?
CI passes (format, analyze, API snapshot, tests). The tests:
test/survey_skip_button_test.dart, covering each type (open, rating, single, multiple):skipButtonTextparsing (present, absent, null appearance).survey_optional_questions_test.dartandsurvey_optional_choice_test.dartasserted the old behavior (Submit enabled on an empty optional question). They now assert Submit is disabled and Skip sends the empty value.Demo:
flutter-ios-demo.mp4
flutter-demo.mp4
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code (a Sonnet subagent implemented it; the diff was reviewed in the driving session). The behavior follows the web, React Native, iOS and Android implementations linked above. Flutter keeps its existing skip values (
""for open text,nullfor the rest) instead of switching to web's[]for multiple choice. The bridge follow-up was split out so this can ship without waiting for the native releases.🤖 Generated with Claude Code