diff --git a/src/AxCopilot.SDK/IActionHandler.cs b/src/AxCopilot.SDK/IActionHandler.cs index 6a040cb..48400f0 100644 --- a/src/AxCopilot.SDK/IActionHandler.cs +++ b/src/AxCopilot.SDK/IActionHandler.cs @@ -40,7 +40,8 @@ public record LauncherItem( string? IconPath, // null이면 기본 아이콘 사용 object? Data, // ExecuteAsync에 전달되는 임의 데이터 string? ActionUrl = null, // Enter 시 열릴 URL (선택) - string? Symbol = null // Segoe MDL2 Assets 유니코드 심볼 (null이면 타입 기반 자동 결정) + string? Symbol = null, // Segoe MDL2 Assets 유니코드 심볼 (null이면 타입 기반 자동 결정) + string? Group = null // 검색 결과 그룹 레이블 (null이면 그룹 없음) ); /// diff --git a/src/AxCopilot/Core/CommandResolver.cs b/src/AxCopilot/Core/CommandResolver.cs index b5247a5..5fb0815 100644 --- a/src/AxCopilot/Core/CommandResolver.cs +++ b/src/AxCopilot/Core/CommandResolver.cs @@ -104,6 +104,13 @@ public class CommandResolver _ => Symbols.Plugin }, _ => Symbols.File + }, + Group: r.Entry.Type switch + { + IndexEntryType.App => "앱", + IndexEntryType.Folder => "폴더", + IndexEntryType.Alias => "단축키", + _ => "파일" } )), item => (item.Data as IndexEntry)?.Path diff --git a/src/AxCopilot/ViewModels/LauncherViewModel.cs b/src/AxCopilot/ViewModels/LauncherViewModel.cs index 82054f4..553f3f8 100644 --- a/src/AxCopilot/ViewModels/LauncherViewModel.cs +++ b/src/AxCopilot/ViewModels/LauncherViewModel.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Windows; +using System.Windows.Data; using System.Windows.Media; using AxCopilot.Core; using AxCopilot.Models; @@ -41,6 +42,12 @@ public partial class LauncherViewModel : INotifyPropertyChanged /// public BulkObservableCollection Results { get; } = new(); + /// + /// 그룹핑이 적용된 결과 뷰. prefix 없는 일반 검색에서 앱/폴더/파일/단축키 섹션 구분 표시. + /// Group == null 항목은 별도 그룹 헤더 없이 표시됩니다. + /// + public ICollectionView GroupedResults { get; } + // ─── 기본 프로퍼티 ──────────────────────────────────────────────────────── public string InputText @@ -243,6 +250,11 @@ public partial class LauncherViewModel : INotifyPropertyChanged { _resolver = resolver; _settings = settings; + + // 그룹핑 뷰 초기화 (UI 스레드에서 생성 보장) + GroupedResults = CollectionViewSource.GetDefaultView(Results); + GroupedResults.GroupDescriptions.Add( + new PropertyGroupDescription(nameof(LauncherItem.Group))); } // ─── 런처 표시 시 초기화 ────────────────────────────────────────────────── diff --git a/src/AxCopilot/Views/LauncherWindow.xaml b/src/AxCopilot/Views/LauncherWindow.xaml index 40af89b..70e31c1 100644 --- a/src/AxCopilot/Views/LauncherWindow.xaml +++ b/src/AxCopilot/Views/LauncherWindow.xaml @@ -18,6 +18,7 @@ WindowStartupLocation="Manual" Loaded="Window_Loaded" Deactivated="Window_Deactivated" + IsVisibleChanged="Window_IsVisibleChanged" PreviewKeyDown="Window_PreviewKeyDown" KeyDown="Window_KeyDown"> @@ -488,7 +489,7 @@ + + + + + + + + + + + + + + + +