Skip to content

Commit 46732fd

Browse files
committed
fix(renderer): align onboarding wizard
1 parent 69a4fa4 commit 46732fd

8 files changed

Lines changed: 262 additions & 265 deletions

File tree

src/components/settings/AssistantSettingsTab.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,14 @@
381381
v-if="!isToolConfigured(tool.name)"
382382
class="text-xs text-warning normal-case"
383383
>
384-
(Needs config below)
384+
(Configure in Apps)
385385
</span>
386386
</span>
387387
</label>
388388
<div class="text-sm text-gray-400">
389389
{{ tool.description }}
390390
<template v-if="!isToolConfigured(tool.name)"
391-
>(API key for this tool not configured in Optional Tool APIs
392-
section)</template
391+
>(Configure the required API key in the Apps tab)</template
393392
>
394393
</div>
395394
</div>

src/components/wizard/OnboardingWizard.vue

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
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"
@@ -50,7 +56,7 @@
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'
5460
import { useSettingsStore } from '../../stores/settingsStore'
5561
import WizardHeader from './WizardHeader.vue'
5662
import WizardFooter from './WizardFooter.vue'
@@ -61,6 +67,7 @@ import FinalSetupStep from './steps/FinalSetupStep.vue'
6167
import OpenAI from 'openai'
6268
import {
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'
7279
const step = ref(1)
7380
const settingsStore = useSettingsStore()
7481
const 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
76109
const 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+
178215
const toggleLocalModels = (useLocal: boolean) => {
179216
formData.useLocalModels = useLocal
180217
if (useLocal) {
@@ -191,16 +228,9 @@ const toggleLocalModels = (useLocal: boolean) => {
191228
watch(
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
539571
const 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>

src/components/wizard/WizardFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="p-4 border-t border-base-300 bg-base-100 rounded-b-lg">
2+
<div class="p-4 border-t border-gray-700 bg-gray-800 rounded-b-lg">
33
<!-- Progress indicator -->
44
<div class="mb-4">
55
<div class="flex justify-between text-sm text-base-content/60 mb-2">

src/components/wizard/WizardHeader.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div
3-
class="flex items-center justify-between p-4 border-b border-base-300 bg-base-100 rounded-t-lg"
3+
class="flex items-center justify-between p-4 border-b border-gray-700 bg-gray-800 rounded-t-lg"
44
>
55
<!-- Drag handle -->
66
<button
7-
class="dragable select-none p-1 hover:bg-base-200 rounded transition-colors"
7+
class="dragable select-none p-1 hover:bg-gray-700 rounded transition-colors"
88
>
99
<svg
1010
fill="currentColor"
@@ -26,7 +26,7 @@
2626
<!-- Close button -->
2727
<button
2828
@click="$emit('close')"
29-
class="p-2 hover:bg-base-200 rounded-full transition-colors"
29+
class="p-2 hover:bg-gray-700 rounded-full transition-colors"
3030
title="Close Setup"
3131
>
3232
<svg

0 commit comments

Comments
 (0)