Repository navigation
docs(surveys): specify how survey appearance fontFamily is applied - #136
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
The surveys spec never said what an SDK does with a survey definition's appearance.fontFamily, so the shipped SDKs disagreed: posthog-js and posthog-ios apply it with a default-font fallback, posthog-android passes it to the host UI layer, and posthog-flutter parsed it and then ignored it until it was applied in posthog-flutter#654. Add a Survey appearance font family requirement covering the surfaces the font applies to, the unset cases (absent, null, blank, and the API default sentinel "inherit"), the silent fallback for a family the platform cannot resolve, and pass-through for SDKs that delegate rendering. Proposed, applied and archived on this branch per AGENTS.md. Generated-By: PostHog Desktop Task-Id: 0b00ba18-ec6d-474f-91d5-5f3e73f10d07
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.
Why
A survey definition carries
appearance.fontFamily, every client SDK parses it, and thesurveysspec never said what to do with it. The result is four different behaviors in shipped code, and one
SDK that parsed the field and then dropped it on the floor.
Source changes
inheritto the default font.Existing behavior the requirement is written against:
getFontFamily(packages/browser/src/extensions/surveys/surveys-extension-utils.tsx) returnsinheritverbatim for theinheritdefault and otherwise appends its default stack after the requested family.SwiftUISurveyAppearance.getAppearanceWithDefaultsresolvesFont.customFont(family:) ?? Font.body, so an unbundled family silently falls back.PostHogDisplaySurveyAppearance.fontFamilyto the host UI layer rather than rendering it itself.What changed in the spec
New
surveysrequirement Survey appearance font family:inheritall mean unset, and unset keeps the SDK's existing default font.inheritis a CSS keyword, not a family, so a non-CSS renderer must not hand it to its font loader.fontFamilythrough unchanged.Proposed, applied and archived on this branch per AGENTS.md.
openspec validate --specs --stricttotals are unchanged frommain(32 passed / 32 failed); the new requirement adds one more of the pre-existing >500-character warnings that every other surveys requirement already produces.Uncertain / worth a look
inheritpass-through, low confidence. The requirement has delegating SDKs forwardinheritunchanged so a CSS-capable wrapper can use it as written, while posthog-flutter normalizes it on receipt. Normalizing in the native display model instead would also be defensible.fontFamilyhandling inpackages/react-native/src/surveys/. The requirement makes that a gap rather than a choice; flagging in case it is deliberate.Created with PostHog Desktop
🤖 Generated with Claude Code