diff --git a/CHANGELOG.md b/CHANGELOG.md index 70e9b8a..3b3495c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Additional Whisper model management UI - Plugin system for custom pipelines +## [1.12.0] - 2026-10-28 + +> Published from an annotated tag. Installer and update metadata are served by the +> canonical Forgejo feed; no binaries are committed to this repository. + +### Added +- **Hangul-typed English contractions, acronyms, function words & fuzzy typo recovery (한영 축약형·약어·오타 자동 교정 고도화).** + - Converts Hangul-typed English contractions and contraction+particle tokens (`ㅊ무ㅅ` / `ㅊ무'ㅅ` / `ㅊ무ㅜ'ㅅ` → `can't`, `ㅊ무'ㅅ는` → `can't는`, `애ㅜ'ㅅ` → `don't`, `ㅑ'ㅡ` / `ㅑㅡ` → `I'm`, `재ㅜ'ㅅ` → `won't`), standalone sentence-initial `ㅑ ` → `I `, and English-clause function words (`새 애` → `to do`, `뭉` → `and`, `랙` → `for`, `소됴` → `they`, `생묘` → `today`, `갸홋` → `right`). + - General Araso batchim-harmony and rare-stem acronym detection (`츤를` / `츤는` → `CMS를` / `CMS는`, `눈를` → `SNS를`, `운를` → `DNS를`, `긴를` → `RLS를`, `틔을` → `XML을`, `먀를` → `AI를`, `뗘를` → `EU를`, `쓰은` → `TM은`, `꾸은` → `RN은`, `띠이` → `EL이`, `꺼을` → `RJ을`, `ㅏㅅㅌ를` → `KTX를`, `ㅎㅅㅌ를` → `GTX를`). + - Recovers 1-edit Hangul-typed English typos (`ㅗ디ㅐ` → `hello`, `ㅔㅐㄴ냐ㅠㅣ` → `possible`, `세갸ㅜㅎ` → `spring`, `ㅡㅁ가애주` → `markdown`), trailing bracket mistypes (`help[` → `help`), and split reflexive pronouns (`my self` → `myself`). + +### Changed +- **Cursor-tail-only replacement without racing your typing (타이핑 경합 없는 꼬리 구간 즉시 교정).** + - Auto-correction now replaces only the contiguous token chain at the cursor tail (up to 22 characters) instead of backspacing and retyping entire lines, and skips background LLM typo calls during active typing bursts so your keystrokes are never interrupted. +- **Design System v4 ("조용한 계기") across Desktop, Web, Admin, and Landing site.** + - Pretendard Variable + JetBrains Mono typography, `#08090C` matte obsidian surfaces, `#E04F3E` signal-red recording accent, and WCAG AA contrast tokens across all surfaces. + ## [1.11.0] - 2026-10-27 > Published from an annotated tag. Installer and update metadata are served by the diff --git a/apps/admin/src/app/(admin)/ads/page.tsx b/apps/admin/src/app/(admin)/ads/page.tsx index 82ce061..13bddf8 100644 --- a/apps/admin/src/app/(admin)/ads/page.tsx +++ b/apps/admin/src/app/(admin)/ads/page.tsx @@ -58,7 +58,7 @@ function HeaderBar(): React.ReactElement { FAIL-CLOSED SANDBOX - + Mediation waterfall roster, rewarded token grants, network integration state @@ -95,7 +95,7 @@ function RewardKpis({ stats }: { stats: AdRewardStats }): React.ReactElement { {cards.map((card) => ( {card.title} diff --git a/apps/admin/src/app/(admin)/audit-log/page.tsx b/apps/admin/src/app/(admin)/audit-log/page.tsx index b071118..e9024bf 100644 --- a/apps/admin/src/app/(admin)/audit-log/page.tsx +++ b/apps/admin/src/app/(admin)/audit-log/page.tsx @@ -99,7 +99,7 @@ export default async function AuditLogPage({ searchParams }: PageProps): Promise fontFamily: FONT_MONO, fontSize: '11px', color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, mt: 0.25, }} > diff --git a/apps/admin/src/app/(admin)/models/page.tsx b/apps/admin/src/app/(admin)/models/page.tsx index 221b4bb..8a322b2 100644 --- a/apps/admin/src/app/(admin)/models/page.tsx +++ b/apps/admin/src/app/(admin)/models/page.tsx @@ -372,7 +372,7 @@ export default function ServiceModelsPage(): React.ReactElement { fontFamily: FONT_MONO, fontSize: '11px', color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, mt: 0.25, }} > @@ -457,7 +457,7 @@ export default function ServiceModelsPage(): React.ReactElement { width: 44, height: 44, borderRadius: '12px', - bgcolor: 'var(--d3-tag-cyan)', + bgcolor: 'var(--d3-tag-cyanBg)', border: '1px solid var(--d3-tag-cyan)', display: 'flex', alignItems: 'center', @@ -483,7 +483,7 @@ export default function ServiceModelsPage(): React.ReactElement { - + 🛡️ Auto Failover Route: {sttEndpoints.map((e) => e.providerType).join(' ➔ ')} @@ -536,7 +536,7 @@ export default function ServiceModelsPage(): React.ReactElement { {ep.name} - + {ep.endpointUrl} @@ -556,7 +556,7 @@ export default function ServiceModelsPage(): React.ReactElement { {ep.isDefault ? ( - + ⭐ DEFAULT ) : ( @@ -574,12 +574,12 @@ export default function ServiceModelsPage(): React.ReactElement { onClick={() => handleSetDefaultStt(ep.id)} sx={{ fontFamily: FONT_SANS, - fontSize: '10px', + fontSize: '11px', color: C.green400, borderColor: 'var(--d3-status-success)', px: 1, py: 0.25, - '&:hover': { bgcolor: 'var(--d3-status-success)', borderColor: C.green400 }, + '&:hover': { bgcolor: 'var(--d3-status-successBg)', borderColor: C.green400 }, }} > Set Default @@ -591,7 +591,7 @@ export default function ServiceModelsPage(): React.ReactElement { onClick={() => handlePingStt(ep.id)} sx={{ fontFamily: FONT_MONO, - fontSize: '10px', + fontSize: '11px', color: C.bright, borderColor: C.borderHl, px: 1, @@ -607,7 +607,7 @@ export default function ServiceModelsPage(): React.ReactElement { onClick={() => openEditSttModal(ep)} sx={{ fontFamily: FONT_SANS, - fontSize: '10px', + fontSize: '11px', color: C.dim, borderColor: C.border, px: 1, @@ -621,7 +621,7 @@ export default function ServiceModelsPage(): React.ReactElement { size="small" color="error" onClick={() => handleDeleteStt(ep.id)} - sx={{ fontFamily: FONT_MONO, fontSize: '10px', px: 1, py: 0.25 }} + sx={{ fontFamily: FONT_MONO, fontSize: '11px', px: 1, py: 0.25 }} > Delete @@ -676,7 +676,7 @@ export default function ServiceModelsPage(): React.ReactElement { {ep.modelId} {ep.isDefault && ( - + DEFAULT )} @@ -711,7 +711,7 @@ export default function ServiceModelsPage(): React.ReactElement { onClick={() => handleDeleteLlm(ep.id)} sx={{ fontFamily: FONT_MONO, - fontSize: '10px', + fontSize: '11px', color: C.bright, borderColor: C.borderHl, px: 1, @@ -740,8 +740,7 @@ export default function ServiceModelsPage(): React.ReactElement { fullWidth PaperProps={{ sx: { - bgcolor: 'var(--d3-bg-card-soft)', - backdropFilter: 'blur(32px)', + bgcolor: C.card, border: `1px solid ${C.borderHl}`, borderRadius: '20px', boxShadow: '0 24px 60px var(--d3-scrim)', @@ -1013,8 +1012,7 @@ export default function ServiceModelsPage(): React.ReactElement { fullWidth PaperProps={{ sx: { - bgcolor: 'var(--d3-bg-card-soft)', - backdropFilter: 'blur(32px)', + bgcolor: C.card, border: `1px solid ${C.borderHl}`, borderRadius: '20px', boxShadow: '0 24px 60px var(--d3-scrim)', diff --git a/apps/admin/src/app/(admin)/page.tsx b/apps/admin/src/app/(admin)/page.tsx index 03070b5..dea4ab4 100644 --- a/apps/admin/src/app/(admin)/page.tsx +++ b/apps/admin/src/app/(admin)/page.tsx @@ -156,7 +156,7 @@ export default async function AdminOverviewPage(): Promise { fontFamily: FONT_MONO, fontSize: '11px', color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, mt: 0.25, }} > @@ -222,7 +222,7 @@ export default async function AdminOverviewPage(): Promise { fontSize: '11px', fontWeight: 500, color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, }} > {card.title} @@ -285,7 +285,7 @@ export default async function AdminOverviewPage(): Promise { fontSize: '11px', fontWeight: 500, color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, }} > {card.title} @@ -373,7 +373,6 @@ export default async function AdminOverviewPage(): Promise { height: 8, borderRadius: '50%', bgcolor: node.status === 'operational' ? 'var(--d3-status-success)' : node.status === 'degraded' ? 'var(--d3-status-warning)' : 'var(--d3-status-danger)', - boxShadow: `0 0 8px ${node.status === 'operational' ? 'var(--d3-status-success)' : node.status === 'degraded' ? 'var(--d3-status-warning)' : 'var(--d3-status-danger)'}`, }} /> @@ -383,10 +382,10 @@ export default async function AdminOverviewPage(): Promise { - + Latency: {node.latencyMs}ms - + {node.uptimePercent}% · {node.status.toUpperCase()} diff --git a/apps/admin/src/app/(admin)/pipelines/page.tsx b/apps/admin/src/app/(admin)/pipelines/page.tsx index 773e275..e895c87 100644 --- a/apps/admin/src/app/(admin)/pipelines/page.tsx +++ b/apps/admin/src/app/(admin)/pipelines/page.tsx @@ -71,7 +71,7 @@ export default async function PipelinesPage(): Promise { fontFamily: FONT_MONO, fontSize: '11px', color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, mt: 0.25, }} > @@ -130,19 +130,19 @@ export default async function PipelinesPage(): Promise { - AVG LATENCY + AVG LATENCY {whisper.avgLatencyMs}ms - SPEEDUP FACTOR + SPEEDUP FACTOR {whisper.speedupFactor} - GPU VRAM + GPU VRAM {whisper.gpuVramUsage} @@ -183,19 +183,19 @@ export default async function PipelinesPage(): Promise { - THROUGHPUT + THROUGHPUT {ollama.tokensPerSecond} tok/s - CONTEXT LIMIT + CONTEXT LIMIT {ollama.activeContextLimit} - VRAM OCCUPANCY + VRAM OCCUPANCY {ollama.vramAllocated} @@ -239,19 +239,19 @@ export default async function PipelinesPage(): Promise { - LIVE STREAMS + LIVE STREAMS {realtimeVoice.activeStreams} Active - AUDIO RTT + AUDIO RTT {realtimeVoice.avgAudioRttMs}ms - LOCAL FALLBACK + LOCAL FALLBACK {realtimeVoice.localFallbackRate} @@ -292,19 +292,19 @@ export default async function PipelinesPage(): Promise { - INDEXED DOCS + INDEXED DOCS {ragVector.indexedDocuments.toLocaleString()} - VECTOR CHUNKS + VECTOR CHUNKS {ragVector.totalVectorChunks.toLocaleString()} - SEARCH HIT RATE + SEARCH HIT RATE {ragVector.topHitRatePercent}% @@ -346,7 +346,7 @@ export default async function PipelinesPage(): Promise { - SPEAKER ACCURACY + SPEAKER ACCURACY {meetingIntelligence.speakerAccuracyPercent}% @@ -355,7 +355,7 @@ export default async function PipelinesPage(): Promise { - ACTIVE MEETINGS + ACTIVE MEETINGS {meetingIntelligence.activeMeetingSessions} Live @@ -364,7 +364,7 @@ export default async function PipelinesPage(): Promise { - TEMPLATES TODAY + TEMPLATES TODAY {meetingIntelligence.templatesGeneratedToday} Docs @@ -373,7 +373,7 @@ export default async function PipelinesPage(): Promise { - MINDMAP EXPORTS + MINDMAP EXPORTS {meetingIntelligence.mindmapsExported} Maps diff --git a/apps/admin/src/app/(admin)/releases/page.tsx b/apps/admin/src/app/(admin)/releases/page.tsx index 500d4bb..76c67da 100644 --- a/apps/admin/src/app/(admin)/releases/page.tsx +++ b/apps/admin/src/app/(admin)/releases/page.tsx @@ -83,7 +83,7 @@ function HeaderBar({ feedLive, repoHtmlUrl }: { feedLive: boolean; repoHtmlUrl: )} - + Desktop & mobile installers, SHA-256 integrity, download telemetry @@ -162,7 +162,7 @@ function KpiCards({ hub }: { hub: ReleaseHub }): React.ReactElement { {cards.map((card) => ( {card.title} diff --git a/apps/admin/src/app/(admin)/subscriptions/new/client.tsx b/apps/admin/src/app/(admin)/subscriptions/new/client.tsx index a1ca5bc..3137a58 100644 --- a/apps/admin/src/app/(admin)/subscriptions/new/client.tsx +++ b/apps/admin/src/app/(admin)/subscriptions/new/client.tsx @@ -20,7 +20,7 @@ export function NewSubscriptionClient({ initialUserId }: NewSubscriptionClientPr return ( - + Target Account User ID or UID @@ -175,7 +175,7 @@ export default async function AdminSubscriptionsPage({ searchParams }: PageProps - + Total Subscription Records @@ -192,7 +192,7 @@ export default async function AdminSubscriptionsPage({ searchParams }: PageProps - + Active Subscriptions @@ -209,7 +209,7 @@ export default async function AdminSubscriptionsPage({ searchParams }: PageProps - + Renewal Failures @@ -267,7 +267,7 @@ export default async function AdminSubscriptionsPage({ searchParams }: PageProps {s.profile_name ?? s.user_id} - + {s.user_id} diff --git a/apps/admin/src/app/(admin)/usage/page.tsx b/apps/admin/src/app/(admin)/usage/page.tsx index cd4480c..d2ae753 100644 --- a/apps/admin/src/app/(admin)/usage/page.tsx +++ b/apps/admin/src/app/(admin)/usage/page.tsx @@ -111,7 +111,7 @@ export default async function AdminUsagePage(): Promise { fontFamily: FONT_MONO, fontSize: '11px', color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, mt: 0.25, }} > @@ -134,7 +134,7 @@ export default async function AdminUsagePage(): Promise { {metricCards.map((m) => ( - + {m.title} diff --git a/apps/admin/src/app/(admin)/users/[id]/page.tsx b/apps/admin/src/app/(admin)/users/[id]/page.tsx index 8253147..650a43e 100644 --- a/apps/admin/src/app/(admin)/users/[id]/page.tsx +++ b/apps/admin/src/app/(admin)/users/[id]/page.tsx @@ -143,10 +143,9 @@ export default async function AdminUserDetailPage({ params }: PageProps): Promis display: 'flex', alignItems: 'center', justifyContent: 'center', - color: 'var(--d3-text-inverse)', + color: 'var(--d3-accent-ink)', fontWeight: 500, fontSize: '20px', - boxShadow: '0 0 20px var(--d3-accent-glow)', }} > {((profile.name as string) || (profile.email as string) || '?').charAt(0).toUpperCase()} diff --git a/apps/admin/src/app/(admin)/users/page.tsx b/apps/admin/src/app/(admin)/users/page.tsx index dd63001..3ca3a3f 100644 --- a/apps/admin/src/app/(admin)/users/page.tsx +++ b/apps/admin/src/app/(admin)/users/page.tsx @@ -95,7 +95,7 @@ export default async function AdminUsersPage({ searchParams }: PageProps): Promi fontFamily: FONT_MONO, fontSize: '11px', color: C.dim, - letterSpacing: '0.04em', + letterSpacing: 0, mt: 0.25, }} > @@ -170,10 +170,9 @@ export default async function AdminUsersPage({ searchParams }: PageProps): Promi display: 'flex', alignItems: 'center', justifyContent: 'center', - color: 'var(--d3-text-inverse)', + color: 'var(--d3-accent-ink)', fontWeight: 500, fontSize: '13px', - boxShadow: isProPlus ? '0 0 12px var(--d3-tag-purple)' : 'none', }} > {u.name.charAt(0)} @@ -206,7 +205,7 @@ export default async function AdminUsersPage({ searchParams }: PageProps): Promi {/* Daily Quota Status */} - + Open user detail for measured usage diff --git a/apps/admin/src/app/login/page.tsx b/apps/admin/src/app/login/page.tsx index 5ccfa90..358a7d2 100644 --- a/apps/admin/src/app/login/page.tsx +++ b/apps/admin/src/app/login/page.tsx @@ -128,10 +128,11 @@ function LoginForm(): React.ReactElement { mb: 2, }} > - + @@ -168,7 +169,7 @@ function LoginForm(): React.ReactElement { severity="error" sx={{ mb: 2.5, - bgcolor: 'var(--d3-status-danger)', + bgcolor: 'var(--d3-status-dangerBg)', color: 'var(--d3-status-danger)', border: '1px solid var(--d3-status-danger)', borderRadius: '10px', @@ -246,7 +247,7 @@ function LoginForm(): React.ReactElement { - + OR VIA OAUTH @@ -279,7 +280,7 @@ function LoginForm(): React.ReactElement { {/* Footer Note */} - + Protected by D3RO Unified Auth & Session Cookie Cryptography diff --git a/apps/admin/src/components/admin-sidebar.tsx b/apps/admin/src/components/admin-sidebar.tsx index c21a3b0..5f4162e 100644 --- a/apps/admin/src/components/admin-sidebar.tsx +++ b/apps/admin/src/components/admin-sidebar.tsx @@ -168,34 +168,19 @@ export function AdminSidebar({ identity }: { height: '100%', display: 'flex', flexDirection: 'column', - bgcolor: 'var(--d3-bg-card-soft)', - backdropFilter: 'blur(28px)', - border: `1px solid ${C.border}`, - borderRadius: '22px', + bgcolor: C.sidebar, + border: `1px solid ${C.borderHl}`, + borderRadius: '12px', flexShrink: 0, position: 'relative', overflow: 'hidden', - boxShadow: '0 24px 60px var(--d3-scrim), inset 0 1px 0 var(--d3-glass-hairlineStrong)', }} > - {/* Top Ambient Sheen */} - - {/* Brand Header */} - + @@ -230,7 +214,7 @@ export function AdminSidebar({ identity }: { fontFamily: FONT_SANS, fontSize: '15px', fontWeight: 500, - letterSpacing: '-0.02em', + letterSpacing: '-0.01em', color: C.bright, lineHeight: 1.2, }} @@ -240,10 +224,10 @@ export function AdminSidebar({ identity }: { INTELLIGENCE CRM @@ -260,7 +244,7 @@ export function AdminSidebar({ identity }: { px: 1, py: 0.35, borderRadius: '999px', - bgcolor: 'var(--d3-status-success)', + bgcolor: 'var(--d3-status-successBg)', border: '1px solid var(--d3-status-success)', }} > @@ -270,11 +254,10 @@ export function AdminSidebar({ identity }: { height: 6, borderRadius: '50%', bgcolor: 'var(--d3-status-success)', - boxShadow: '0 0 8px var(--d3-status-success)', animation: 'pulse-ring 2s infinite', }} /> - + SESSION @@ -284,6 +267,7 @@ export function AdminSidebar({ identity }: { {/* Nav Scroll Area */} {group.title} @@ -318,29 +301,33 @@ export function AdminSidebar({ identity }: { return ( router.push(item.path)} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault() + router.push(item.path) + } + }} sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', px: 1.75, py: 1.1, - borderRadius: '12px', + borderRadius: '8px', cursor: 'pointer', position: 'relative', - border: `1px solid ${active ? 'var(--d3-accent-glow)' : 'transparent'}`, - bgcolor: active ? 'var(--d3-accent-glow)' : 'transparent', + border: `1px solid ${active ? 'var(--d3-accent-dim)' : 'transparent'}`, + bgcolor: active ? 'var(--d3-accent-dim)' : 'transparent', color: active ? C.bright : C.text, - boxShadow: active ? '0 0 20px var(--d3-accent-glow), inset 0 1px 0 var(--d3-overlay-strong)' : 'none', - transition: 'all 0.18s cubic-bezier(0.16, 1, 0.3, 1)', + transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1)', '&:hover': { - bgcolor: active ? 'var(--d3-accent-glow)' : 'var(--d3-bg-raised-soft)', + bgcolor: active ? 'var(--d3-accent-dim)' : 'var(--d3-overlay-soft)', borderColor: active ? 'var(--d3-accent-light)' : C.border, color: C.bright, - transform: 'translateX(3px)', - }, - '&:active': { - transform: 'scale(0.98)', }, }} > @@ -360,7 +347,7 @@ export function AdminSidebar({ identity }: { fontFamily: FONT_SANS, fontSize: '13px', fontWeight: active ? 600 : 500, - letterSpacing: '-0.01em', + letterSpacing: 0, }} > {item.label} @@ -391,9 +378,9 @@ export function AdminSidebar({ identity }: { alignItems: 'center', justifyContent: 'space-between', p: 1.25, - borderRadius: '12px', + borderRadius: '10px', border: `1px solid ${C.borderHl}`, - bgcolor: 'var(--d3-bg-card-soft)', + bgcolor: C.card, transition: 'border-color 0.15s ease', '&:hover': { borderColor: C.accentLight, @@ -406,14 +393,13 @@ export function AdminSidebar({ identity }: { width: 32, height: 32, borderRadius: '8px', - background: 'linear-gradient(135deg, var(--d3-accent-dark) 0%, var(--d3-accent-main) 100%)', + bgcolor: 'var(--d3-accent-solid)', display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 500, fontSize: '13px', - color: 'var(--d3-text-inverse)', - boxShadow: '0 0 12px var(--d3-accent-glow)', + color: 'var(--d3-accent-ink)', }} > {identity.email.slice(0, 1).toUpperCase()} @@ -422,18 +408,23 @@ export function AdminSidebar({ identity }: { {identity.email} - + {identity.role.toUpperCase()} void handleLogout()} title="Sign Out" sx={{ p: 0.75, borderRadius: '8px', + bgcolor: 'transparent', + border: 'none', color: C.dim, cursor: 'pointer', display: 'flex', @@ -442,7 +433,7 @@ export function AdminSidebar({ identity }: { transition: 'all 0.15s ease', '&:hover': { color: C.red400, - bgcolor: 'var(--d3-status-danger)', + bgcolor: 'var(--d3-status-dangerBg)', }, }} > diff --git a/apps/admin/src/components/charts/dau-chart.tsx b/apps/admin/src/components/charts/dau-chart.tsx index b71d617..20ee032 100644 --- a/apps/admin/src/components/charts/dau-chart.tsx +++ b/apps/admin/src/components/charts/dau-chart.tsx @@ -32,10 +32,10 @@ export function DauChart({ data }: DauChartProps): React.ReactElement { val.slice(5)} /> - + val.slice(5)} /> - + - + ✕ diff --git a/apps/admin/src/components/payment-history.tsx b/apps/admin/src/components/payment-history.tsx index ce57e79..6610122 100644 --- a/apps/admin/src/components/payment-history.tsx +++ b/apps/admin/src/components/payment-history.tsx @@ -131,7 +131,7 @@ export function PaymentHistory({ userId }: PaymentHistoryProps): React.ReactElem }} > - + {new Date(log.created_at).toLocaleString()} diff --git a/apps/admin/src/lib/console-theme.ts b/apps/admin/src/lib/console-theme.ts index 2e15334..d477554 100644 --- a/apps/admin/src/lib/console-theme.ts +++ b/apps/admin/src/lib/console-theme.ts @@ -22,10 +22,10 @@ export const C = { borderStrong: 'rgba(148, 180, 255, 0.24)', // text - dim: '#67789e', + dim: '#7e8eb0', text: '#93a4c8', bright: '#eef2fb', - muted: '#3c4763', + muted: '#5c6b8a', // accents & gradients accent: '#3b82f6', @@ -46,31 +46,28 @@ export const C = { export const FONT_SANS = d3roFontSans export const FONT_MONO = d3roFontMono -/** High-End Double-Bezel Glass Panel Style */ +/** Flat Precision Panel Style (v4) */ export const panelSx = { position: 'relative' as const, - bgcolor: 'rgba(17, 26, 48, 0.65)', - backdropFilter: 'blur(24px)', - border: `1px solid ${C.border}`, - borderRadius: '20px', + bgcolor: C.card, + border: `1px solid ${C.borderHl}`, + borderRadius: '12px', overflow: 'hidden', - boxShadow: '0 16px 40px rgba(3, 7, 18, 0.5), inset 0 1px 0 rgba(148, 180, 255, 0.08)', - transition: 'border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, transform 0.25s ease', + boxShadow: 'none', + transition: 'border-color 160ms cubic-bezier(0.22, 1, 0.36, 1)', '&:hover': { - borderColor: C.borderHl, - boxShadow: '0 20px 48px rgba(3, 7, 18, 0.6), inset 0 1px 0 rgba(148, 180, 255, 0.15)', + borderColor: C.borderStrong, }, } -/** Inner Glass Core Style (Double-Bezel nested architecture) */ +/** Inner Core Style (v4) */ export const innerCoreSx = { position: 'relative' as const, - borderRadius: '14px', - bgcolor: 'rgba(13, 21, 38, 0.75)', - backdropFilter: 'blur(16px)', + borderRadius: '10px', + bgcolor: C.inset, border: `1px solid ${C.border}`, p: 2.5, - boxShadow: 'inset 0 2px 6px rgba(3, 7, 18, 0.5)', + boxShadow: 'none', } /** Interactive Table Style */ @@ -85,8 +82,7 @@ export const tableSx = { pb: 1.5, fontWeight: 500, fontSize: '11px', - textTransform: 'uppercase' as const, - letterSpacing: '0.08em', + letterSpacing: 0, color: C.dim, textAlign: 'left' as const, borderBottom: `1px solid ${C.borderHl}`, @@ -96,23 +92,23 @@ export const tableSx = { py: 1.75, textAlign: 'left' as const, color: C.text, - bgcolor: 'rgba(17, 26, 48, 0.45)', + bgcolor: C.card, borderTop: `1px solid ${C.border}`, borderBottom: `1px solid ${C.border}`, - transition: 'all 0.15s cubic-bezier(0.16, 1, 0.3, 1)', + transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1)', '&:first-of-type': { borderLeft: `1px solid ${C.border}`, - borderTopLeftRadius: '10px', - borderBottomLeftRadius: '10px', + borderTopLeftRadius: '8px', + borderBottomLeftRadius: '8px', }, '&:last-of-type': { borderRight: `1px solid ${C.border}`, - borderTopRightRadius: '10px', - borderBottomRightRadius: '10px', + borderTopRightRadius: '8px', + borderBottomRightRadius: '8px', }, }, '& tr:hover td': { - bgcolor: 'rgba(26, 38, 68, 0.75)', + bgcolor: C.cardHover, borderColor: C.borderHl, color: C.bright, }, @@ -126,35 +122,30 @@ export const filterBtnSx = (active: boolean) => ({ fontFamily: FONT_SANS, fontSize: '11px', fontWeight: 500, - letterSpacing: '0.04em', + letterSpacing: 0, textTransform: 'none' as const, cursor: 'pointer', - border: `1px solid ${active ? 'rgba(59, 130, 246, 0.4)' : C.border}`, - bgcolor: active ? 'rgba(59, 130, 246, 0.16)' : 'rgba(17, 26, 48, 0.5)', + border: `1px solid ${active ? 'rgba(59, 130, 246, 0.4)' : C.borderHl}`, + bgcolor: active ? 'rgba(59, 130, 246, 0.16)' : C.card, color: active ? C.bright : C.dim, - boxShadow: active ? '0 0 16px rgba(59, 130, 246, 0.25)' : 'none', - backdropFilter: 'blur(12px)', + boxShadow: 'none', '&:hover': { - bgcolor: active ? 'rgba(59, 130, 246, 0.22)' : 'rgba(26, 38, 68, 0.8)', - borderColor: active ? C.accentLight : C.borderHl, + bgcolor: active ? 'rgba(59, 130, 246, 0.22)' : C.cardHover, + borderColor: active ? C.accentLight : C.borderStrong, color: C.bright, - transform: 'translateY(-1px)', }, - '&:active': { - transform: 'translateY(0) scale(0.98)', - }, - transition: 'all 0.15s cubic-bezier(0.16, 1, 0.3, 1)', + transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1)', }) /** Semantic Status Badge Style */ export function statusBadgeSx(variant: 'green' | 'red' | 'orange' | 'blue' | 'purple' | 'cyan') { const colorMap = { - green: { bg: 'rgba(16, 185, 129, 0.12)', fg: C.green400, border: 'rgba(16, 185, 129, 0.3)', glow: '0 0 12px rgba(16, 185, 129, 0.2)' }, - red: { bg: 'rgba(239, 68, 68, 0.12)', fg: C.red400, border: 'rgba(239, 68, 68, 0.3)', glow: '0 0 12px rgba(239, 68, 68, 0.2)' }, - orange: { bg: 'rgba(245, 158, 11, 0.12)', fg: C.orange400, border: 'rgba(245, 158, 11, 0.3)', glow: '0 0 12px rgba(245, 158, 11, 0.2)' }, - blue: { bg: 'rgba(59, 130, 246, 0.12)', fg: C.accentLight, border: 'rgba(59, 130, 246, 0.3)', glow: '0 0 12px rgba(59, 130, 246, 0.2)' }, - purple: { bg: 'rgba(139, 92, 246, 0.12)', fg: C.purple400, border: 'rgba(139, 92, 246, 0.3)', glow: '0 0 12px rgba(139, 92, 246, 0.2)' }, - cyan: { bg: 'rgba(6, 182, 212, 0.12)', fg: C.cyanLight, border: 'rgba(6, 182, 212, 0.3)', glow: '0 0 12px rgba(6, 182, 212, 0.2)' }, + green: { bg: 'rgba(16, 185, 129, 0.12)', fg: C.green400, border: 'rgba(16, 185, 129, 0.3)' }, + red: { bg: 'rgba(239, 68, 68, 0.12)', fg: C.red400, border: 'rgba(239, 68, 68, 0.3)' }, + orange: { bg: 'rgba(245, 158, 11, 0.12)', fg: C.orange400, border: 'rgba(245, 158, 11, 0.3)' }, + blue: { bg: 'rgba(59, 130, 246, 0.12)', fg: C.accentLight, border: 'rgba(59, 130, 246, 0.3)' }, + purple: { bg: 'rgba(139, 92, 246, 0.12)', fg: C.purple400, border: 'rgba(139, 92, 246, 0.3)' }, + cyan: { bg: 'rgba(6, 182, 212, 0.12)', fg: C.cyanLight, border: 'rgba(6, 182, 212, 0.3)' }, } const c = colorMap[variant] return { @@ -167,35 +158,30 @@ export function statusBadgeSx(variant: 'green' | 'red' | 'orange' | 'blue' | 'pu fontSize: '11px', fontFamily: FONT_SANS, fontWeight: 500, - letterSpacing: '0.04em', + letterSpacing: 0, bgcolor: c.bg, color: c.fg, border: `1px solid ${c.border}`, - boxShadow: c.glow, - backdropFilter: 'blur(8px)', + boxShadow: 'none', } } -/** Primary Action Button Style with Gradient & Glow */ +/** Primary Action Button Style */ export const primaryButtonSx = { - background: 'linear-gradient(135deg, #1d4ed8 0%, #3b82f6 55%, #60a5fa 100%)', + bgcolor: C.accentDark, color: '#ffffff', fontFamily: FONT_SANS, fontSize: '13px', fontWeight: 500, - borderRadius: '10px', + borderRadius: '8px', px: 2.5, py: 1, - boxShadow: '0 0 0 1px rgba(59,130,246,0.35), 0 8px 24px rgba(37,99,235,0.35)', + boxShadow: 'none', textTransform: 'none' as const, - transition: 'all 0.2s cubic-bezier(0.16, 1, 0.3, 1)', + transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1)', '&:hover': { - filter: 'brightness(1.12)', - boxShadow: '0 0 0 1px rgba(96,165,250,0.5), 0 12px 32px rgba(59,130,246,0.5)', - transform: 'translateY(-1px)', - }, - '&:active': { - transform: 'translateY(0) scale(0.98)', + bgcolor: C.accent, + boxShadow: 'none', }, } diff --git a/apps/desktop/src/main/bootstrap.ts b/apps/desktop/src/main/bootstrap.ts index 8aa6c7b..4ab0f67 100644 --- a/apps/desktop/src/main/bootstrap.ts +++ b/apps/desktop/src/main/bootstrap.ts @@ -249,16 +249,12 @@ async function initInputIntelligence(): Promise { typo.on('corrected', () => { if (suggestion.isPresentationActive) suggestion.dismiss('stale') }) - // 제안이 켜져 있을 때도 한영 전환(Araso 방식 영→한·한→영·혼합어)은 기본 기능으로 즉시 고치고, - // 일반 철자·모델 오타는 제안 창에 "지운 글자 → 고친 글자" 로 함께 내놓는다. + // 인플레이스 자동 교정(handleTypingContext)은 타이핑과 절대 경합하지 않도록 + // 0.1ms 결정적 한영·영문오타 엔진(layoutOnly: true, 커서 직전 어절만 교체)만 즉시 실행하고, + // 문장 단위 로컬 LLM(Gemma) 오타 교정은 키보드를 건드리지 않는 제안 팝업(propose)에서만 제시한다. suggestion.setTypoProposer({ propose: (context, signal, options) => typo.propose(context, signal, options) }) telemetry.on('typed-context', (context) => { - if (suggestion.isEnabled()) { - const layoutVerdict = typo.handleTypingContext(context, { layoutOnly: true }) - if (layoutVerdict === 'pass') suggestion.handleTypingContext(context) - return - } - const verdict = typo.handleTypingContext(context) + const verdict = typo.handleTypingContext(context, { layoutOnly: true, trailingWordOnly: true }) if (verdict === 'pass') suggestion.handleTypingContext(context) }) telemetry.on('state-changed', (state) => diff --git a/apps/desktop/src/main/services/SuggestionService.ts b/apps/desktop/src/main/services/SuggestionService.ts index aa8ba97..9ed2a18 100644 --- a/apps/desktop/src/main/services/SuggestionService.ts +++ b/apps/desktop/src/main/services/SuggestionService.ts @@ -571,9 +571,23 @@ export class SuggestionService extends EventEmitter { this.emit('state-changed', this.getState()) } - /** 설정에서 명시적으로 제안을 켤 때만 모델을 짧게 준비한다. */ - warmUp(options: { silent?: boolean } = {}): Promise { - if (!this.isEnabled()) return Promise.resolve() + private _isModelWarmNeeded(allowForTypo = false): boolean { + if (this.isEnabled()) return true + return ( + allowForTypo && + configGet('typoAutoCorrectEnabled') !== false && + configGet('typoAutoCorrectUseModel') !== false + ) + } + + /** 타이핑 중 오타·한영 교정 모델(Gemma)과 제안 모델을 백그라운드에서 미리 데운다. */ + ensureWarmForTyping(context: TypingContext): void { + this._keepWarm(context, Date.now()) + } + + /** 설정에서 명시적으로 제안을 켤 때 또는 백그라운드 오타 교정 워밍업 시 모델을 짧게 준비한다. */ + warmUp(options: { silent?: boolean; allowForTypo?: boolean } = {}): Promise { + if (!this._isModelWarmNeeded(options.allowForTypo === true)) return Promise.resolve() if (this._warmUpPromise) return this._warmUpPromise const abort = new AbortController() @@ -582,7 +596,7 @@ export class SuggestionService extends EventEmitter { // 열려 실제로 제안을 기다릴 때(_showWarming)만 한다. if (!options.silent) this._warmingUp = true this.emit('state-changed', this.getState()) - const warmUp = this._warmUpUntilReady(abort) + const warmUp = this._warmUpUntilReady(abort, options.allowForTypo === true) this._warmUpPromise = warmUp void warmUp.finally(() => { if (this._warmUpPromise === warmUp) this._warmUpPromise = null @@ -591,10 +605,10 @@ export class SuggestionService extends EventEmitter { return warmUp } - private async _warmUpUntilReady(abort: AbortController): Promise { + private async _warmUpUntilReady(abort: AbortController, allowForTypo = false): Promise { try { for (let attempt = 0; attempt <= 15; attempt += 1) { - if (abort.signal.aborted || !this.isEnabled()) return + if (abort.signal.aborted || !this._isModelWarmNeeded(allowForTypo)) return if (!getLocalLLMService().isAvailable()) { if (attempt === 15) return await this._waitForWarmUpRetry(abort.signal) @@ -861,14 +875,14 @@ export class SuggestionService extends EventEmitter { * - 따뜻하지만 유지 시간이 얼마 안 남았으면 1토큰 요청으로 연장한다. */ private _keepWarm(context: TypingContext, now: number): void { - if (!this.isEnabled() || !context.typedRecently || !context.isEditable || context.isPassword) return + if (!this._isModelWarmNeeded(true) || !context.typedRecently || !context.isEditable || context.isPassword) return if (this._warmUpPromise || this._inFlight || this._filling) return const model = this.resolveModel() if (!model || !getLocalLLMService().isAvailable()) return if (!this._warmth.isWarm(model, now)) { if (this._warmth.isBackingOff(model, now, WARM_UP_FAILURE_BACKOFF_MS)) return logger.info(`타이핑 감지 — 식은 제안 모델을 미리 올린다 (model=${model})`) - void this.warmUp({ silent: true }) + void this.warmUp({ silent: true, allowForTypo: true }) return } if (this._warmth.warmUntil - now > KEEP_WARM_REFRESH_MS) return diff --git a/apps/desktop/src/main/services/TypoCorrectionService.ts b/apps/desktop/src/main/services/TypoCorrectionService.ts index e95eea8..b70a11b 100644 --- a/apps/desktop/src/main/services/TypoCorrectionService.ts +++ b/apps/desktop/src/main/services/TypoCorrectionService.ts @@ -38,7 +38,7 @@ import { type TypoCorrection, type TypoReplacementPlan } from '@d3ro/core/typo-correction' -import { isAppExcluded, isTerminalApp, shouldLearnFromApp } from '@d3ro/core/input-intelligence' +import { isAppExcluded, isTerminalApp } from '@d3ro/core/input-intelligence' import { analyzeWritingContext } from '@d3ro/core/writing-context' import { configGet, configSet } from './ConfigService' import { getLogger } from './LoggerService' @@ -56,13 +56,21 @@ const VOCABULARY_TTL_MS = 60_000 /** 제안용 모델 검사 응답 제한 — 제안 첫 후보가 그만큼 늦어진다. */ const PROPOSAL_CHECK_TIMEOUT_MS = 1500 /** 모델 검사 최소 구간 길이 (글자) */ -const MODEL_CHECK_MIN_CHARS = 6 +const MODEL_CHECK_MIN_CHARS = 3 /** 공백·문장부호로 단어가 끝난 직후 한영 전환(Araso) 최소 유휴 시간 (ms) */ const LAYOUT_BOUNDARY_MIN_IDLE_MS = 25 +/** 공백·문장부호로 끝난 어절에 수상한 자모·한영 오타가 있을 때 모델 검사를 시작할 최소 유휴 시간 (ms) */ +const SUSPICIOUS_BOUNDARY_MIN_IDLE_MS = 350 /** Vim 명령줄(:wq 등)에서 공백 없이 엔터를 치기 전 한영 전환 최소 유휴 시간 (ms) */ const LAYOUT_VIM_CMD_MIN_IDLE_MS = 135 /** 공백 없이 단어 끝에서 멈췄을 때 한영 전환(Araso) 최소 유휴 시간 (ms) — 단어 입력 도중(some->sometime) 끼어들지 않게 함 */ const LAYOUT_TRAILING_MIN_IDLE_MS = 650 +/** 타이핑 도중(짧은 유휴) 인플레이스 교정이 지울 수 있는 커서 앞 최대 글자 수 — 문장 전체 재작성 방지 */ +const MAX_FAST_DELETE_CHARS = 22 +/** 모델·자모 잡음 인플레이스 교정이 지울 수 있는 커서 앞 최대 글자 수 — 방금 친 마지막 어절만 교정 */ +const MAX_MODEL_DELETE_CHARS = 18 +/** 멈춘 뒤에도 인플레이스 교정이 한 번에 지울 수 있는 최대 글자 수 */ +const MAX_INPLACE_DELETE_CHARS = 32 /** 'typed-context' 에 대한 판단 — 제안 서비스로 그대로 넘길지(pass), 미룰지. */ export type TypoVerdict = 'pass' | 'correcting' | 'checking' @@ -116,8 +124,9 @@ const REVERT_LENGTH_TOLERANCE = 12 export class TypoCorrectionService extends EventEmitter { private _applying = false private _check: { abort: AbortController; prefix: string; context: TypingContext } | null = null - /** 마지막으로 결정적·모델 검사를 마친 구간 — 같은 구간을 되풀이해 묻지 않는다. */ + /** 마지막으로 결정적·모델 검사를 마친 구간(교정 전·후 모두 포함) — 같은 구간을 되풀이해 묻거나 연쇄 재교정하지 않는다. */ private _lastCheckedRegion = '' + private _lastPostRegion = '' private _lastApplied: AppliedCorrection | null = null private _vocabulary: { at: number; latin: Map; known: Set } | null = null @@ -154,7 +163,10 @@ export class TypoCorrectionService extends EventEmitter { * `layoutOnly`: 한영 전환(Araso 방식 영→한·한→영·혼합어 자동 변환)만 즉시 교정하고, * 일반 철자·모델 오타는 제안 오버레이(`propose()`)에 맡긴다. */ - handleTypingContext(context: TypingContext, options: { layoutOnly?: boolean } = {}): TypoVerdict { + handleTypingContext( + context: TypingContext, + options: { layoutOnly?: boolean; trailingWordOnly?: boolean } = {} + ): TypoVerdict { this._watchRevert(context) if (this._applying) return 'correcting' @@ -170,6 +182,11 @@ export class TypoCorrectionService extends EventEmitter { if (!this._eligible(context, { allowComposing: true })) return 'pass' const prefix = context.prefix + const region = prefix.slice(typoRegionStart(prefix)) + if (region !== this._lastCheckedRegion && region !== this._lastPostRegion) { + this._lastCheckedRegion = '' + this._lastPostRegion = '' + } const hasTrailingBoundary = /[ \t.,!?;:]$/u.test(prefix) const isVimCommand = context.vimMode === 'command' || prefix.trimStart().startsWith(':') const minLayoutIdle = hasTrailingBoundary @@ -179,36 +196,79 @@ export class TypoCorrectionService extends EventEmitter { : LAYOUT_TRAILING_MIN_IDLE_MS if (context.idleMs < minLayoutIdle) return 'pass' - const region = prefix.slice(typoRegionStart(prefix)) - if (!region.trim() || region === this._lastCheckedRegion) return 'pass' + if (!region.trim() || this._isRegionChecked(region)) return 'pass' - // Chromium/Discord 등은 영문 입력·공백 뒤에도 comp=true 를 유지하고, 한글 자판에서 ㅎ샤ㅗㅕㅠ에 를 치고 - // 멈췄을 때도 마지막 음절이 조합 중이다. 한영 전환(layoutOnly)은 조합 여부와 짧은 유휴에서도 즉시 허용하고, - // 일반 철자·모델 검사는 터미널·개발 도구가 아니고 조합이 없으며 TYPO_MIN_IDLE_MS 이상 멈췄을 때만 실행한다. - const isTerminalOrDev = - context.terminalMode === true || - isTerminalApp(context.appName) || - !shouldLearnFromApp(context.appName) + // Chromium/Discord/Electron 등은 한글 입력·공백 뒤에도 comp=true 를 유지한다. + // 1단계(한영 전환 layoutOnly)는 단어 경계(25ms)와 어절 끝 유휴(650ms)에서 즉시 실행하고, + // 2단계(철자 사전 + Gemma 배경 오타·한영 보정)는 터미널이 아니면서 유휴 조건을 충족했을 때 실행한다. + const isTerminal = context.terminalMode === true || isTerminalApp(context.appName) + const suspicious = hasSuspiciousTypo(region) + const minFullCheckIdle = + hasTrailingBoundary && suspicious + ? SUSPICIOUS_BOUNDARY_MIN_IDLE_MS + : context.isComposing && !hasTrailingBoundary + ? Math.ceil(TYPO_MIN_IDLE_MS * 1.15) + : TYPO_MIN_IDLE_MS const fullCheckEligible = options.layoutOnly !== true && - !isTerminalOrDev && - !context.isComposing && - context.idleMs >= TYPO_MIN_IDLE_MS + !isTerminal && + context.idleMs >= minFullCheckIdle const ignoredWords = configGet('typoIgnoredWords') ?? [] const vocabulary = this._loadVocabulary() const keyAtDecision = this._deps.lastKeyAt() - const corrections = detectTypos(prefix, { + const maxDeterministicSpan = + options.trailingWordOnly === true || context.idleMs < TYPO_MIN_IDLE_MS + ? MAX_FAST_DELETE_CHARS + : MAX_INPLACE_DELETE_CHARS + const allCorrections = detectTypos(prefix, { includeTrailingToken: true, ignoredWords, vocabulary: vocabulary.latin, layoutOnly: !fullCheckEligible, - terminalMode: context.terminalMode === true || isTerminalApp(context.appName) + terminalMode: isTerminal }) + const baseCorrections: TypoCorrection[] = [] + if (options.trailingWordOnly !== true) { + for (const c of allCorrections) { + if (prefix.length - c.start <= maxDeterministicSpan) { + baseCorrections.push(c) + } + } + } else { + // trailingWordOnly: 커서 끝에서 가까운 연속 교정 사슬만 남긴다 (예: "ㅑ ㅊ무'ㅅ " → "I can't ", + // 반면 문장 앞쪽의 이미 지나간 긴 문장은 건드리지 않는다). + for (let i = allCorrections.length - 1; i >= 0; i -= 1) { + const c = allCorrections[i] + if (prefix.length - c.start > maxDeterministicSpan) break + if (baseCorrections.length === 0) { + const tailAfter = prefix.slice(c.end) + const nonSpaceTailLen = tailAfter.replace(/[ \t.,!?;:]/gu, '').length + if (nonSpaceTailLen > 2) break + baseCorrections.unshift(c) + } else { + const nextCorr = baseCorrections[0] + const between = prefix.slice(c.end, nextCorr.start) + if (/^[ \t.,!?;:]*$/u.test(between) || between.trim().length <= 2) { + baseCorrections.unshift(c) + } else { + break + } + } + } + } + const loneJamoRemovals = + !isTerminal && options.trailingWordOnly !== true && (fullCheckEligible || baseCorrections.length > 0) + ? detectJamoNoise(prefix, { ignoredWords }).filter( + (c) => c.to === '' && /[ \t]$/u.test(c.from) && prefix.length - c.start <= maxDeterministicSpan + ) + : [] + const corrections = + loneJamoRemovals.length > 0 ? mergeTypoCorrections(baseCorrections, loneJamoRemovals) : baseCorrections const plan = planTypoReplacement(prefix, corrections) - if (plan) { - this._lastCheckedRegion = region + if (plan && plan.deleteCount <= maxDeterministicSpan) { + this._markRegionChecked(region) void this._apply(plan, context, keyAtDecision) return 'correcting' } @@ -216,13 +276,25 @@ export class TypoCorrectionService extends EventEmitter { return 'pass' } + const worthModel = this._worthModelCheck(region) const model = configGet('typoAutoCorrectUseModel') !== false ? this._deps.warmModel() : null - if (!model || !this._worthModelCheck(region)) { - this._lastCheckedRegion = region + if (!model || !worthModel) { + const tailJamo = detectJamoNoise(prefix, { ignoredWords }).filter( + (c) => prefix.length - c.start <= MAX_MODEL_DELETE_CHARS + ) + const jamoPlan = planTypoReplacement(prefix, tailJamo) + if (jamoPlan && jamoPlan.deleteCount <= MAX_MODEL_DELETE_CHARS) { + this._markRegionChecked(region) + void this._apply(jamoPlan, context, keyAtDecision) + return 'correcting' + } + if (!worthModel || configGet('typoAutoCorrectUseModel') === false) { + this._markRegionChecked(region) + } return 'pass' } - this._lastCheckedRegion = region + this._markRegionChecked(region) const abort = new AbortController() this._check = { abort, prefix, context } void this._runModelCheck(model, context, abort, keyAtDecision, ignoredWords, vocabulary.known) @@ -313,10 +385,17 @@ export class TypoCorrectionService extends EventEmitter { return true } - /** 모델에 물어볼 만한 구간인가 — 끝난 단어가 2개 이상인 글. */ + /** 모델에 물어볼 만한 구간인가 — 2어절 이상이거나 수상한 1어절(낱자·비상용 음절·미등록 영타) 또는 공백으로 끝난 4자 이상 어절. */ private _worthModelCheck(region: string): boolean { - if (region.replace(/\s+/gu, '').length < MODEL_CHECK_MIN_CHARS) return false - return tokenizeWords(region).length >= 2 + const compact = region.replace(/\s+/gu, '') + if (compact.length < MODEL_CHECK_MIN_CHARS) return false + const words = tokenizeWords(region) + if (words.length >= 2) return compact.length >= 4 + if (words.length === 1) { + if (hasSuspiciousTypo(region)) return true + return compact.length >= 4 && /[ \t.,!?;:]$/u.test(region) + } + return false } private _loadVocabulary(): { latin: Map; known: Set } { @@ -352,10 +431,15 @@ export class TypoCorrectionService extends EventEmitter { let corrected = false try { const prefix = context.prefix - const corrections = await this._askModel(model, prefix, abort.signal, ignoredWords, knownWords) + const fromModel = await this._askModel(model, prefix, abort.signal, ignoredWords, knownWords) if (abort.signal.aborted || this._check?.abort !== abort) return - const plan = planTypoReplacement(prefix, corrections) - if (!plan) return + // 인플레이스 모델 교정은 커서 바로 앞 어절(MAX_MODEL_DELETE_CHARS 이내)만 고친다. + // 문장 앞쪽 단어를 고치려고 50~70자를 통째로 백스페이스하면 사용자의 다음 타이핑과 정면 충돌한다. + const tailCorrections = mergeTypoCorrections(fromModel, detectJamoNoise(prefix, { ignoredWords })).filter( + (c) => prefix.length - c.start <= MAX_MODEL_DELETE_CHARS + ) + const plan = planTypoReplacement(prefix, tailCorrections) + if (!plan || plan.deleteCount > MAX_MODEL_DELETE_CHARS) return // 검사하는 사이 사용자가 더 쳤으면 접두가 달라져 위에서 취소됐다. 여기서 한 번 더 키를 본다. this._check = null corrected = await this._apply(plan, context, keyAtDecision) @@ -405,16 +489,33 @@ export class TypoCorrectionService extends EventEmitter { // ── 적용 ─────────────────────────────────────────────── + private _isRegionChecked(region: string): boolean { + return region === this._lastCheckedRegion || (this._lastPostRegion !== '' && region === this._lastPostRegion) + } + + private _markRegionChecked(region: string, postRegion?: string): void { + this._lastCheckedRegion = region + if (postRegion !== undefined) { + this._lastPostRegion = postRegion + } + } + + private _unmarkRegionChecked(region: string): void { + if (this._lastCheckedRegion === region) this._lastCheckedRegion = '' + if (this._lastPostRegion === region) this._lastPostRegion = '' + } + private async _apply(plan: TypoReplacementPlan, context: TypingContext, keyAtDecision: number): Promise { + const preRegion = context.prefix.slice(typoRegionStart(context.prefix)) if (this._deps.lastKeyAt() !== keyAtDecision) { - this._lastCheckedRegion = '' + this._unmarkRegionChecked(preRegion) logger.debug('오타 교정 취소: 판단 뒤 키 입력이 있었다') return false } if (context.windowHandle != null) { const current = this._deps.foregroundHandle() if (current !== null && current !== context.windowHandle) { - this._lastCheckedRegion = '' + this._unmarkRegionChecked(preRegion) logger.debug('오타 교정 취소: 포커스가 다른 창으로 옮겨 갔다') return false } @@ -434,15 +535,19 @@ export class TypoCorrectionService extends EventEmitter { : await this._deps.replaceBeforeCaret(plan.deleteCount, plan.insertText) if (!ok) { cancelInsert() - this._lastCheckedRegion = '' + this._unmarkRegionChecked(preRegion) logger.warn('오타 교정 삽입 실패') return false } + const postPrefix = + context.prefix.slice(0, Math.max(0, context.prefix.length - plan.deleteCount)) + plan.insertText + const postRegion = postPrefix.slice(typoRegionStart(postPrefix)) + this._markRegionChecked(preRegion, postRegion) this._lastApplied = { corrections: plan.corrections, completedAt: Date.now(), tailLength: plan.insertText.length, - prefixLength: context.prefix.length - plan.deleteCount + plan.insertText.length, + prefixLength: postPrefix.length, prefixBefore: context.prefix.slice(0, Math.max(0, context.prefix.length - plan.deleteCount)), windowHandle: context.windowHandle ?? null } diff --git a/apps/desktop/src/main/services/llm-prompts.ts b/apps/desktop/src/main/services/llm-prompts.ts index 4e09528..a422a57 100644 --- a/apps/desktop/src/main/services/llm-prompts.ts +++ b/apps/desktop/src/main/services/llm-prompts.ts @@ -17,6 +17,7 @@ import { type WritingRegister } from '@d3ro/core/writing-context' import { containsEmoji } from '@d3ro/core/input-intelligence' +import { buildModelTypoHints } from '@d3ro/core/typo-correction' const logger = getLogger('llm-prompts') @@ -455,14 +456,15 @@ export { SUGGESTION_SYSTEM_PROMPT, SUGGESTION_CONTINUE_SYSTEM_PROMPT } * 띄어쓰기·문체·단어 선택은 고치지 않는다. 호출자는 core `validateModelCorrections` 로 * 결과를 다시 거른다(모델 출력은 신뢰하지 않는다). */ -const TYPO_CHECK_SYSTEM_PROMPT = `사용자가 입력창에 방금 친 문장에서 오타만 찾습니다. +const TYPO_CHECK_SYSTEM_PROMPT = `사용자가 입력창에 방금 친 문장에서 오타와 한영 자판 오타를 찾습니다. 규칙: - 잘못 누른 글자, 빠지거나 겹친 글자, 자모가 뒤바뀐 글자, 틀린 맞춤법 철자처럼 명백한 오타만 고르세요. +- 한영키가 잘못 눌린 채 입력된 영단어·한글 단어(예: ㅗ디ㅐ => hello, ㅡㅁ가둥 => markdown, 네갸ㅜㅎ에서 => spring에서, dkssudgktpd => 안녕하세요)도 [한영 자판 변환 참고]와 문맥을 보고 바르게 고치세요. - 띄어쓰기, 문장부호, 말투, 단어 선택, 어순은 고치지 마세요. - 고유명사, 약어, 신조어, 외래어, 일부러 쓴 줄임말·구어체(ㅋㅋ, 넘, 젤 등)는 그대로 두세요. - 확실하지 않으면 고치지 마세요. -- 오타마다 한 줄에 "틀린단어 => 고친단어" 형식으로 출력하세요. 단어는 문장에 나온 어절 그대로 쓰세요. +- 오타마다 한 줄에 "틀린단어 => 고친단어" 형식으로 출력하세요. 왼쪽에는 [검사할 문장]에 나온 어절 원문을 그대로 쓰세요. - 오타가 없으면 "없음" 한 단어만 출력하세요. 다른 설명은 쓰지 마세요.` export function buildTypoCheckPrompt(input: { sentence: string; previous?: string | null }): { @@ -471,8 +473,13 @@ export function buildTypoCheckPrompt(input: { sentence: string; previous?: strin } { const sections: string[] = [] const previous = input.previous?.replace(/\s+/gu, ' ').trim() + const sentence = input.sentence.replace(/\s+/gu, ' ').trim() if (previous) sections.push('[앞 문맥]', previous.slice(-200), '') - sections.push('[검사할 문장]', input.sentence.replace(/\s+/gu, ' ').trim()) + sections.push('[검사할 문장]', sentence) + const layoutHints = buildModelTypoHints(sentence) + if (layoutHints.length > 0) { + sections.push('', '[한영 자판 변환 참고]', ...layoutHints) + } return { systemPrompt: `${SUGGESTION_NO_THINK_PREFIX}\n${TYPO_CHECK_SYSTEM_PROMPT}`, text: sections.join('\n') diff --git a/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx b/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx index 9aa29c4..a7c4dc1 100644 --- a/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx +++ b/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx @@ -567,7 +567,7 @@ export function InputConsentPanel(): React.ReactElement { {suggestion?.visible ? t('input.suggestion.onScreen') : t('input.suggestion.offScreen')} diff --git a/apps/desktop/src/renderer/components/keybinding/KeyBindingPicker.tsx b/apps/desktop/src/renderer/components/keybinding/KeyBindingPicker.tsx index 7e098e5..ca9c699 100644 --- a/apps/desktop/src/renderer/components/keybinding/KeyBindingPicker.tsx +++ b/apps/desktop/src/renderer/components/keybinding/KeyBindingPicker.tsx @@ -459,7 +459,7 @@ export function KeyBindingPicker({ fontFamily: d3roFontMono, fontSize: d3roTypo.small.size, fontWeight: 500, - letterSpacing: '0.04em', + letterSpacing: 0, color: active ? d3roPalette.text.primary : d3roPalette.text.secondary, bgcolor: active ? d3roPalette.accent.dim : 'transparent', border: `1px solid ${ diff --git a/apps/desktop/src/renderer/components/meeting/EditableSegment.tsx b/apps/desktop/src/renderer/components/meeting/EditableSegment.tsx index bcdbe13..d5fe595 100644 --- a/apps/desktop/src/renderer/components/meeting/EditableSegment.tsx +++ b/apps/desktop/src/renderer/components/meeting/EditableSegment.tsx @@ -195,7 +195,7 @@ export function EditableSegment({ label={speaker} size="small" sx={{ - fontSize: 10, + fontSize: 11, height: 18, flexShrink: 0, bgcolor: `${speakerColor}22`, diff --git a/apps/desktop/src/renderer/popups/_shared/popup-base.css b/apps/desktop/src/renderer/popups/_shared/popup-base.css index ea1b4cf..627d3ce 100644 --- a/apps/desktop/src/renderer/popups/_shared/popup-base.css +++ b/apps/desktop/src/renderer/popups/_shared/popup-base.css @@ -26,6 +26,9 @@ --d3-accent-main: #3b82f6; --d3-accent-light: #60a5fa; --d3-accent-dim: rgba(59, 130, 246, 0.14); + --d3-accent-solid: #2563eb; + --d3-accent-solidHover: #1d4ed8; + --d3-accent-ink: #ffffff; --d3-status-danger: #f87171; --d3-status-success: #34d399; --d3-overlay-soft: rgba(238, 242, 251, 0.06); diff --git a/apps/desktop/src/renderer/popups/result-popup/index.html b/apps/desktop/src/renderer/popups/result-popup/index.html index 4b8dff0..bf4ecf1 100644 --- a/apps/desktop/src/renderer/popups/result-popup/index.html +++ b/apps/desktop/src/renderer/popups/result-popup/index.html @@ -12,7 +12,7 @@
-