mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the container entrypoint, so the misspelling does not degrade a feature -- it runs migrate --check against a database whose history this tree does not share and the container never starts. Both replacements are measured against the shipped tree rather than chosen: every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL -> INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12 determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_ tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of the bad rule and cannot collide with an upstream name. The rule is fixed for the next convergence, and the tree it already produced is repaired in the same commit -- the codemod is idempotent against its own output, so it cannot undo this itself.
87 lines
3.3 KiB
TypeScript
87 lines
3.3 KiB
TypeScript
import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
|
|
|
|
import { getAndroidSteps } from '../product-analytics/android'
|
|
import { StepDefinition } from '../steps'
|
|
|
|
function getSurveysAndroidSteps(ctx: OnboardingComponentsContext): StepDefinition[] {
|
|
const { CodeBlock, Markdown, dedent, snippets } = ctx
|
|
const SurveysFinalSteps = snippets?.SurveysFinalSteps
|
|
|
|
const installationSteps = getAndroidSteps(ctx)
|
|
|
|
const surveysSteps: StepDefinition[] = [
|
|
{
|
|
title: 'Add the surveys UI module',
|
|
badge: 'required',
|
|
content: (
|
|
<>
|
|
<Markdown>
|
|
{dedent`
|
|
Add the optional \`insights-android-surveys-compose\` module alongside the core SDK. It
|
|
provides a ready-made [Jetpack Compose](https://developer.android.com/jetpack/compose) UI.
|
|
`}
|
|
</Markdown>
|
|
<CodeBlock
|
|
blocks={[
|
|
{
|
|
language: 'kotlin',
|
|
file: 'build.gradle',
|
|
code: dedent`
|
|
dependencies {
|
|
// ... existing dependencies
|
|
implementation("com.insights:insights-android-surveys-compose:0.+")
|
|
}
|
|
`,
|
|
},
|
|
]}
|
|
/>
|
|
</>
|
|
),
|
|
},
|
|
{
|
|
title: 'Enable surveys in your configuration',
|
|
badge: 'required',
|
|
content: (
|
|
<>
|
|
<Markdown>
|
|
{dedent`
|
|
Enable surveys in your Insights configuration. The SDK auto-discovers the UI module from the
|
|
classpath, so matching surveys render automatically with no extra wiring.
|
|
`}
|
|
</Markdown>
|
|
<CodeBlock
|
|
blocks={[
|
|
{
|
|
language: 'kotlin',
|
|
file: 'SampleApp.kt',
|
|
code: dedent`
|
|
val config = InsightsAndroidConfig(
|
|
apiKey = INSIGHTS_PROJECT_TOKEN,
|
|
host = INSIGHTS_HOST
|
|
).apply {
|
|
surveys = true
|
|
}
|
|
|
|
InsightsAndroid.setup(appContext, config)
|
|
`,
|
|
},
|
|
]}
|
|
/>
|
|
</>
|
|
),
|
|
},
|
|
]
|
|
|
|
return [
|
|
...installationSteps,
|
|
...surveysSteps,
|
|
{
|
|
title: 'Next steps',
|
|
badge: 'recommended',
|
|
content: <>{SurveysFinalSteps && <SurveysFinalSteps />}</>,
|
|
},
|
|
]
|
|
}
|
|
|
|
export const SurveysAndroidInstallation = createInstallation(getSurveysAndroidSteps)
|