From effadf71851ba81c2c9b2945d29ec8755f242ccf Mon Sep 17 00:00:00 2001 From: lacvet Date: Sat, 4 Apr 2026 16:32:42 +0900 Subject: [PATCH] =?UTF-8?q?AX=20Agent=20=EC=84=A4=EC=A0=95=EC=B0=BD=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=20=EC=95=88=EC=A0=95=ED=99=94:=20ToggleSwitc?= =?UTF-8?q?h=20=EC=A0=84=EC=97=AD=20=EB=A6=AC=EC=86=8C=EC=8A=A4=ED=99=94?= =?UTF-8?q?=20=EB=B0=8F=20=ED=85=8C=EB=A7=88=20=EC=A3=BC=EC=9E=85=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - App.xaml: ToggleSwitch 스타일을 전역 리소스로 추가해 ChatWindow 초기화 시 StaticResource 누락 예외를 방지\n- ChatWindow.xaml.cs: Agent 설정창 오픈 시 창 전체 Resources 병합을 제거하고 AX Agent 테마 사전만 안전 주입하도록 변경\n- ChatWindow.xaml.cs: ApplyAgentThemeResources와 설정창 주입 경로에서 공통 URI 생성 로직(BuildAgentThemeDictionaryUri)으로 중복 제거\n- README.md / docs/DEVELOPMENT.md: 2026-04-04 17:12(KST) 기준 변경 이력 및 검증 결과 동기화\n- 검증: dotnet build(경고0/오류0), dotnet test 필터 59 passed --- README.md | 1 + docs/DEVELOPMENT.md | 21 +++++++++++++++ src/AxCopilot/App.xaml | 36 ++++++++++++++++++++++++++ src/AxCopilot/Views/ChatWindow.xaml.cs | 29 ++++++++++++++------- 4 files changed, 77 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index dd4a2b9..d74ea98 100644 --- a/README.md +++ b/README.md @@ -294,6 +294,7 @@ public class MyHandler : IActionHandler | 권한 색상 체계 통일 | 권한 요약 카드/상단 배너에서 모드별 색상(Deny=녹색, Passive=파랑, Active=녹색, Plan=보라, FullAuto=주황, Silent=빨강)을 팝업 체계와 일치시킴 | | 슬래시 네비게이션 입력 보강 | InputBox 포커스 상태에서도 방향키/Page/Home/End/Tab이 슬래시 목록 탐색에 즉시 반영되도록 키 처리 경로를 통합하고, 모든 그룹 접힘 상태에서 휠 스크롤 fallback을 추가 | | 사내/사외 모드 회귀 보강 | operationMode 전환 직후 WebSearch 동작 반영과 URL 판별 경계(HTTP/파일/mailto) 테스트를 추가해 내부 차단 정책의 즉시성/정확성을 강화 | +| AX Agent 설정창 오픈 안정화 | `ToggleSwitch`를 전역 리소스로 승격해 AX Agent 창 초기화 시 리소스 누락 예외를 방지하고, AX Agent 설정창에는 테마 사전만 안전 주입하도록 오픈 경로를 보강 | | Slash palette 상태 분리 시작 | `ChatWindow`에 몰려 있던 slash 상태를 `SlashPaletteState`로 분리해 이후 Codex/Claude형 composer 개편 기반 마련 | | 런처 이미지 미리보기 추가 | `#` 클립보드 이미지 항목에서 `Shift+Enter`로 전용 미리보기 창을 열고, 줌·원본 해상도 확인·PNG/JPEG/BMP 저장·클립보드 복사를 지원 | | 검증 | `dotnet build` 경고 0 / 오류 0, `dotnet test` 436 passed / 0 failed | diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 975d769..a2cabd8 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -3691,3 +3691,24 @@ else: ### 3) 품질 게이트 - `dotnet build src/AxCopilot/AxCopilot.csproj -c Debug -p:UseSharedCompilation=false -nodeReuse:false` 통과 (경고 0, 오류 0). - `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -p:UseSharedCompilation=false -nodeReuse:false --filter "FullyQualifiedName~OperationModePolicyTests|FullyQualifiedName~OperationModeReadinessTests"` 통과 (20 passed, 0 failed). + +## 2026-04-04 추가 진행 기록 (연속 실행 44차: AX Agent 설정창 오픈 안정화) + +업데이트: 2026-04-04 17:12 (KST) + +### 1) 전역 토글 리소스 보강 +- `App.xaml`에 `ToggleSwitch` 스타일을 전역 리소스로 추가. +- 효과: + - 창별 리소스 병합 순서와 무관하게 `ToggleSwitch` 키를 항상 해석 가능. + - AX Agent 창(`ChatWindow`) 초기화 중 `StaticResource ToggleSwitch` 누락 예외 재발 방지. + +### 2) AX Agent 설정창 리소스 주입 경로 개선 +- `ChatWindow.OpenAgentSettingsWindow()`에서 창 전체 리소스 사전을 직접 병합하던 경로를 제거. +- 대신 AX Agent 전용 테마 사전(`Themes/AgentLight|AgentDark.xaml`)만 안전하게 주입하도록 변경. +- 효과: + - 설정창 오픈 시 리소스 충돌 위험 감소. + - 테마 일관성 유지 + 설정창 오픈 실패 가능성 완화. + +### 3) 품질 게이트 +- `dotnet build src/AxCopilot/AxCopilot.csproj -c Debug -p:UseSharedCompilation=false -nodeReuse:false` 통과 (경고 0, 오류 0). +- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Debug --filter "ChatWindowSlashPolicyTests|OperationModePolicyTests|OperationModeReadinessTests"` 통과 (59 passed, 0 failed). diff --git a/src/AxCopilot/App.xaml b/src/AxCopilot/App.xaml index 58700f2..b546109 100644 --- a/src/AxCopilot/App.xaml +++ b/src/AxCopilot/App.xaml @@ -19,6 +19,42 @@ + + + diff --git a/src/AxCopilot/Views/ChatWindow.xaml.cs b/src/AxCopilot/Views/ChatWindow.xaml.cs index 4c6006d..fcde31d 100644 --- a/src/AxCopilot/Views/ChatWindow.xaml.cs +++ b/src/AxCopilot/Views/ChatWindow.xaml.cs @@ -803,13 +803,7 @@ public partial class ChatWindow : Window private void ApplyAgentThemeResources() { - var selected = (_settings.Settings.Llm.AgentTheme ?? "system").Trim().ToLowerInvariant(); - var effective = selected switch - { - "light" => "AgentLight", - "dark" => "AgentDark", - _ => IsSystemDarkTheme() ? "AgentDark" : "AgentLight", - }; + var themeUri = BuildAgentThemeDictionaryUri(); try { @@ -818,7 +812,7 @@ public partial class ChatWindow : Window _agentThemeDictionary = new ResourceDictionary { - Source = new Uri($"pack://application:,,,/Themes/{effective}.xaml"), + Source = themeUri, }; Resources.MergedDictionaries.Insert(0, _agentThemeDictionary); } @@ -828,6 +822,18 @@ public partial class ChatWindow : Window } } + private Uri BuildAgentThemeDictionaryUri() + { + var selected = (_settings.Settings.Llm.AgentTheme ?? "system").Trim().ToLowerInvariant(); + var effective = selected switch + { + "light" => "AgentLight", + "dark" => "AgentDark", + _ => IsSystemDarkTheme() ? "AgentDark" : "AgentLight", + }; + return new Uri($"pack://application:,,,/Themes/{effective}.xaml"); + } + private static bool IsSystemDarkTheme() { try @@ -12974,11 +12980,14 @@ public partial class ChatWindow : Window win.Closed += (_, _) => _agentSettingsWindow = null; try { - win.Resources.MergedDictionaries.Add(Resources); + win.Resources.MergedDictionaries.Insert(0, new ResourceDictionary + { + Source = BuildAgentThemeDictionaryUri(), + }); } catch { - // 리소스 병합 실패 시에도 설정창 자체는 열리도록 유지 + // 테마 사전 로드 실패 시에도 설정창 자체는 열리도록 유지 } bool changed;