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:
Yun Chan 2026-09-28 20:46:08 +09:00
parent ba9ef9741e
commit f064c93197
96 changed files with 12886 additions and 8924 deletions

View file

@ -0,0 +1,255 @@
// src/renderer/components/shell/AppSidebar.tsx
// 메인 창 사이드바 — 2026-09-28 정보 구조 개편.
//
// 위: 1급(홈·기록·회의) — Ctrl+1..3. 가운데: "도구"(AI 대화·명령어·사전·지식). 아래: 지원·설정·상태 한 줄.
// 모든 항목은 <button> 이고 현재 화면은 aria-current="page". (이전: Box onClick — 키보드로 닿지 않았다)
// 사이드바는 본문보다 한 단 어둡고, 강조색은 현재 위치의 아이콘 하나에만 쓴다(Linear 관찰: 크롬의 파랑 최소화).
import React, { useEffect, useState } from 'react'
import { Box, ButtonBase, Tooltip, Typography } from '@mui/material'
import {
BookOpen,
Headphones,
History as HistoryIcon,
Home,
Library,
MessagesSquare,
Settings,
SquareTerminal,
Users,
} from 'lucide-react'
import { Led, TactileBadge } from '@d3ro/ui/components/ds'
import { d3roPalette, d3roRadius, d3roFocusRing, d3roTransition, typoSx } from '@d3ro/ui/theme'
import { useI18n } from '@d3ro/i18n'
import type { TranslationKey } from '@d3ro/i18n'
import type { LicenseTier, LLMStatus } from '@d3ro/core/types'
import { PRIMARY_ROUTES, TOOL_ROUTES, useAppNavigation } from '../../navigation/app-navigation'
import type { AppRoute } from '../../navigation/app-navigation'
import { tierLabelKey } from '../../utils/display-labels'
const ICON = 18
const ROUTE_META: Record<AppRoute, { labelKey: TranslationKey; icon: React.ReactElement }> = {
home: { labelKey: 'nav.home', icon: <Home size={ICON} /> },
records: { labelKey: 'nav.records', icon: <HistoryIcon size={ICON} /> },
meetings: { labelKey: 'nav.meeting', icon: <Users size={ICON} /> },
conversation: { labelKey: 'nav.aiChat', icon: <MessagesSquare size={ICON} /> },
commands: { labelKey: 'nav.commands', icon: <SquareTerminal size={ICON} /> },
dictionary: { labelKey: 'nav.dictionary', icon: <BookOpen size={ICON} /> },
knowledge: { labelKey: 'nav.knowledge', icon: <Library size={ICON} /> },
settings: { labelKey: 'nav.settings', icon: <Settings size={ICON} /> },
}
function NavButton({
active,
icon,
label,
trailing,
onClick,
shortcut,
}: {
active: boolean
icon: React.ReactElement
label: string
trailing?: React.ReactNode
onClick: () => void
shortcut?: string
}): React.ReactElement {
const button = (
<ButtonBase
onClick={onClick}
aria-current={active ? 'page' : undefined}
sx={{
width: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-start',
gap: 1.25,
height: 34,
px: 1.25,
borderRadius: d3roRadius.button,
color: active ? d3roPalette.text.primary : d3roPalette.text.secondary,
bgcolor: active ? d3roPalette.surface.overlayStrong : 'transparent',
transition: d3roTransition('background-color', 'color'),
'&:hover': { color: d3roPalette.text.primary, bgcolor: active ? d3roPalette.surface.overlayStrong : d3roPalette.surface.overlaySoft },
'&:focus-visible': d3roFocusRing,
'& svg': { flexShrink: 0, color: active ? d3roPalette.accent.light : 'inherit' },
}}
>
{icon}
<Typography
component="span"
sx={{ ...typoSx('compact'), fontWeight: active ? 500 : 400, color: 'inherit', flex: 1, textAlign: 'left', lineHeight: 1 }}
>
{label}
</Typography>
{trailing}
</ButtonBase>
)
return shortcut ? (
<Tooltip title={shortcut} placement="right" enterDelay={600} describeChild>
{button}
</Tooltip>
) : (
button
)
}
function GroupLabel({ children }: { children: React.ReactNode }): React.ReactElement {
return (
<Typography
component="h2"
sx={{ ...typoSx('label'), color: d3roPalette.text.tertiary, px: 1.25, pt: 2.5, pb: 0.75 }}
>
{children}
</Typography>
)
}
/** 사이드바 맨 아래 한 줄 — 조회한 상태만. 조회 전에는 '확인 중'. */
function StatusLine({ onOpenGuide }: { onOpenGuide: () => void }): React.ReactElement {
const { t } = useI18n()
const [llm, setLlm] = useState<LLMStatus | null>(null)
useEffect(() => {
window.electronAPI.llm.getStatus().then((r) => {
if (r.success) setLlm(r.data)
})
return window.electronAPI.llm.onStatusChanged((e) => setLlm(e.status))
}, [])
const connected = llm?.connectionState === 'connected'
const label = llm === null ? t('shell.localAi.checking') : connected ? t('shell.localAi.connected') : t('shell.localAi.offline')
return (
<Box
role="status"
sx={{ display: 'flex', alignItems: 'center', gap: 1, px: 1.25, pt: 1.5, minHeight: 28, color: d3roPalette.text.tertiary }}
>
<Led color={llm === null ? 'off' : connected ? 'green' : 'orange'} size={6} />
<Typography component="span" sx={{ ...typoSx('small'), color: 'inherit', flex: 1, minWidth: 0, whiteSpace: 'nowrap' }}>
{label}
</Typography>
{llm !== null && !connected && (
<ButtonBase
onClick={onOpenGuide}
sx={{
...typoSx('small'),
color: d3roPalette.accent.light,
borderRadius: d3roRadius.xs,
px: 0.5,
'&:hover': { textDecoration: 'underline' },
'&:focus-visible': d3roFocusRing,
}}
>
{t('shell.localAi.setup')}
</ButtonBase>
)}
</Box>
)
}
export function AppSidebar({
tier,
onOpenSupport,
onOpenOllamaGuide,
}: {
tier: LicenseTier
onOpenSupport: () => void
onOpenOllamaGuide: () => void
}): React.ReactElement {
const { t } = useI18n()
const { route, navigate } = useAppNavigation()
const [captionActive, setCaptionActive] = useState(false)
const [meetingRecording, setMeetingRecording] = useState(false)
useEffect(() => {
window.electronAPI.caption.getState().then((r) => {
if (r.success) setCaptionActive(r.data === 'active')
})
window.electronAPI.meetingMode.getState().then((r) => {
if (r.success) setMeetingRecording(r.data.state === 'recording')
})
const unsubCaption = window.electronAPI.caption.onStateChanged((e) => setCaptionActive(e.state === 'active'))
const unsubMeeting = window.electronAPI.meetingMode.onStateChanged((e) => setMeetingRecording(e.state === 'recording'))
return () => {
unsubCaption()
unsubMeeting()
}
}, [])
const item = (r: AppRoute, index?: number, trailing?: React.ReactNode): React.ReactElement => (
<NavButton
key={r}
active={route === r}
icon={ROUTE_META[r].icon}
label={t(ROUTE_META[r].labelKey)}
trailing={trailing}
shortcut={index !== undefined ? t('nav.shortcutHint', { n: index + 1 }) : undefined}
onClick={() => navigate(r)}
/>
)
return (
<Box
component="nav"
aria-label={t('nav.mainLabel')}
sx={{
width: 216,
flexShrink: 0,
bgcolor: d3roPalette.bg.sidebar,
borderRight: `1px solid ${d3roPalette.border.subtle}`,
display: 'flex',
flexDirection: 'column',
px: 1.5,
pt: 2,
pb: 1.5,
gap: 0.25,
}}
>
{/* 브랜드 — 그라디언트·LED 없이 글자로 */}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, px: 1.25, pb: 2 }}>
<Typography sx={{ ...typoSx('heading'), color: d3roPalette.text.primary, flex: 1 }}>D3RO Voice</Typography>
{tier !== 'free' && <TactileBadge tone="accent">{t(tierLabelKey(tier))}</TactileBadge>}
</Box>
{PRIMARY_ROUTES.map((r, i) =>
item(
r,
i,
r === 'meetings' && meetingRecording ? <Led color="red" pulse size={6} /> : undefined,
),
)}
<GroupLabel>{t('nav.tools')}</GroupLabel>
{TOOL_ROUTES.map((r) => item(r))}
<Box sx={{ flex: 1 }} />
{/* 진행 중인 것 — 어디서든 보여야 한다 */}
{(captionActive || meetingRecording) && (
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5, px: 1.25, pb: 1 }}>
{meetingRecording && (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, color: d3roPalette.status.danger }}>
<Led color="red" pulse size={6} />
<Typography sx={{ ...typoSx('small'), color: 'inherit' }}>{t('shell.live.meeting')}</Typography>
</Box>
)}
{captionActive && !meetingRecording && (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, color: d3roPalette.text.secondary }}>
<Led color="blue" pulse size={6} />
<Typography sx={{ ...typoSx('small'), color: 'inherit' }}>{t('shell.live.caption')}</Typography>
</Box>
)}
</Box>
)}
<NavButton active={false} icon={<Headphones size={ICON} />} label={t('nav.support')} onClick={onOpenSupport} />
{item('settings')}
<Box sx={{ borderTop: `1px solid ${d3roPalette.border.subtle}`, mt: 1 }}>
<StatusLine onOpenGuide={onOpenOllamaGuide} />
</Box>
</Box>
)
}