File tree Expand file tree Collapse file tree 6 files changed +23
-0
lines changed Expand file tree Collapse file tree 6 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " claude-dev " : minor
3+ ---
4+
5+ Add detection for new users to display special components
Original file line number Diff line number Diff line change @@ -146,8 +146,18 @@ export class Controller {
146146 chatSettings,
147147 shellIntegrationTimeout,
148148 enableCheckpointsSetting,
149+ isNewUser,
150+ taskHistory,
149151 } = await getAllExtensionState ( this . context )
150152
153+ const NEW_USER_TASK_COUNT_THRESHOLD = 10
154+
155+ // Check if the user has completed enough tasks to no longer be considered a "new user"
156+ if ( isNewUser && ! historyItem && taskHistory && taskHistory . length >= NEW_USER_TASK_COUNT_THRESHOLD ) {
157+ await updateGlobalState ( this . context , "isNewUser" , false )
158+ await this . postStateToWebview ( )
159+ }
160+
151161 if ( autoApprovalSettings ) {
152162 const updatedAutoApprovalSettings = {
153163 ...autoApprovalSettings ,
@@ -1357,6 +1367,7 @@ export class Controller {
13571367 enableCheckpointsSetting,
13581368 globalClineRulesToggles,
13591369 shellIntegrationTimeout,
1370+ isNewUser,
13601371 } = await getAllExtensionState ( this . context )
13611372
13621373 const localClineRulesToggles =
@@ -1399,6 +1410,7 @@ export class Controller {
13991410 localCursorRulesToggles : localCursorRulesToggles || { } ,
14001411 workflowToggles : workflowToggles || { } ,
14011412 shellIntegrationTimeout,
1413+ isNewUser,
14021414 }
14031415 }
14041416
Original file line number Diff line number Diff line change @@ -88,5 +88,6 @@ export type GlobalStateKey =
8888 | "favoritedModelIds"
8989 | "requestTimeoutMs"
9090 | "shellIntegrationTimeout"
91+ | "isNewUser"
9192
9293export type LocalStateKey = "localClineRulesToggles"
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ async function migrateEnableCheckpointsSetting(enableCheckpointsSettingRaw: bool
7676
7777export async function getAllExtensionState ( context : vscode . ExtensionContext ) {
7878 const [
79+ isNewUser ,
7980 storedApiProvider ,
8081 apiModelId ,
8182 apiKey ,
@@ -162,6 +163,7 @@ export async function getAllExtensionState(context: vscode.ExtensionContext) {
162163 enableCheckpointsSettingRaw ,
163164 mcpMarketplaceEnabledRaw ,
164165 ] = await Promise . all ( [
166+ getGlobalState ( context , "isNewUser" ) as Promise < boolean | undefined > ,
165167 getGlobalState ( context , "apiProvider" ) as Promise < ApiProvider | undefined > ,
166168 getGlobalState ( context , "apiModelId" ) as Promise < string | undefined > ,
167169 getSecret ( context , "apiKey" ) as Promise < string | undefined > ,
@@ -354,6 +356,7 @@ export async function getAllExtensionState(context: vscode.ExtensionContext) {
354356 favoritedModelIds,
355357 requestTimeoutMs,
356358 } ,
359+ isNewUser : isNewUser ?? true ,
357360 lastShownAnnouncementId,
358361 customInstructions,
359362 taskHistory,
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ export type Platform = "aix" | "darwin" | "freebsd" | "linux" | "openbsd" | "sun
115115export const DEFAULT_PLATFORM = "unknown"
116116
117117export interface ExtensionState {
118+ isNewUser : boolean
118119 apiConfiguration ?: ApiConfiguration
119120 autoApprovalSettings : AutoApprovalSettings
120121 browserSettings : BrowserSettings
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ export const ExtensionStateContextProvider: React.FC<{
8080 localWindsurfRulesToggles : { } ,
8181 workflowToggles : { } ,
8282 shellIntegrationTimeout : 4000 , // default timeout for shell integration
83+ isNewUser : false ,
8384 } )
8485 const [ didHydrateState , setDidHydrateState ] = useState ( false )
8586 const [ showWelcome , setShowWelcome ] = useState ( false )
You can’t perform that action at this time.
0 commit comments