Files
AX-Copilot/src/AxCopilot/Views/LauncherWindow.ShortcutHelp.cs
lacvet 55befebf34 [Phase51] 대규모 파일 분리 — 9개 파일 → 19개 파일
SettingsWindow.Tools:
- SettingsWindow.Tools.cs: 605 → 238줄 (BuildToolRegistryPanel 유지)
- SettingsWindow.SkillListPanel.cs (신규): BuildSkillListSection, CreateSkillGroupCard (295줄)

LauncherWindow.Keyboard:
- LauncherWindow.Keyboard.cs: 593 → 454줄
- LauncherWindow.ShortcutHelp.cs (신규): ShowShortcutHelp, ShowToast, TryHandleSpecialAction (139줄)

CalculatorHandler:
- CalculatorHandler.cs: 566 → ~240줄 (CalculatorHandler 클래스만 유지)
- UnitConverter.cs (신규): 단위변환 클래스 독립 파일 (152줄)
- MathEvaluator.cs (신규): 수식파서 클래스 독립 파일 (183줄)

EmojiHandler:
- EmojiHandler.cs: 553 → 70줄 (핸들러 메서드만 유지)
- EmojiHandler.Data.cs (신규): 이모지 데이터베이스 배열 (~490줄)

DocumentPlannerTool:
- DocumentPlannerTool.cs: 598 → 324줄 (Execute 메서드 유지)
- DocumentPlannerTool.Generators.cs (신규): GenerateHtml/Docx/Markdown, BuildSections 등 (274줄)

DocumentReaderTool:
- DocumentReaderTool.cs: 571 → 338줄 (ExecuteAsync + PDF 메서드 유지)
- DocumentReaderTool.Formats.cs (신규): BibTeX/RIS/DOCX/XLSX/Text/Helpers (233줄)

CodeIndexService:
- CodeIndexService.cs: 588 → 285줄 (DB/인덱싱 유지)
- CodeIndexService.Search.cs (신규): Search, TF-IDF, Tokenize, Dispose (199줄)

ClipboardHistoryService:
- ClipboardHistoryService.cs: 575 → 458줄
- ClipboardHistoryService.ImageCache.cs (신규): 이미지 캐시 유틸리티 (120줄)

IndexService:
- IndexService.cs: 568 → 412줄
- IndexService.Helpers.cs (신규): 경로 탐색 헬퍼 + 검색 캐시 (163줄)

빌드: 경고 0, 오류 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 21:34:51 +09:00

149 lines
5.5 KiB
C#

using System.Windows;
using System.Windows.Input;
using AxCopilot.Services;
using AxCopilot.ViewModels;
namespace AxCopilot.Views;
public partial class LauncherWindow
{
// ─── 단축키 도움말 + 토스트 + 특수 액션 ────────────────────────────────────
/// <summary>단축키 도움말 팝업</summary>
private void ShowShortcutHelp()
{
var lines = new[]
{
"[ 전역 ]",
"Alt+Space AX Commander 열기/닫기",
"",
"[ 탐색 ]",
"↑ / ↓ 결과 이동",
"Enter 선택 실행",
"Tab 자동완성",
"→ 액션 모드",
"Escape 닫기 / 뒤로",
"",
"[ 기능 ]",
"F1 도움말",
"F2 파일 이름 바꾸기",
"F5 인덱스 새로 고침",
"Delete 항목 제거",
"Ctrl+, 설정",
"Ctrl+L 입력 초기화",
"Ctrl+C 이름 복사",
"Ctrl+H 클립보드 히스토리",
"Ctrl+R 최근 실행",
"Ctrl+B 즐겨찾기",
"Ctrl+K 이 도움말",
"Ctrl+1~9 N번째 실행",
"Ctrl+Shift+C 경로 복사",
"Ctrl+Shift+E 탐색기에서 열기",
"Ctrl+Enter 관리자 실행",
"Alt+Enter 속성 보기",
"Shift+Enter 대형 텍스트",
};
CustomMessageBox.Show(
string.Join("\n", lines),
"AX Commander — 단축키 도움말",
MessageBoxButton.OK,
MessageBoxImage.Information);
}
// ─── 토스트 알림 ──────────────────────────────────────────────────────────
/// <summary>오버레이 토스트 표시 (페이드인 → 2초 대기 → 페이드아웃)</summary>
private void ShowToast(string message, string icon = "\uE73E")
{
ToastText.Text = message;
ToastIcon.Text = icon;
ToastOverlay.Visibility = Visibility.Visible;
ToastOverlay.Opacity = 0;
// 페이드인
var fadeIn = (System.Windows.Media.Animation.Storyboard)FindResource("ToastFadeIn");
fadeIn.Begin(this);
_indexStatusTimer?.Stop();
_indexStatusTimer = new System.Windows.Threading.DispatcherTimer
{
Interval = TimeSpan.FromSeconds(2)
};
_indexStatusTimer.Tick += (_, _) =>
{
_indexStatusTimer.Stop();
// 페이드아웃 후 Collapsed
var fadeOut = (System.Windows.Media.Animation.Storyboard)FindResource("ToastFadeOut");
EventHandler? onCompleted = null;
onCompleted = (__, ___) =>
{
fadeOut.Completed -= onCompleted;
ToastOverlay.Visibility = Visibility.Collapsed;
};
fadeOut.Completed += onCompleted;
fadeOut.Begin(this);
};
_indexStatusTimer.Start();
}
// ─── 특수 액션 처리 ───────────────────────────────────────────────────────
/// <summary>
/// 액션 모드에서 특수 처리가 필요한 동작(삭제/이름변경)을 처리합니다.
/// 처리되면 true 반환 → ExecuteSelectedAsync 호출 생략.
/// </summary>
private bool TryHandleSpecialAction()
{
if (_vm.SelectedItem?.Data is not AxCopilot.ViewModels.FileActionData actionData)
return false;
switch (actionData.Action)
{
case AxCopilot.ViewModels.FileAction.DeleteToRecycleBin:
{
var path = actionData.Path;
var name = System.IO.Path.GetFileName(path);
var r = CustomMessageBox.Show(
$"'{name}'\n\n이 항목을 휴지통으로 보내겠습니까?",
"AX Copilot — 삭제 확인",
MessageBoxButton.OKCancel,
MessageBoxImage.Warning);
if (r == MessageBoxResult.OK)
{
try
{
SendToRecycleBin(path);
_vm.ExitActionMode();
ShowToast("휴지통으로 이동됨", "\uE74D");
}
catch (Exception ex)
{
CustomMessageBox.Show($"삭제 실패: {ex.Message}", "오류",
MessageBoxButton.OK, MessageBoxImage.Error);
}
}
else
{
_vm.ExitActionMode();
}
return true;
}
case AxCopilot.ViewModels.FileAction.Rename:
{
var path = actionData.Path;
_vm.ExitActionMode();
_vm.InputText = $"rename {path}";
Dispatcher.BeginInvoke(() => { InputBox.CaretIndex = InputBox.Text.Length; },
System.Windows.Threading.DispatcherPriority.Input);
return true;
}
default:
return false;
}
}
}