feat(desktop): information architecture overhaul — home, records, meetings first
Wave 2 of the 2026-09-28 design overhaul ("records are the main
character, a quiet instrument"). Decisions: design.md.
- Shell: sidebar with primary Home / Records / Meetings (Ctrl+1..3) and a
secondary "Tools" group; every item is a button with aria-current.
The status bar is removed — its "100% LOCAL PRIVACY · ZERO CLOUD SYNC"
claim contradicted device sync; the sidebar shows only queried state.
- Navigation context (routes, params, back, useRouteRequest) so Home can
open a specific meeting or record.
- Home replaces the dashboard: dictation key, start actions, only real
problems, one-line summary, recent records and meetings, file
transcription, free-tier limits.
- Settings become a full-screen route with vertical tabs (tabs no longer
clip) and a shared row grammar; long-standing bugs fixed: team and
enterprise tiers crashed the license tab (currentTier undefined),
first-run onboarding could not be left, Pro+ saw "upgrade to Pro+".
- Records: date-grouped single list with in-place expansion, search and
tags together, mode/favorite filters, load more past 50, undoable
delete. Meetings: list with search/rename/delete, summary-first detail
(summary | transcript | documents | my notes), notes persisted locally
instead of being lost. Tools pages cleaned up; stale-closure example
chips and a 1550x mouse-distance bug fixed.
- Shared pieces: PageHeader, EmptyStateCard, SearchInput ("/" works),
ConfirmDialog, notify with undo; display-labels maps domain values to
typed i18n keys so missing keys fail to compile.
- Mono font stack falls back to Pretendard for Hangul (Korean labels no
longer render spaced out).
- i18n: new ko/en keys via scripts/i18n-add-keys.mjs (one read-merge-
write so parallel editors cannot clobber locale files).
Some renderer files also carried pre-existing in-flight changes (error
recovery deep links, meeting document hooks); they are included as-is.
This commit is contained in:
parent
ba9ef9741e
commit
f064c93197
96 changed files with 12886 additions and 8924 deletions
|
|
@ -1,5 +1,7 @@
|
|||
// src/renderer/components/OnboardingModal.tsx
|
||||
// 첫 실행 온보딩 모달 — 사용 방식 선택 (로컬 Ollama 독립 모드 vs 온라인 클라우드 API)
|
||||
// 첫 실행 온보딩 — 3단계: ① 사용 방식 선택(로컬 Ollama / 온라인 계정) ② 준비(Ollama 연결·모델 또는 로그인) ③ 완료.
|
||||
// v4(2026-09-28): 평면 다이얼로그 + 단계 표시(n/3, 진행 막대) + "나중에 설정" 건너뛰기.
|
||||
// 첫 실행은 Esc·배경 클릭으로 닫히지 않는다(onboarding-dismiss 정책) — 대신 명시적인 건너뛰기 버튼이 있다.
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
import {
|
||||
|
|
@ -14,45 +16,112 @@ import {
|
|||
TextField,
|
||||
Tab,
|
||||
Tabs,
|
||||
Paper,
|
||||
Chip,
|
||||
Alert,
|
||||
} from '@mui/material'
|
||||
import {
|
||||
CheckCircle2,
|
||||
AlertCircle,
|
||||
Cloud,
|
||||
Download,
|
||||
Play,
|
||||
RefreshCw,
|
||||
ExternalLink,
|
||||
Cpu,
|
||||
Sparkles,
|
||||
ArrowRight,
|
||||
ShieldCheck,
|
||||
} from 'lucide-react'
|
||||
import { d3roPalette, d3roRadius, d3roShadow, typoSx, d3roFontMono, d3roFontSans } from '@d3ro/ui/theme'
|
||||
import { Led } from '@d3ro/ui/components/ds'
|
||||
import { CheckCircle2, Cloud, Download, Play, RefreshCw, ExternalLink, Cpu, Check } from 'lucide-react'
|
||||
import { d3roPalette, d3roRadius, d3roNumeralSx, d3roTransition, typoSx } from '@d3ro/ui/theme'
|
||||
import { Led, TactileBadge } from '@d3ro/ui/components/ds'
|
||||
import { useI18n } from '@d3ro/i18n'
|
||||
import type { TranslationKey } from '@d3ro/i18n'
|
||||
import type { LLMModel, LLMStatus } from '@d3ro/core/types'
|
||||
import { useOllamaModelPull } from '../hooks/useOllamaModelPull'
|
||||
import { canDismissOnboarding } from './onboarding-dismiss'
|
||||
import type { OnboardingPhase } from './onboarding-dismiss'
|
||||
|
||||
type Phase = 'select_mode' | 'local_ollama_setup' | 'online_auth' | 'success' | 'failed'
|
||||
type Phase = OnboardingPhase
|
||||
|
||||
interface OnboardingModalProps {
|
||||
open: boolean
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
/** 첫 실행에서 받는 기본 로컬 모델 */
|
||||
const DEFAULT_LOCAL_MODEL = 'gemma4:e4b'
|
||||
const AUTH_FORM_ID = 'onboarding-auth-form'
|
||||
const TOTAL_STEPS = 3
|
||||
|
||||
const STEP_OF_PHASE: Readonly<Record<Phase, number>> = {
|
||||
select_mode: 1,
|
||||
local_ollama_setup: 2,
|
||||
online_auth: 2,
|
||||
failed: 2,
|
||||
success: 3,
|
||||
}
|
||||
|
||||
const LOCAL_POINTS: readonly TranslationKey[] = [
|
||||
'onboarding.mode.local.point1',
|
||||
'onboarding.mode.local.point2',
|
||||
'onboarding.mode.local.point3',
|
||||
]
|
||||
|
||||
const ONLINE_POINTS: readonly TranslationKey[] = [
|
||||
'onboarding.mode.online.point1',
|
||||
'onboarding.mode.online.point2',
|
||||
'onboarding.mode.online.point3',
|
||||
]
|
||||
|
||||
interface ModeCardProps {
|
||||
icon: React.ReactNode
|
||||
title: string
|
||||
badge?: string
|
||||
description: string
|
||||
points: readonly string[]
|
||||
action: React.ReactNode
|
||||
onSelect: () => void
|
||||
}
|
||||
|
||||
/** 사용 방식 카드 — 카드 전체를 눌러도, 안의 버튼(키보드 포커스·Enter)으로도 고를 수 있다. */
|
||||
function ModeCard({ icon, title, badge, description, points, action, onSelect }: ModeCardProps): React.ReactElement {
|
||||
return (
|
||||
<Box
|
||||
onClick={onSelect}
|
||||
sx={{
|
||||
p: 2.5,
|
||||
cursor: 'pointer',
|
||||
borderRadius: d3roRadius.card,
|
||||
border: `1px solid ${d3roPalette.border.default}`,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'space-between',
|
||||
gap: 2,
|
||||
transition: d3roTransition('background-color', 'border-color'),
|
||||
'&:hover': { bgcolor: d3roPalette.surface.overlaySoft, borderColor: d3roPalette.border.strong },
|
||||
}}
|
||||
>
|
||||
<Box>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 1 }}>
|
||||
{icon}
|
||||
<Typography component="h3" sx={{ ...typoSx('heading'), color: d3roPalette.text.primary }}>
|
||||
{title}
|
||||
</Typography>
|
||||
{badge && <TactileBadge tone="accent">{badge}</TactileBadge>}
|
||||
</Box>
|
||||
<Typography sx={{ ...typoSx('compact'), color: d3roPalette.text.secondary, mb: 1.5 }}>{description}</Typography>
|
||||
<Box component="ul" sx={{ m: 0, p: 0, listStyle: 'none', display: 'flex', flexDirection: 'column', gap: 0.75 }}>
|
||||
{points.map((point) => (
|
||||
<Box component="li" key={point} sx={{ display: 'flex', alignItems: 'flex-start', gap: 1 }}>
|
||||
<Check size={14} color={d3roPalette.text.tertiary} style={{ marginTop: 3, flexShrink: 0 }} aria-hidden />
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.secondary }}>{point}</Typography>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
{action}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.ReactElement {
|
||||
const { t } = useI18n()
|
||||
const [internalOpen, setInternalOpen] = useState(false)
|
||||
const [phase, setPhase] = useState<Phase>('select_mode')
|
||||
// 이미 온보딩을 마친 사용자면 모달을 언제든 닫을 수 있다(첫 실행만 진행을 강제).
|
||||
const [onboardingCompleted, setOnboardingCompleted] = useState(false)
|
||||
|
||||
// Local Ollama State
|
||||
const [ollamaStatus, setOllamaStatus] = useState<LLMStatus | null>(null)
|
||||
const [installedModels, setInstalledModels] = useState<LLMModel[]>([])
|
||||
const [activeModel, setActiveModel] = useState<string>('gemma4:e4b')
|
||||
const [activeModel, setActiveModel] = useState<string>(DEFAULT_LOCAL_MODEL)
|
||||
const [checkingOllama, setCheckingOllama] = useState(false)
|
||||
const [startingOllama, setStartingOllama] = useState(false)
|
||||
const [ollamaMsg, setOllamaMsg] = useState<string | null>(null)
|
||||
|
|
@ -64,7 +133,7 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
const [authError, setAuthError] = useState('')
|
||||
const [authLoading, setAuthLoading] = useState(false)
|
||||
|
||||
// Error State
|
||||
// Error State — 'failed' 단계는 현재 진입 경로가 없다(호환용으로 유지)
|
||||
const errorMsg = ''
|
||||
|
||||
const isVisible = open || internalOpen
|
||||
|
|
@ -87,7 +156,9 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
|
||||
useEffect(() => {
|
||||
window.electronAPI.config.getAll().then((res) => {
|
||||
if (res.success && !res.data.onboardingCompleted) {
|
||||
if (!res.success) return
|
||||
setOnboardingCompleted(res.data.onboardingCompleted)
|
||||
if (!res.data.onboardingCompleted) {
|
||||
setInternalOpen(true)
|
||||
setPhase('select_mode')
|
||||
}
|
||||
|
|
@ -132,14 +203,14 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
const res = await window.electronAPI.llm.startServer()
|
||||
if (res.success) {
|
||||
if (res.data === 'running') {
|
||||
setOllamaMsg('Ollama가 이미 실행 중입니다.')
|
||||
setOllamaMsg(t('ollamaGuide.start.running'))
|
||||
} else if (res.data === 'starting') {
|
||||
setOllamaMsg('Ollama 서버를 시작했습니다. 연결 확인 중...')
|
||||
setOllamaMsg(t('ollamaGuide.start.starting'))
|
||||
setTimeout(() => checkOllama(), 2000)
|
||||
} else if (res.data === 'not-installed') {
|
||||
setOllamaMsg('Ollama가 설치되어 있지 않습니다. 다운로드 버튼을 눌러 설치해 주세요.')
|
||||
setOllamaMsg(t('ollamaGuide.start.notInstalled'))
|
||||
} else {
|
||||
setOllamaMsg('Ollama 실행에 실패했습니다. 수동으로 Ollama를 실행해 주세요.')
|
||||
setOllamaMsg(t('ollamaGuide.start.failed'))
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
|
@ -173,10 +244,10 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
await window.electronAPI.config.set({ key: 'onboardingCompleted', value: true })
|
||||
setPhase('success')
|
||||
} else {
|
||||
setAuthError(res.error?.message ?? '인증에 실패하였습니다.')
|
||||
setAuthError(res.error?.message ?? t('onboarding.auth.failed'))
|
||||
}
|
||||
} catch (err) {
|
||||
setAuthError(`오류: ${err instanceof Error ? err.message : String(err)}`)
|
||||
setAuthError(t('onboarding.auth.error', { message: err instanceof Error ? err.message : String(err) }))
|
||||
} finally {
|
||||
setAuthLoading(false)
|
||||
}
|
||||
|
|
@ -187,220 +258,113 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
onClose()
|
||||
}
|
||||
|
||||
// 첫 실행 건너뛰기 — 기본값(로컬 모드)으로 시작하고 다시 묻지 않는다. 설정 › 정보에서 다시 열 수 있다.
|
||||
// Ollama 도 온라인 계정도 없는 사용자가 첫 실행에서 갇히지 않게 하는 출구.
|
||||
const handleSkip = async () => {
|
||||
await window.electronAPI.config.set({ key: 'onboardingCompleted', value: true })
|
||||
setOnboardingCompleted(true)
|
||||
handleClose()
|
||||
}
|
||||
|
||||
const dismissible = canDismissOnboarding(phase, onboardingCompleted)
|
||||
|
||||
const isOllamaConnected = ollamaStatus?.connectionState === 'connected'
|
||||
const hasInstalledLlm = installedModels.length > 0
|
||||
const step = STEP_OF_PHASE[phase]
|
||||
const stepLabel = t('onboarding.step', { current: step, total: TOTAL_STEPS })
|
||||
|
||||
if (!isVisible) return <></>
|
||||
|
||||
const sectionBox = {
|
||||
p: 2,
|
||||
borderRadius: d3roRadius.inner,
|
||||
border: `1px solid ${d3roPalette.border.subtle}`,
|
||||
} as const
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={isVisible}
|
||||
onClose={() => {}}
|
||||
maxWidth="md"
|
||||
onClose={dismissible ? handleClose : () => {}}
|
||||
maxWidth="sm"
|
||||
fullWidth
|
||||
PaperProps={{
|
||||
sx: {
|
||||
borderRadius: d3roRadius.card,
|
||||
backgroundColor: d3roPalette.bg.card,
|
||||
border: `1px solid ${d3roPalette.border.default}`,
|
||||
p: 1,
|
||||
},
|
||||
}}
|
||||
aria-labelledby="onboarding-title"
|
||||
>
|
||||
<DialogTitle
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 1.5,
|
||||
...typoSx('heading'),
|
||||
color: d3roPalette.text.primary,
|
||||
borderBottom: `1px solid ${d3roPalette.border.subtle}`,
|
||||
pb: 1.5,
|
||||
}}
|
||||
>
|
||||
{phase === 'success' ? (
|
||||
<CheckCircle2 size={24} style={{ color: d3roPalette.tag.green }} />
|
||||
) : phase === 'failed' ? (
|
||||
<AlertCircle size={24} style={{ color: d3roPalette.tag.red }} />
|
||||
) : (
|
||||
<Sparkles size={24} style={{ color: d3roPalette.accent.main }} />
|
||||
)}
|
||||
D3RO Voice 시작 가이드
|
||||
<DialogTitle id="onboarding-title" component="h2" sx={{ ...typoSx('title'), color: d3roPalette.text.primary, pb: 1 }}>
|
||||
{t('onboarding.wizard.title')}
|
||||
</DialogTitle>
|
||||
|
||||
<DialogContent sx={{ py: 3 }}>
|
||||
{/* ── 1. 사용 모드 선택 ── */}
|
||||
{/* 단계 표시 — 숫자 + 진행 막대 */}
|
||||
<Box sx={{ px: 3, pb: 2 }}>
|
||||
<Typography sx={{ ...typoSx('small'), ...d3roNumeralSx, color: d3roPalette.text.tertiary, mb: 0.75 }}>
|
||||
{stepLabel}
|
||||
</Typography>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={(step / TOTAL_STEPS) * 100}
|
||||
aria-label={t('onboarding.wizard.progress')}
|
||||
aria-valuetext={stepLabel}
|
||||
sx={{ height: 2, borderRadius: 1 }}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
<DialogContent sx={{ pt: 1, pb: 2 }}>
|
||||
{/* ── 1. 사용 방식 선택 ── */}
|
||||
{phase === 'select_mode' && (
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}>
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
||||
<Typography sx={{ ...typoSx('body'), color: d3roPalette.text.secondary }}>
|
||||
D3RO Voice를 어떤 환경으로 사용하시겠습니까? 언제든지 환경설정에서 변경할 수 있습니다.
|
||||
{t('onboarding.mode.intro')}
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 2 }}>
|
||||
{/* 로컬 AI 독립 모드 (강력 권장) */}
|
||||
<Paper
|
||||
elevation={0}
|
||||
onClick={handleSelectLocalMode}
|
||||
sx={{
|
||||
p: 2.5,
|
||||
cursor: 'pointer',
|
||||
borderRadius: d3roRadius.card,
|
||||
bgcolor: d3roPalette.bg.elevated,
|
||||
border: `2px solid ${d3roPalette.accent.main}`,
|
||||
transition: 'all 150ms ease-out',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'space-between',
|
||||
'&:hover': {
|
||||
bgcolor: d3roPalette.bg.inset,
|
||||
transform: 'translateY(-2px)',
|
||||
boxShadow: d3roShadow.dialog,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Box>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 1.5 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Cpu size={22} color={d3roPalette.accent.main} />
|
||||
<Typography sx={{ fontWeight: 600, fontSize: '15px', color: d3roPalette.text.primary }}>
|
||||
로컬 AI 모드
|
||||
</Typography>
|
||||
</Box>
|
||||
<Chip label="100% 무료 / 강력 추천" size="small" sx={{ fontWeight: 500, fontSize: '10px', height: 20, bgcolor: d3roPalette.tag.greenBg, color: d3roPalette.tag.green }} />
|
||||
</Box>
|
||||
<Typography sx={{ fontSize: '12px', color: d3roPalette.text.secondary, mb: 2, lineHeight: 1.5 }}>
|
||||
<b>Ollama</b>와 로컬 <b>Whisper STT</b>를 사용하여 PC 내부에서 완전히 독립 실행됩니다.
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.75 }}>
|
||||
{[
|
||||
'인터넷 연결 없이 오프라인 작동',
|
||||
'음성/텍스트 데이터 외부 유출 제로 (완벽한 보안)',
|
||||
'API 비용 없이 무제한 전사 및 AI 다듬기',
|
||||
].map((item) => (
|
||||
<Box key={item} sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<ShieldCheck size={14} color={d3roPalette.tag.green} />
|
||||
<Typography sx={{ fontSize: '11px', color: d3roPalette.text.primary }}>
|
||||
{item}
|
||||
</Typography>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
fullWidth
|
||||
endIcon={<ArrowRight size={14} />}
|
||||
sx={{
|
||||
mt: 2.5,
|
||||
fontFamily: d3roFontSans,
|
||||
fontWeight: 500,
|
||||
bgcolor: d3roPalette.accent.main,
|
||||
color: d3roPalette.bg.app,
|
||||
'&:hover': { bgcolor: d3roPalette.accent.light },
|
||||
}}
|
||||
>
|
||||
로컬 AI 모드로 시작
|
||||
</Button>
|
||||
</Paper>
|
||||
|
||||
{/* 온라인 클라우드 모드 */}
|
||||
<Paper
|
||||
elevation={0}
|
||||
onClick={() => setPhase('online_auth')}
|
||||
sx={{
|
||||
p: 2.5,
|
||||
cursor: 'pointer',
|
||||
borderRadius: d3roRadius.card,
|
||||
bgcolor: d3roPalette.bg.inset,
|
||||
border: `1px solid ${d3roPalette.border.default}`,
|
||||
transition: 'all 150ms ease-out',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'space-between',
|
||||
'&:hover': {
|
||||
bgcolor: d3roPalette.bg.elevated,
|
||||
borderColor: d3roPalette.border.subtle,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Box>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 1.5 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Cloud size={22} color={d3roPalette.tag.blue} />
|
||||
<Typography sx={{ fontWeight: 600, fontSize: '15px', color: d3roPalette.text.primary }}>
|
||||
온라인 클라우드 모드
|
||||
</Typography>
|
||||
</Box>
|
||||
<Chip label="계정 로그인" size="small" sx={{ fontSize: '10px', height: 20 }} />
|
||||
</Box>
|
||||
<Typography sx={{ fontSize: '12px', color: d3roPalette.text.secondary, mb: 2, lineHeight: 1.5 }}>
|
||||
클라우드 서버 계정으로 로그인하여 AI 음성인식 및 고급 모델을 사용합니다.
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.75 }}>
|
||||
{[
|
||||
'로컬 모델 설치 불필요 (저사양 PC용)',
|
||||
'클라우드 동기화 및 다중 기기 연동',
|
||||
'D3RO 계정 로그인 필요',
|
||||
].map((item) => (
|
||||
<Box key={item} sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<CheckCircle2 size={14} color={d3roPalette.tag.blue} />
|
||||
<Typography sx={{ fontSize: '11px', color: d3roPalette.text.primary }}>
|
||||
{item}
|
||||
</Typography>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<Button
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
endIcon={<ArrowRight size={14} />}
|
||||
sx={{
|
||||
mt: 2.5,
|
||||
fontFamily: d3roFontSans,
|
||||
borderColor: d3roPalette.border.default,
|
||||
color: d3roPalette.text.primary,
|
||||
}}
|
||||
>
|
||||
온라인 계정 로그인
|
||||
</Button>
|
||||
</Paper>
|
||||
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr' }, gap: 2 }}>
|
||||
<ModeCard
|
||||
icon={<Cpu size={18} color={d3roPalette.text.secondary} aria-hidden />}
|
||||
title={t('onboarding.mode.local.title')}
|
||||
badge={t('onboarding.mode.local.badge')}
|
||||
description={t('onboarding.mode.local.desc')}
|
||||
points={LOCAL_POINTS.map((key) => t(key))}
|
||||
onSelect={handleSelectLocalMode}
|
||||
action={
|
||||
// 첫 포커스 — Enter 로 권장 경로를 바로 시작한다. 클릭은 카드 onClick 으로 전파된다.
|
||||
<Button variant="contained" fullWidth autoFocus>
|
||||
{t('onboarding.mode.local.action')}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<ModeCard
|
||||
icon={<Cloud size={18} color={d3roPalette.text.secondary} aria-hidden />}
|
||||
title={t('onboarding.mode.online.title')}
|
||||
description={t('onboarding.mode.online.desc')}
|
||||
points={ONLINE_POINTS.map((key) => t(key))}
|
||||
onSelect={() => setPhase('online_auth')}
|
||||
action={
|
||||
<Button variant="outlined" fullWidth>
|
||||
{t('onboarding.mode.online.action')}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* ── 2. 로컬 Ollama 온보딩 스텝 ── */}
|
||||
{/* ── 2a. 로컬 Ollama 준비 ── */}
|
||||
{phase === 'local_ollama_setup' && (
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}>
|
||||
{/* 연결 상태 박스 */}
|
||||
<Paper
|
||||
elevation={0}
|
||||
sx={{
|
||||
p: 2,
|
||||
bgcolor: d3roPalette.bg.inset,
|
||||
border: `1px solid ${isOllamaConnected ? d3roPalette.tag.green : d3roPalette.tag.orange}`,
|
||||
borderRadius: d3roRadius.small,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5 }}>
|
||||
<Led color={isOllamaConnected ? 'green' : 'amber'} pulse={!isOllamaConnected} size={9} />
|
||||
<Box>
|
||||
<Typography sx={{ fontWeight: 500, fontSize: '13px', color: isOllamaConnected ? d3roPalette.tag.green : d3roPalette.tag.orange }}>
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
||||
{/* 연결 상태 — 실제로 조회한 값만 쓴다 */}
|
||||
<Box sx={{ ...sectionBox, display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 2, flexWrap: 'wrap' }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, minWidth: 0 }}>
|
||||
<Led color={isOllamaConnected ? 'green' : 'orange'} pulse={checkingOllama} size={8} />
|
||||
<Box role="status" sx={{ minWidth: 0 }}>
|
||||
<Typography sx={{ ...typoSx('compact'), fontWeight: 500, color: d3roPalette.text.primary }}>
|
||||
{isOllamaConnected
|
||||
? `Ollama 로컬 엔진 연결 완료 ${ollamaStatus?.serverVersion ? `(v${ollamaStatus.serverVersion})` : ''}`
|
||||
: 'Ollama 로컬 엔진 확인 필요'}
|
||||
? ollamaStatus?.serverVersion
|
||||
? t('onboarding.local.connectedVersion', { version: ollamaStatus.serverVersion })
|
||||
: t('onboarding.local.connected')
|
||||
: t('onboarding.local.disconnected')}
|
||||
</Typography>
|
||||
<Typography sx={{ fontSize: '11px', color: d3roPalette.text.secondary }}>
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.tertiary }}>
|
||||
{isOllamaConnected
|
||||
? `설치된 모델: ${installedModels.length}개 | 활성 모델: ${activeModel}`
|
||||
: 'Ollama가 실행되어 있지 않거나 설치되지 않았습니다.'}
|
||||
? t('onboarding.local.connectedDetail', { count: installedModels.length, model: activeModel })
|
||||
: t('onboarding.local.disconnectedDetail')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
|
|
@ -412,24 +376,22 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
startIcon={<RefreshCw size={13} className={checkingOllama ? 'animate-spin' : ''} />}
|
||||
onClick={checkOllama}
|
||||
disabled={checkingOllama}
|
||||
sx={{ fontSize: '11px' }}
|
||||
>
|
||||
연결 재확인
|
||||
{t('onboarding.local.recheck')}
|
||||
</Button>
|
||||
{!isOllamaConnected && (
|
||||
<Button
|
||||
size="small"
|
||||
variant="contained"
|
||||
variant="outlined"
|
||||
startIcon={<Play size={13} />}
|
||||
onClick={handleStartOllama}
|
||||
disabled={startingOllama}
|
||||
sx={{ fontSize: '11px', bgcolor: d3roPalette.accent.main, color: d3roPalette.bg.app, fontWeight: 500 }}
|
||||
>
|
||||
Ollama 자동 실행
|
||||
{t('onboarding.local.start')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
</Paper>
|
||||
</Box>
|
||||
|
||||
{ollamaMsg && (
|
||||
<Alert severity={isOllamaConnected ? 'success' : 'info'} sx={{ py: 0.5 }}>
|
||||
|
|
@ -437,126 +399,120 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Ollama 미설치 시 가이드 */}
|
||||
{/* Ollama 미설치 시 안내 */}
|
||||
{!isOllamaConnected && (
|
||||
<Box sx={{ p: 2, bgcolor: d3roPalette.bg.elevated, borderRadius: d3roRadius.small, border: `1px solid ${d3roPalette.border.subtle}` }}>
|
||||
<Typography sx={{ fontWeight: 500, fontSize: '13px', mb: 1, color: d3roPalette.accent.main }}>
|
||||
Ollama가 아직 설치되어 있지 않다면:
|
||||
<Box sx={sectionBox}>
|
||||
<Typography component="h3" sx={{ ...typoSx('compact'), fontWeight: 500, color: d3roPalette.text.primary, mb: 0.75 }}>
|
||||
{t('onboarding.local.installTitle')}
|
||||
</Typography>
|
||||
<Typography sx={{ fontSize: '12px', color: d3roPalette.text.secondary, mb: 1.5 }}>
|
||||
1. 아래 버튼을 눌러 공식 웹사이트에서 Ollama를 다운로드하여 설치해 주세요.<br />
|
||||
2. 설치 후 '연결 재확인' 버튼을 누르면 D3RO Voice가 자동으로 감지합니다.
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.secondary }}>
|
||||
{t('onboarding.local.installStep1')}
|
||||
</Typography>
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.secondary, mb: 1.5 }}>
|
||||
{t('onboarding.local.installStep2')}
|
||||
</Typography>
|
||||
<Button
|
||||
variant="outlined"
|
||||
size="small"
|
||||
endIcon={<ExternalLink size={14} />}
|
||||
onClick={() => window.electronAPI.system.openExternal({ url: 'https://ollama.com/download' })}
|
||||
sx={{ fontFamily: d3roFontMono, fontSize: '11px', borderColor: d3roPalette.accent.main, color: d3roPalette.accent.light }}
|
||||
>
|
||||
ollama.com/download 열기
|
||||
{t('onboarding.local.openDownload')}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* 추천 모델 설치 섹션 */}
|
||||
{/* 기본 모델 받기 */}
|
||||
<Box>
|
||||
<Typography sx={{ fontWeight: 500, fontSize: '13px', mb: 1, color: d3roPalette.text.primary }}>
|
||||
기본 한국어 AI 모델 설치 (Gemma 2 2B)
|
||||
<Typography component="h3" sx={{ ...typoSx('compact'), fontWeight: 500, color: d3roPalette.text.primary, mb: 0.5 }}>
|
||||
{t('onboarding.local.modelTitle', { model: DEFAULT_LOCAL_MODEL })}
|
||||
</Typography>
|
||||
<Typography sx={{ fontSize: '12px', color: d3roPalette.text.secondary, mb: 1.5 }}>
|
||||
텍스트 정제, 요약, 번역에 최적화된 초경량 모델입니다. (크기: 약 1.6GB)
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.tertiary, mb: 1.5 }}>
|
||||
{t('onboarding.local.modelDesc')}
|
||||
</Typography>
|
||||
|
||||
{pullingModel ? (
|
||||
<Box sx={{ p: 2, bgcolor: d3roPalette.bg.inset, borderRadius: d3roRadius.small }}>
|
||||
<Box sx={sectionBox}>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 1 }}>
|
||||
<Typography sx={{ fontSize: '12px', color: d3roPalette.accent.light }}>
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.secondary }}>
|
||||
{pullProgress.status || t('onboarding.statusPreparing')}
|
||||
</Typography>
|
||||
<Typography sx={{ fontSize: '12px', fontFamily: d3roFontMono, color: d3roPalette.text.primary }}>
|
||||
<Typography sx={{ ...typoSx('small'), ...d3roNumeralSx, color: d3roPalette.text.primary }}>
|
||||
{pullProgress.percent}%
|
||||
</Typography>
|
||||
</Box>
|
||||
<LinearProgress variant="determinate" value={pullProgress.percent} sx={{ height: 6, borderRadius: 3 }} />
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={pullProgress.percent}
|
||||
aria-label={t('onboarding.local.pull', { model: pullingModel })}
|
||||
sx={{ height: 4, borderRadius: 2 }}
|
||||
/>
|
||||
</Box>
|
||||
) : (
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
|
||||
{pullError && (
|
||||
<Alert severity="error" sx={{ py: 0.5 }}>
|
||||
{pullError.stage === 'pull'
|
||||
? t('onboarding.failed', { message: pullError.message })
|
||||
: pullError.message}
|
||||
</Alert>
|
||||
)}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
|
||||
<Button
|
||||
variant="contained"
|
||||
startIcon={<Download size={14} />}
|
||||
onClick={() => handlePullModel('gemma4:e4b')}
|
||||
disabled={!isOllamaConnected}
|
||||
sx={{
|
||||
fontWeight: 500,
|
||||
bgcolor: d3roPalette.accent.main,
|
||||
color: d3roPalette.bg.app,
|
||||
'&:hover': { bgcolor: d3roPalette.accent.light },
|
||||
}}
|
||||
>
|
||||
{hasInstalledLlm ? 'Gemma 2 (2B) 추가 다운로드' : 'Gemma 2 (2B) 1-클릭 다운로드'}
|
||||
</Button>
|
||||
|
||||
{hasInstalledLlm && (
|
||||
<Typography sx={{ fontSize: '12px', color: d3roPalette.tag.green, display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
<CheckCircle2 size={15} /> 이미 로컬 AI 모델이 준비되어 있습니다.
|
||||
</Typography>
|
||||
{pullError && (
|
||||
<Alert severity="error" sx={{ py: 0.5 }}>
|
||||
{pullError.stage === 'pull'
|
||||
? t('onboarding.failed', { message: pullError.message })
|
||||
: pullError.message}
|
||||
</Alert>
|
||||
)}
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, flexWrap: 'wrap' }}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<Download size={14} />}
|
||||
onClick={() => handlePullModel(DEFAULT_LOCAL_MODEL)}
|
||||
disabled={!isOllamaConnected}
|
||||
>
|
||||
{t('onboarding.local.pull', { model: DEFAULT_LOCAL_MODEL })}
|
||||
</Button>
|
||||
|
||||
{hasInstalledLlm && (
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.status.success, display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
<CheckCircle2 size={14} aria-hidden /> {t('onboarding.local.modelReady')}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', pt: 1, borderTop: `1px solid ${d3roPalette.border.subtle}` }}>
|
||||
<Button variant="text" size="small" onClick={() => setPhase('select_mode')}>
|
||||
뒤로 가기
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={handleCompleteLocalSetup}
|
||||
disabled={!isOllamaConnected}
|
||||
sx={{ fontWeight: 500 }}
|
||||
>
|
||||
설정 완료 및 시작하기
|
||||
</Button>
|
||||
</Box>
|
||||
{!isOllamaConnected && (
|
||||
<Typography sx={{ ...typoSx('small'), color: d3roPalette.text.tertiary }}>
|
||||
{t('onboarding.local.finishHint')}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* ── 3. 온라인 계정 인증 ── */}
|
||||
{/* ── 2b. 온라인 계정 로그인 ── */}
|
||||
{phase === 'online_auth' && (
|
||||
<Box component="form" onSubmit={handleAuthSubmit}>
|
||||
<Box component="form" id={AUTH_FORM_ID} onSubmit={handleAuthSubmit}>
|
||||
<Typography sx={{ ...typoSx('body'), color: d3roPalette.text.secondary, mb: 2 }}>
|
||||
온라인 서비스를 이용하기 위해 D3RO 계정으로 로그인해 주세요.
|
||||
{t('onboarding.auth.intro')}
|
||||
</Typography>
|
||||
|
||||
<Tabs
|
||||
value={authTab}
|
||||
onChange={(_, v) => setAuthTab(v)}
|
||||
onChange={(_, v: 'login' | 'register') => setAuthTab(v)}
|
||||
sx={{ mb: 2, borderBottom: `1px solid ${d3roPalette.border.subtle}` }}
|
||||
>
|
||||
<Tab label="로그인" value="login" />
|
||||
<Tab label="회원가입" value="register" />
|
||||
<Tab label={t('login.signIn')} value="login" />
|
||||
<Tab label={t('login.signUp')} value="register" />
|
||||
</Tabs>
|
||||
|
||||
{authError && (
|
||||
<Typography sx={{ color: d3roPalette.tag.red, mb: 2, ...typoSx('small') }}>
|
||||
<Typography role="alert" sx={{ color: d3roPalette.status.danger, mb: 2, ...typoSx('small') }}>
|
||||
{authError}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
<TextField
|
||||
fullWidth
|
||||
label="이메일 주소"
|
||||
autoFocus
|
||||
label={t('onboarding.auth.email')}
|
||||
type="email"
|
||||
autoComplete="email"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
required
|
||||
|
|
@ -564,57 +520,83 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React.
|
|||
/>
|
||||
<TextField
|
||||
fullWidth
|
||||
label="비밀번호"
|
||||
label={t('onboarding.auth.password')}
|
||||
type="password"
|
||||
autoComplete={authTab === 'login' ? 'current-password' : 'new-password'}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
required
|
||||
sx={{ mb: 3 }}
|
||||
/>
|
||||
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<Button variant="text" onClick={() => setPhase('select_mode')}>
|
||||
뒤로 가기
|
||||
</Button>
|
||||
<Button type="submit" variant="contained" disabled={authLoading}>
|
||||
{authLoading ? '처리 중...' : authTab === 'login' ? '로그인 완료' : '회원가입 완료'}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* ── 4. 설정 완료 ── */}
|
||||
{/* ── 3. 완료 ── */}
|
||||
{phase === 'success' && (
|
||||
<Box sx={{ textAlign: 'center', py: 3 }}>
|
||||
<CheckCircle2 size={48} style={{ color: d3roPalette.tag.green, margin: '0 auto 16px' }} />
|
||||
<Typography sx={{ ...typoSx('heading'), color: d3roPalette.tag.green, mb: 1, fontSize: '18px' }}>
|
||||
D3RO Voice 설정이 완료되었습니다!
|
||||
<CheckCircle2 size={40} style={{ color: d3roPalette.status.success, margin: '0 auto 16px' }} aria-hidden />
|
||||
<Typography component="h3" sx={{ ...typoSx('heading'), color: d3roPalette.text.primary, mb: 1 }}>
|
||||
{t('onboarding.done.title')}
|
||||
</Typography>
|
||||
<Typography sx={{ ...typoSx('body'), color: d3roPalette.text.secondary, maxWidth: 440, mx: 'auto' }}>
|
||||
언제든지 우측 상단 <b>설정</b>에서 STT 공급자 및 Ollama 모델을 변경할 수 있습니다.
|
||||
{t('onboarding.done.desc')}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{phase === 'failed' && (
|
||||
<Box sx={{ py: 2 }}>
|
||||
<Typography sx={{ ...typoSx('body'), color: d3roPalette.tag.red, mb: 2 }}>
|
||||
설정 중 오류가 발생했습니다: {errorMsg}
|
||||
</Typography>
|
||||
<Button variant="contained" onClick={() => setPhase('select_mode')}>
|
||||
다시 시도
|
||||
</Button>
|
||||
</Box>
|
||||
<Typography role="alert" sx={{ ...typoSx('body'), color: d3roPalette.status.danger, py: 2 }}>
|
||||
{t('onboarding.failedPhase', { message: errorMsg })}
|
||||
</Typography>
|
||||
)}
|
||||
</DialogContent>
|
||||
|
||||
{phase === 'success' && (
|
||||
<DialogActions sx={{ px: 3, pb: 2 }}>
|
||||
<Button variant="contained" onClick={handleClose} fullWidth sx={{ py: 1.2, fontWeight: 500 }}>
|
||||
D3RO Voice 시작하기
|
||||
</Button>
|
||||
</DialogActions>
|
||||
)}
|
||||
{/* ── 하단 행동: 왼쪽 = 뒤로·건너뛰기·닫기, 오른쪽 = 이 단계의 주 행동 하나 ── */}
|
||||
<DialogActions sx={{ px: 3, pb: 2.5, pt: 1.5, justifyContent: 'space-between', gap: 1, borderTop: `1px solid ${d3roPalette.border.subtle}` }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
{(phase === 'local_ollama_setup' || phase === 'online_auth') && (
|
||||
<Button variant="text" onClick={() => setPhase('select_mode')}>
|
||||
{t('common.back')}
|
||||
</Button>
|
||||
)}
|
||||
{phase !== 'success' && !dismissible && (
|
||||
<Button variant="text" onClick={handleSkip} title={t('onboarding.wizard.skipHint')}>
|
||||
{t('onboarding.wizard.skip')}
|
||||
</Button>
|
||||
)}
|
||||
{phase !== 'success' && dismissible && (
|
||||
<Button variant="text" onClick={handleClose}>
|
||||
{t('onboarding.close')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
{phase === 'local_ollama_setup' && (
|
||||
<Button variant="contained" onClick={handleCompleteLocalSetup} disabled={!isOllamaConnected}>
|
||||
{t('onboarding.local.finish')}
|
||||
</Button>
|
||||
)}
|
||||
{phase === 'online_auth' && (
|
||||
<Button type="submit" form={AUTH_FORM_ID} variant="contained" disabled={authLoading}>
|
||||
{authLoading
|
||||
? t('onboarding.auth.processing')
|
||||
: authTab === 'login'
|
||||
? t('onboarding.auth.submitLogin')
|
||||
: t('onboarding.auth.submitRegister')}
|
||||
</Button>
|
||||
)}
|
||||
{phase === 'failed' && (
|
||||
<Button variant="contained" onClick={() => setPhase('select_mode')}>
|
||||
{t('common.retry')}
|
||||
</Button>
|
||||
)}
|
||||
{phase === 'success' && (
|
||||
<Button variant="contained" onClick={handleClose} autoFocus>
|
||||
{t('onboarding.done.start')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue