feat: new onboarding flow (#7266)

This commit is contained in:
Lifei Zhou
2026-03-17 12:33:41 +11:00
committed by GitHub
parent a518c42cbc
commit 4604354bc2
40 changed files with 1800 additions and 441 deletions
+6 -17
View File
@@ -67,19 +67,7 @@ async function sendEvent(
export type AnalyticsEvent =
| { name: 'page_view'; properties: { page: string; referrer?: string } }
| { name: 'onboarding_started'; properties: Record<string, never> }
| {
name: 'onboarding_provider_selected';
properties: {
method:
| 'api_key'
| 'openrouter'
| 'tetrate'
| 'chatgpt_codex'
| 'ollama'
| 'local'
| 'other';
};
}
| { name: 'onboarding_provider_selected'; properties: { provider?: string; method?: string } }
| {
name: 'onboarding_completed';
properties: { provider: string; model?: string; duration_seconds?: number };
@@ -293,12 +281,13 @@ export function trackOnboardingStarted(): void {
trackEvent({ name: 'onboarding_started', properties: {} });
}
export function trackOnboardingProviderSelected(
method: 'api_key' | 'openrouter' | 'tetrate' | 'chatgpt_codex' | 'ollama' | 'local' | 'other'
): void {
export function trackOnboardingProviderSelected(options: {
provider?: string;
method?: string;
}): void {
trackEvent({
name: 'onboarding_provider_selected',
properties: { method },
properties: options,
});
}
+12
View File
@@ -0,0 +1,12 @@
import { startNanogptSetup as startNanogptSetupApi } from '../api';
export async function startNanogptSetup(): Promise<{ success: boolean; message: string }> {
try {
return (await startNanogptSetupApi({ throwOnError: true })).data;
} catch (e) {
return {
success: false,
message: `Failed to start NanoGPT setup: ${e instanceof Error ? e.message : String(e)}`,
};
}
}