diff --git a/README.md b/README.md index ac6d3ee..a0d255a 100644 --- a/README.md +++ b/README.md @@ -1308,3 +1308,6 @@ MIT License - 업데이트: 2026-04-06 17:43 (KST) - 추가로 앱 시작 시 [LauncherWindow](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/LauncherWindow.xaml.cs) 를 미리 생성하지 않고, 실제로 런처를 처음 열 때만 `EnsureLauncherCreated()`로 만들도록 바꿨다. 이로써 보이지 않는 상태의 런처 UI, 바인딩, 보조 타이머 준비 비용을 평소에는 지연시켰다. - [App.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/App.xaml.cs) 에서 트레이 메뉴의 `PrepareForDisplay()` 사전 렌더 호출도 제거해, 사용하지도 않는 트레이 팝업 레이아웃 계산을 앱 시작 직후 강제로 하지 않도록 정리했다. +- 업데이트: 2026-04-06 17:52 (KST) + - 런처 표시 체감 속도를 유지하기 위해 [LauncherWindow](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/LauncherWindow.xaml.cs) 사전 생성은 다시 복원했다. 대신 무거운 후보를 색인으로 더 좁히기 위해, [App.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/App.xaml.cs)의 인덱스 워밍업 진입점을 런처 표시 시점이 아니라 실제 검색 시점으로 옮겼다. + - [LauncherViewModel.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/ViewModels/LauncherViewModel.cs) 의 `SearchAsync(...)` 시작 시에만 `EnsureIndexWarmupStarted()`를 호출하도록 바꿔, 사용자가 런처를 단순 호출만 할 때는 전체 인덱스 스캔과 파일 감시가 돌지 않게 정리했다. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index b893fa5..a702a00 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -4992,3 +4992,5 @@ ow + toggle ?쒓컖 ?몄뼱濡??ㅼ떆 ?뺣젹?덈떎. - Document update: 2026-04-06 17:35 (KST) - Changed launcher search warmup from eager startup work to on-demand initialization. `App.xaml.cs` now starts the first `IndexService.BuildAsync()` scan and `StartWatchers()` only when the launcher is actually shown through `ShowLauncherWindow()`, instead of running a full index scan and watcher hookup at boot even when the launcher is never opened. - Document update: 2026-04-06 17:43 (KST) - Deferred `LauncherWindow` construction itself. `App.xaml.cs` now keeps only `LauncherViewModel` alive at startup and creates the actual `LauncherWindow` through `EnsureLauncherCreated()` the first time the launcher is shown, rather than instantiating the full hidden window at boot. - Document update: 2026-04-06 17:43 (KST) - Removed the eager tray-menu warmup path (`PrepareForDisplay()`) from startup. This avoids doing popup layout/measure work for the tray menu until the user actually opens it, reducing idle desktop overhead further. +- Document update: 2026-04-06 17:52 (KST) - Restored eager `LauncherWindow` construction so launcher open latency stays low, but kept the tray-menu warmup removed. This keeps the launcher responsive while continuing to trim startup work elsewhere. +- Document update: 2026-04-06 17:52 (KST) - Moved index warmup from launcher-show time to actual search time. `LauncherViewModel.SearchAsync(...)` now triggers `App.EnsureIndexWarmupStarted()` only when the user performs a real search, so opening the launcher by itself no longer starts a full file scan and watcher bootstrap. diff --git a/src/AxCopilot/App.xaml.cs b/src/AxCopilot/App.xaml.cs index 54b7017..97a658a 100644 --- a/src/AxCopilot/App.xaml.cs +++ b/src/AxCopilot/App.xaml.cs @@ -14,7 +14,6 @@ public partial class App : System.Windows.Application private System.Threading.Mutex? _singleInstanceMutex; private InputListener? _inputListener; private LauncherWindow? _launcher; - private LauncherViewModel? _launcherViewModel; private NotifyIcon? _trayIcon; private Views.TrayMenuWindow? _trayMenu; private SettingsService? _settings; @@ -278,7 +277,11 @@ public partial class App : System.Windows.Application _pluginHost = pluginHost; // ─── 런처 윈도우 ────────────────────────────────────────────────────── - _launcherViewModel = new LauncherViewModel(commandResolver, settings); + var vm = new LauncherViewModel(commandResolver, settings); + _launcher = new LauncherWindow(vm) + { + OpenSettingsAction = OpenSettings + }; // ─── 클립보드 히스토리 초기화 (메시지 펌프 시작 직후 — 런처 표시 불필요) ── Dispatcher.BeginInvoke( @@ -667,7 +670,7 @@ public partial class App : System.Windows.Application /// AX Agent 창 열기 (트레이 메뉴 등에서 호출). private Views.ChatWindow? _chatWindow; - private void EnsureIndexWarmupStarted() + public void EnsureIndexWarmupStarted() { if (_indexService == null) return; if (Interlocked.Exchange(ref _indexWarmupStarted, 1) == 1) return; @@ -688,22 +691,10 @@ public partial class App : System.Windows.Application private void ShowLauncherWindow() { - EnsureLauncherCreated(); if (_launcher == null) return; - EnsureIndexWarmupStarted(); _launcher.Show(); } - private void EnsureLauncherCreated() - { - if (_launcher != null || _launcherViewModel == null) return; - - _launcher = new LauncherWindow(_launcherViewModel) - { - OpenSettingsAction = OpenSettings - }; - } - private void OpenAiChat() { if (_settings == null) return; diff --git a/src/AxCopilot/ViewModels/LauncherViewModel.cs b/src/AxCopilot/ViewModels/LauncherViewModel.cs index 8ae64c1..e1a6604 100644 --- a/src/AxCopilot/ViewModels/LauncherViewModel.cs +++ b/src/AxCopilot/ViewModels/LauncherViewModel.cs @@ -280,6 +280,8 @@ public partial class LauncherViewModel : INotifyPropertyChanged private async Task SearchAsync(string query) { + (System.Windows.Application.Current as App)?.EnsureIndexWarmupStarted(); + // CTS 취소는 setter에서 이미 처리됨. 새 토큰만 발급. _searchCts = new CancellationTokenSource(); var ct = _searchCts.Token;