44 <h1 >AI Shell</h1 >
55 <div class =" progress-bar" ></div >
66 </div >
7- <OnboardingScreen v-else-if =" page === 'onboarding'" @submit =" submitOnboardingScreen" />
8- <ChatInterface v-else-if =" page === 'chat-interface'" :initialMessages =" messages" :openaiApiKey =" openaiApiKey"
7+ <ChatInterface v-if =" page === 'chat-interface'" :initialMessages =" messages" :openaiApiKey =" openaiApiKey"
98 :anthropicApiKey =" anthropicApiKey" :googleApiKey =" googleApiKey" @manage-models =" handleManageModels"
109 @open-configuration =" handleOpenConfiguration" />
11- <div id =" configuration-popover" :class =" { active: showConfiguration }" >
10+ <div id =" configuration-popover" :class =" { active: showConfiguration }" v-kbd-trap.autofocus = " showConfiguration " >
1211 <Configuration :reactivePage =" configurationPage" @close =" closeConfiguration" />
1312 </div >
13+ <div class =" onboarding-screen-popover-container" v-if =" showOnboarding" >
14+ <div class =" onboarding-screen-popover" v-kbd-trap =" true" >
15+ <button class =" btn close-btn" @click =" closeOnboardingScreen" >
16+ <span class =" material-symbols-outlined" >close</span >
17+ </button >
18+ <OnboardingScreen @submit =" closeOnboardingScreen" @open-provider-config =" closeOnboardingScreenAndOpenProviderConfig" />
19+ </div >
20+ </div >
1421 </div >
1522</template >
1623
@@ -27,7 +34,7 @@ import Configuration, {
2734import OnboardingScreen from " ./components/OnboardingScreen.vue" ;
2835import { getData , notify } from " @beekeeperstudio/plugin" ;
2936
30- type Page = " starting" | " onboarding " | " chat-interface" ;
37+ type Page = " starting" | " chat-interface" ;
3138
3239export default {
3340 components: {
@@ -39,6 +46,7 @@ export default {
3946 data() {
4047 return {
4148 page: " starting" as Page ,
49+ showOnboarding: false ,
4250 showConfiguration: false ,
4351 error: " " as unknown ,
4452 showLoading: false ,
@@ -59,13 +67,12 @@ export default {
5967 await this .initialize ();
6068 await this .$nextTick ();
6169
62- if (this .isFirstTimeUser && this .apiKeyExists ) {
63- this .page = " chat-interface" ;
64- } else if (this .isFirstTimeUser ) {
65- this .page = " onboarding" ;
66- } else {
67- this .page = " chat-interface" ;
70+ if (this .isFirstTimeUser && ! this .apiKeyExists ) {
71+ this .showOnboarding = true ;
6872 }
73+
74+ this .page = " chat-interface" ;
75+
6976 } catch (e ) {
7077 this .showConfiguration = true ;
7178 this .error = e ;
@@ -94,14 +101,25 @@ export default {
94101 ... mapActions (useConfigurationStore , [" configure" ]),
95102 ... mapActions (useInternalDataStore , [" setInternal" ]),
96103 ... mapActions (useChatStore , [" initialize" ]),
97- submitOnboardingScreen() {
104+ closeOnboardingScreen() {
105+ this .showOnboarding = false ;
98106 this .page = " chat-interface" ;
99107 this .setInternal (" isFirstTimeUser" , false );
100108 },
101- handleManageModels() {
109+ async closeOnboardingScreenAndOpenProviderConfig() {
110+ this .closeOnboardingScreen ();
111+ this .openModelsConfig ();
112+ await this .$nextTick ();
113+ const apiKeys = document .querySelector (" #providers-configuration-api-keys" );
114+ apiKeys ?.scrollIntoView ();
115+ },
116+ openModelsConfig() {
102117 this .configurationPage = " models" ;
103118 this .showConfiguration = true ;
104119 },
120+ handleManageModels() {
121+ this .openModelsConfig ();
122+ },
105123 handleOpenConfiguration() {
106124 this .configurationPage = " general" ;
107125 this .showConfiguration = true ;
0 commit comments