feat: add feature flag to toggle between new and old onboarding view [ENG-1224] (#7410)

* feat: add feature flag to toggle between new and old onboarding view

Add a new feature flag `show_onboarding_flow` that controls whether users see the new onboarding experience or the legacy welcome view. This enables A/B testing and gradual rollout of the new onboarding flow, and gives me better control when model list has changed and the onboarding model list is outdated.

Changes:
- Add ONBOARDING feature flag (enabled by default)
- Add showOnboardingFlow to ExtensionState and proto definitions
- Add getOnboardingEnabled() method to FeatureFlagsService
- Update App component to conditionally render OnboardingView or WelcomeView based on flag
- Extend ExtensionStateContext with showOnboardingFlow state management

This allows for controlled rollout and easy rollback if issues arise with the new onboarding experience.

* default true

* default to false unless e2e test

* showOnboardingFlow default to off
This commit is contained in:
Bee authored and GitHub committed 2025-11-11 11:33:42 -08:00
1 parent c151d719c8
commit ccc83d6728
7 files changed
+21 -2

No files matched your search

+1
View File
@@ -360,6 +360,7 @@ message UpdateSettingsRequest {
optional int32 subagent_terminal_output_line_limit = 30;
optional string cline_env = 31;
optional bool native_tool_call_enabled = 32;
optional bool show_onboarding_flow = 33;
}
message UpdateTerminalConnectionTimeoutRequest {
+1
View File
@@ -935,6 +935,7 @@ export class Controller {
defaultTerminalProfile,
isNewUser,
welcomeViewCompleted,
showOnboardingFlow: featureFlagsService.getOnboardingEnabled(),
mcpResponsesCollapsed,
terminalOutputLineLimit,
maxConsecutiveMistakes,
@@ -90,6 +90,10 @@ export class FeatureFlagsService {
return this.getBooleanFlagEnabled(FeatureFlag.NATIVE_TOOL_CALLS_NEXT_GEN_MODELS)
}
public getOnboardingEnabled(): boolean {
return this.getBooleanFlagEnabled(FeatureFlag.ONBOARDING)
}
/**
* Get the feature flag payload for advanced use cases
* @param flagName The feature flag key
+1
View File
@@ -38,6 +38,7 @@ export const COMMAND_CANCEL_TOKEN = "__cline_command_cancel__"
export interface ExtensionState {
isNewUser: boolean
welcomeViewCompleted: boolean
showOnboardingFlow: boolean
apiConfiguration?: ApiConfiguration
autoApprovalSettings: AutoApprovalSettings
browserSettings: BrowserSettings
@@ -8,6 +8,8 @@ export enum FeatureFlag {
HOOKS = "hooks",
// Feature flag for enabling native tool calls for next-gen models
NATIVE_TOOL_CALLS_NEXT_GEN_MODELS = "native_tool_calls_next_gen",
// Feature flag for showing the new onboarding flow or old welcome view.
ONBOARDING = "new_onboarding",
}
export const FeatureFlagDefaultValue: Partial<Record<FeatureFlag, boolean>> = {
@@ -15,6 +17,7 @@ export const FeatureFlagDefaultValue: Partial<Record<FeatureFlag, boolean>> = {
[FeatureFlag.DO_NOTHING]: false,
[FeatureFlag.HOOKS]: false,
[FeatureFlag.NATIVE_TOOL_CALLS_NEXT_GEN_MODELS]: process.env.IS_DEV === "true",
[FeatureFlag.ONBOARDING]: process.env.E2E_TEST === "true",
}
export const FEATURE_FLAGS = Object.values(FeatureFlag)
+3 -1
View File
@@ -6,6 +6,7 @@ import HistoryView from "./components/history/HistoryView"
import McpView from "./components/mcp/configuration/McpConfigurationView"
import OnboardingView from "./components/onboarding/OnboardingView"
import SettingsView from "./components/settings/SettingsView"
import WelcomeView from "./components/welcome/WelcomeView"
import { useClineAuth } from "./context/ClineAuthContext"
import { useExtensionState } from "./context/ExtensionStateContext"
import { Providers } from "./Providers"
@@ -22,6 +23,7 @@ const AppContent = () => {
showHistory,
showAccount,
showAnnouncement,
showOnboardingFlow,
setShowAnnouncement,
setShouldShowAnnouncement,
closeMcpView,
@@ -54,7 +56,7 @@ const AppContent = () => {
}
if (showWelcome) {
return <OnboardingView />
return showOnboardingFlow ? <OnboardingView /> : <WelcomeView />
}
return (
@@ -33,6 +33,7 @@ import { McpServiceClient, ModelsServiceClient, StateServiceClient, UiServiceCli
export interface ExtensionStateContextType extends ExtensionState {
didHydrateState: boolean
showWelcome: boolean
showOnboardingFlow: boolean
openRouterModels: Record<string, ModelInfo>
hicapModels: Record<string, ModelInfo>
openAiModels: string[]
@@ -78,6 +79,7 @@ export interface ExtensionStateContextType extends ExtensionState {
setTotalTasksSize: (value: number | null) => void
setExpandTaskHeader: (value: boolean) => void
setShowWelcome: (value: boolean) => void
setShowOnboardingFlow: (value: boolean) => void
// Refresh functions
refreshOpenRouterModels: () => void
@@ -210,6 +212,7 @@ export const ExtensionStateContextProvider: React.FC<{
defaultTerminalProfile: "default",
isNewUser: false,
welcomeViewCompleted: false,
showOnboardingFlow: false,
mcpResponsesCollapsed: false, // Default value (expanded), will be overwritten by extension state
strictPlanModeEnabled: false,
yoloModeToggled: false,
@@ -235,7 +238,10 @@ export const ExtensionStateContextProvider: React.FC<{
})
const [expandTaskHeader, setExpandTaskHeader] = useState(true)
const [didHydrateState, setDidHydrateState] = useState(false)
const [showWelcome, setShowWelcome] = useState(false)
const [showOnboardingFlow, setShowOnboardingFlow] = useState(true)
const [openRouterModels, setOpenRouterModels] = useState<Record<string, ModelInfo>>({
[openRouterDefaultModelId]: openRouterDefaultModelInfo,
})
@@ -270,7 +276,6 @@ export const ExtensionStateContextProvider: React.FC<{
const partialMessageUnsubscribeRef = useRef<(() => void) | null>(null)
const mcpMarketplaceUnsubscribeRef = useRef<(() => void) | null>(null)
const openRouterModelsUnsubscribeRef = useRef<(() => void) | null>(null)
const hicapModelsUnsubscribeRef = useRef<(() => void) | null>(null)
const workspaceUpdatesUnsubscribeRef = useRef<(() => void) | null>(null)
const relinquishControlUnsubscribeRef = useRef<(() => void) | null>(null)
@@ -649,6 +654,7 @@ export const ExtensionStateContextProvider: React.FC<{
...state,
didHydrateState,
showWelcome,
showOnboardingFlow,
openRouterModels,
hicapModels,
openAiModels,
@@ -691,6 +697,7 @@ export const ExtensionStateContextProvider: React.FC<{
setShowAnnouncement,
hideChatModelSelector,
setShowWelcome,
setShowOnboardingFlow,
setShowChatModelSelector,
setShouldShowAnnouncement: (value) =>
setState((prevState) => ({