fix(meeting): persist transcript segment edits, restore live recording view, and route settings deep links by tab id
This commit is contained in:
parent
a8983c583a
commit
a85b24d385
15 changed files with 974 additions and 69 deletions
|
|
@ -38,21 +38,23 @@ import type { KeyBindingActionGroup } from '@d3ro/core/keybinding'
|
|||
import { auditKeyBindingMap, KEYBINDING_ACTIONS } from '@d3ro/core/keybinding'
|
||||
import type { ThemeMode, AppConfig, AudioDevice, LLMModel, LLMStatus, STTModel } from '@d3ro/core/types'
|
||||
import { useKeyBindingMap } from '../hooks/useKeyBindingMap'
|
||||
import { DEFAULT_SETTINGS_TAB, SETTINGS_TAB_ORDER } from '../navigation/settingsTabs'
|
||||
import type { SettingsTabId } from '../navigation/settingsTabs'
|
||||
|
||||
interface SettingsModalProps {
|
||||
open: boolean
|
||||
initialTab?: number
|
||||
initialTab?: SettingsTabId
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
interface TabPanelProps {
|
||||
children: React.ReactNode
|
||||
value: number
|
||||
index: number
|
||||
value: SettingsTabId
|
||||
tab: SettingsTabId
|
||||
}
|
||||
|
||||
function TabPanel({ children, value, index }: TabPanelProps): React.ReactElement | null {
|
||||
if (value !== index) return null
|
||||
function TabPanel({ children, value, tab }: TabPanelProps): React.ReactElement | null {
|
||||
if (value !== tab) return null
|
||||
return <Box sx={{ pt: 2 }}>{children}</Box>
|
||||
}
|
||||
|
||||
|
|
@ -65,9 +67,22 @@ const ACTION_GROUP_LABEL_KEYS: Readonly<Record<KeyBindingActionGroup, string>> =
|
|||
|
||||
const ACTION_GROUP_ORDER: readonly KeyBindingActionGroup[] = ['voice', 'window', 'input']
|
||||
|
||||
export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalProps): React.ReactElement {
|
||||
export function SettingsModal({ open, initialTab = DEFAULT_SETTINGS_TAB, onClose }: SettingsModalProps): React.ReactElement {
|
||||
const { t, locale, setLocale } = useI18n()
|
||||
const [activeTab, setActiveTab] = useState(initialTab)
|
||||
const [activeTab, setActiveTab] = useState<SettingsTabId>(initialTab)
|
||||
const tabMeta = useMemo<Record<SettingsTabId, { label: string; icon?: React.ReactElement }>>(
|
||||
() => ({
|
||||
general: { label: t('settings.tabs.general'), icon: <Keyboard size={14} /> },
|
||||
audio: { label: t('settings.tabs.audio'), icon: <Mic size={14} /> },
|
||||
stt: { label: t('settings.tabs.stt') },
|
||||
llm: { label: t('settings.tabs.llm') },
|
||||
input: { label: t('input.tab'), icon: <TextCursorInput size={14} /> },
|
||||
license: { label: t('license.nav'), icon: <Lock size={14} /> },
|
||||
cloud: { label: t('settings.tabs.cloud') ?? 'Cloud', icon: <Cloud size={14} /> },
|
||||
about: { label: t('settings.tabs.about') },
|
||||
}),
|
||||
[t],
|
||||
)
|
||||
const [config, setConfig] = useState<Partial<AppConfig>>({})
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [appVersion, setAppVersion] = useState<string | null>(null)
|
||||
|
|
@ -222,7 +237,7 @@ export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalPr
|
|||
<DialogContent sx={{ bgcolor: d3roPalette.bg.app, p: 0 }}>
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onChange={(_, v: number) => setActiveTab(v)}
|
||||
onChange={(_, v: SettingsTabId) => setActiveTab(v)}
|
||||
variant="scrollable"
|
||||
scrollButtons={false}
|
||||
sx={{
|
||||
|
|
@ -243,19 +258,14 @@ export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalPr
|
|||
'& .MuiTabs-indicator': { bgcolor: d3roPalette.accent.main, height: 2 },
|
||||
}}
|
||||
>
|
||||
<Tab label={t('settings.tabs.general')} icon={<Keyboard size={14} />} iconPosition="start" />
|
||||
<Tab label={t('settings.tabs.audio')} icon={<Mic size={14} />} iconPosition="start" />
|
||||
<Tab label={t('settings.tabs.stt')} />
|
||||
<Tab label={t('settings.tabs.llm')} />
|
||||
<Tab label={t('input.tab')} icon={<TextCursorInput size={14} />} iconPosition="start" />
|
||||
<Tab label={t('license.nav')} icon={<Lock size={14} />} iconPosition="start" />
|
||||
<Tab label={t('settings.tabs.cloud') ?? 'Cloud'} icon={<Cloud size={14} />} iconPosition="start" />
|
||||
<Tab label={t('settings.tabs.about')} />
|
||||
{SETTINGS_TAB_ORDER.map((tab) => (
|
||||
<Tab key={tab} value={tab} label={tabMeta[tab].label} icon={tabMeta[tab].icon} iconPosition="start" />
|
||||
))}
|
||||
</Tabs>
|
||||
<Box sx={{ p: 3 }}>
|
||||
|
||||
{/* ── 일반 탭 ─────────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={0}>
|
||||
<TabPanel value={activeTab} tab="general">
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Typography variant="overline" sx={{ color: d3roPalette.text.label, letterSpacing: '1.5px' }}>
|
||||
|
|
@ -403,7 +413,7 @@ export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalPr
|
|||
</TabPanel>
|
||||
|
||||
{/* ── 오디오 탭 ────────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={1}>
|
||||
<TabPanel value={activeTab} tab="audio">
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
||||
<Typography variant="overline" sx={{ color: d3roPalette.text.label, letterSpacing: '1.5px' }}>
|
||||
{t('settings.microphone')}
|
||||
|
|
@ -539,12 +549,12 @@ export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalPr
|
|||
</TabPanel>
|
||||
|
||||
{/* ── STT 탭 ───────────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={2}>
|
||||
<TabPanel value={activeTab} tab="stt">
|
||||
<STTTab config={config} updateConfig={updateConfig} />
|
||||
</TabPanel>
|
||||
|
||||
{/* ── LLM 탭 ──────────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={3}>
|
||||
<TabPanel value={activeTab} tab="llm">
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}>
|
||||
{/* LLM 백엔드 선택 */}
|
||||
<Box>
|
||||
|
|
@ -802,21 +812,21 @@ export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalPr
|
|||
</TabPanel>
|
||||
|
||||
{/* ── 라이선스 탭 ────────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={4}>
|
||||
<TabPanel value={activeTab} tab="input">
|
||||
<InputConsentPanel />
|
||||
</TabPanel>
|
||||
|
||||
<TabPanel value={activeTab} index={5}>
|
||||
<TabPanel value={activeTab} tab="license">
|
||||
<LicenseTab />
|
||||
</TabPanel>
|
||||
|
||||
{/* ── Cloud Sync 탭 ──────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={6}>
|
||||
<TabPanel value={activeTab} tab="cloud">
|
||||
<CloudSyncSection />
|
||||
</TabPanel>
|
||||
|
||||
{/* ── 정보 탭 ──────────────────────────────── */}
|
||||
<TabPanel value={activeTab} index={7}>
|
||||
<TabPanel value={activeTab} tab="about">
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}>
|
||||
<Typography variant="overline" sx={{ color: d3roPalette.text.label, letterSpacing: '1.5px' }}>
|
||||
D3RO-VOICE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue