11<template >
2- <div class =" fixed inset-0 text-base-content flex items-center justify-center" >
2+ <div
3+ data-theme =" dark"
4+ class =" fixed inset-0 bg-transparent text-base-content flex items-center justify-center"
5+ >
36 <div
4- class =" w-full max-w-2xl h-full bg-base-200 border border-base-300 rounded-lg shadow-2xl flex flex-col"
7+ class =" w-full max-w-2xl h-full bg-gray-900 border border-gray-700 rounded-lg shadow-2xl flex flex-col"
58 >
69 <!-- Header -->
710 <WizardHeader :title =" currentStepTitle " @close =" closeWizard " />
811
912 <!-- Scrollable Content -->
10- <div ref =" scrollContainer" class =" flex-1 overflow-y-auto p-6" >
13+ <div
14+ ref =" scrollContainer"
15+ class =" flex-1 overflow-y-auto overflow-x-hidden p-6"
16+ >
1117 <WelcomeStep v-if =" step === 1 " @next =" step = 2 " />
1218 <AIProviderStep
1319 v-else-if =" step === 2 "
5056</template >
5157
5258<script setup lang="ts">
53- import { ref , reactive , computed , watch , nextTick } from ' vue'
59+ import { ref , reactive , computed , watch , nextTick , onMounted } from ' vue'
5460import { useSettingsStore } from ' ../../stores/settingsStore'
5561import WizardHeader from ' ./WizardHeader.vue'
5662import WizardFooter from ' ./WizardFooter.vue'
@@ -61,6 +67,7 @@ import FinalSetupStep from './steps/FinalSetupStep.vue'
6167import OpenAI from ' openai'
6268import {
6369 MINIMAX_OPENAI_BASE_URL ,
70+ PROVIDER_CONFIGS ,
6471 ZAI_CODING_BASE_URL ,
6572 type AIProviderKey ,
6673} from ' ../../services/llmProviders/providerCatalog'
@@ -72,15 +79,41 @@ import { listZAIModelsForConfig } from '../../services/llmProviders/zai'
7279const step = ref (1 )
7380const settingsStore = useSettingsStore ()
7481const scrollContainer = ref <HTMLElement >()
82+ const OPENAI_SUMMARIZATION_MODEL = ' gpt-4.1-nano'
83+ const DEFAULT_MAIN_WINDOW_SIZE = {
84+ width: 500 ,
85+ height: 500 ,
86+ }
87+ const WIZARD_WINDOW_SIZE = {
88+ width: 720 ,
89+ height: 800 ,
90+ }
91+
92+ const getDefaultModels = (provider : AIProviderKey ) => {
93+ const assistantModel =
94+ PROVIDER_CONFIGS [provider ]?.defaultModel ||
95+ PROVIDER_CONFIGS .openai .defaultModel
96+ const summarizationModel =
97+ provider === ' openai' || provider === ' openrouter'
98+ ? OPENAI_SUMMARIZATION_MODEL
99+ : assistantModel
100+
101+ return {
102+ assistantModel ,
103+ summarizationModel ,
104+ }
105+ }
106+
107+ const openaiDefaults = getDefaultModels (' openai' )
75108
76109const formData = reactive ({
77110 VITE_OPENAI_API_KEY: ' ' ,
78111 VITE_OPENROUTER_API_KEY: ' ' ,
79112 VITE_ZAI_API_KEY: ' ' ,
80113 VITE_MINIMAX_API_KEY: ' ' ,
81114 aiProvider: ' openai' as AIProviderKey ,
82- assistantModel: ' gpt-4o-mini ' as string ,
83- summarizationModel: ' gpt-4o-mini ' as string ,
115+ assistantModel: openaiDefaults . assistantModel as string ,
116+ summarizationModel: openaiDefaults . summarizationModel as string ,
84117 sttProvider: ' openai' as ' openai' | ' groq' | ' google' | ' local' ,
85118 ttsProvider: ' openai' as ' openai' | ' google' | ' local' ,
86119 embeddingProvider: ' openai' as ' openai' | ' local' ,
@@ -119,7 +152,7 @@ const currentStepTitle = computed(() => {
119152 const titles = {
120153 1 : ' Welcome to Alice' ,
121154 2 : ' AI Provider Setup' ,
122- 3 : ' Voice & Embedding Models ' ,
155+ 3 : ' Voice & Memory Mode ' ,
123156 4 : ' Final Configuration' ,
124157 }
125158 return titles [step .value as keyof typeof titles ] || ' Setup'
@@ -175,6 +208,10 @@ watch(step, async () => {
175208 }
176209})
177210
211+ onMounted (() => {
212+ window .electron ?.resize ?.(WIZARD_WINDOW_SIZE )
213+ })
214+
178215const toggleLocalModels = (useLocal : boolean ) => {
179216 formData .useLocalModels = useLocal
180217 if (useLocal ) {
@@ -191,16 +228,9 @@ const toggleLocalModels = (useLocal: boolean) => {
191228watch (
192229 () => formData .aiProvider ,
193230 newProvider => {
194- if (newProvider === ' openai' || newProvider === ' openrouter' ) {
195- formData .assistantModel = ' gpt-4o-mini'
196- formData .summarizationModel = ' gpt-4o-mini'
197- } else if (newProvider === ' zai' ) {
198- formData .assistantModel = ' glm-5.1'
199- formData .summarizationModel = ' glm-5.1'
200- } else if (newProvider === ' minimax' ) {
201- formData .assistantModel = ' MiniMax-M2.7'
202- formData .summarizationModel = ' MiniMax-M2.7'
203- }
231+ const defaults = getDefaultModels (newProvider )
232+ formData .assistantModel = defaults .assistantModel
233+ formData .summarizationModel = defaults .summarizationModel
204234 }
205235)
206236
@@ -527,7 +557,9 @@ const finishOnboarding = async () => {
527557 const success = await settingsStore .completeOnboarding (formData )
528558 if (! success ) {
529559 alert (' Failed to save settings. Please try again.' )
560+ return
530561 }
562+ window .electron ?.resize ?.(DEFAULT_MAIN_WINDOW_SIZE )
531563 } catch (error ) {
532564 console .error (' Onboarding completion error:' , error )
533565 alert (' An error occurred during setup. Please try again.' )
@@ -537,6 +569,15 @@ const finishOnboarding = async () => {
537569}
538570
539571const closeWizard = () => {
540- ;(window as any ).electron .closeApp ()
572+ try {
573+ if (typeof window .electron ?.closeApp === ' function' ) {
574+ window .electron .closeApp ()
575+ return
576+ }
577+
578+ window .ipcRenderer ?.send ?.(' close-app' )
579+ } catch (error ) {
580+ console .error (' Failed to close onboarding wizard:' , error )
581+ }
541582}
542583 </script >
0 commit comments