재구성 AX Agent 설정과 채팅 UI를 Claude형 구조로
Some checks failed
Release Gate / gate (push) Has been cancelled

This commit is contained in:
2026-04-04 17:48:51 +09:00
parent 90c2f15e96
commit a027ea4f9a
6000 changed files with 11532 additions and 94063 deletions

View File

@@ -15,6 +15,7 @@ public partial class SettingsWindow : Window
private readonly Action<string> _previewCallback;
private readonly Action _revertCallback;
private bool _saved;
private bool _isDisplayModeSyncing;
/// <summary>
/// 핫키 녹화 시작/종료를 외부(App.xaml.cs)에 알리는 콜백.
@@ -81,9 +82,153 @@ public partial class SettingsWindow : Window
// AI 기능 토글 초기화
ApplyAiEnabledState(app?.SettingsService?.Settings.AiEnabled ?? false, init: true);
ApplyOperationModeState(app?.SettingsService?.Settings.OperationMode);
InitializeDisplayModeUi();
};
}
private void InitializeDisplayModeUi()
{
var app = System.Windows.Application.Current as App;
if (app?.SettingsService?.Settings?.Llm != null)
app.SettingsService.Settings.Llm.AgentUiExpressionLevel = "rich";
SetDisplayMode("rich", persist: false);
}
private void DisplayMode_Checked(object sender, RoutedEventArgs e)
{
if (_isDisplayModeSyncing) return;
var rb = sender as RadioButton;
var next = rb?.Name switch
{
"DisplayModeRich" => "rich",
"DisplayModeSimple" => "simple",
_ => "balanced",
};
SetDisplayMode(next, persist: true);
}
private void SetDisplayMode(string mode, bool persist)
{
mode = NormalizeDisplayMode(mode);
_isDisplayModeSyncing = true;
try
{
var rich = GetDisplayModeRadio("DisplayModeRich");
var balanced = GetDisplayModeRadio("DisplayModeBalanced");
var simple = GetDisplayModeRadio("DisplayModeSimple");
if (rich != null) rich.IsChecked = mode == "rich";
if (balanced != null) balanced.IsChecked = mode == "balanced";
if (simple != null) simple.IsChecked = mode == "simple";
}
finally
{
_isDisplayModeSyncing = false;
}
ApplyMainTabVisibility(mode);
ApplyAgentSubTabVisibility(mode);
if (!persist) return;
var app = System.Windows.Application.Current as App;
if (app?.SettingsService?.Settings?.Llm == null) return;
app.SettingsService.Settings.Llm.AgentUiExpressionLevel = mode;
app.SettingsService.Save();
}
private void ApplyMainTabVisibility(string mode)
{
if (MainSettingsTab == null) return;
var simpleKeep = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"일반", "테마", "기능", "AX Agent"
};
var balancedKeep = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"일반", "테마", "클립보드", "캡처", "시스템", "기능", "AX Agent"
};
foreach (var item in MainSettingsTab.Items.OfType<TabItem>())
{
var header = item.Header?.ToString() ?? "";
var visible = mode switch
{
"simple" => simpleKeep.Contains(header),
"balanced" => balancedKeep.Contains(header),
_ => true,
};
if (string.Equals(header, "알림", StringComparison.OrdinalIgnoreCase))
visible = false;
if (string.Equals(header, "AX Agent", StringComparison.OrdinalIgnoreCase)
&& !((System.Windows.Application.Current as App)?.SettingsService?.Settings.AiEnabled ?? false))
{
visible = false;
}
item.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;
}
if (MainSettingsTab.SelectedItem is TabItem selected && selected.Visibility == Visibility.Visible)
return;
var firstVisible = MainSettingsTab.Items.OfType<TabItem>().FirstOrDefault(t => t.Visibility == Visibility.Visible);
if (firstVisible != null)
MainSettingsTab.SelectedItem = firstVisible;
}
private void ApplyAgentSubTabVisibility(string mode)
{
if (AgentTabCommon == null) return;
SetSubTabVisible(AgentTabCommon, true);
SetSubTabVisible(AgentTabChat, mode != "simple");
SetSubTabVisible(AgentTabCoworkCode, true);
SetSubTabVisible(AgentTabCowork, mode == "rich");
SetSubTabVisible(AgentTabCode, mode == "rich");
SetSubTabVisible(AgentTabTools, mode != "simple");
SetSubTabVisible(AgentTabEtc, mode != "simple");
SetSubTabVisible(AgentTabDev, mode == "rich");
if (AgentTabCommon.IsChecked != true
&& AgentTabChat.IsChecked != true
&& AgentTabCoworkCode.IsChecked != true
&& AgentTabCowork.IsChecked != true
&& AgentTabCode.IsChecked != true
&& AgentTabTools.IsChecked != true
&& AgentTabEtc.IsChecked != true
&& AgentTabDev.IsChecked != true)
{
AgentTabCommon.IsChecked = true;
}
AgentSubTab_Checked(this, new RoutedEventArgs());
}
private static void SetSubTabVisible(RadioButton? tab, bool visible)
{
if (tab == null) return;
tab.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;
if (!visible) tab.IsChecked = false;
}
private static string NormalizeDisplayMode(string? mode)
{
return (mode ?? "balanced").Trim().ToLowerInvariant() switch
{
"rich" => "rich",
"simple" => "simple",
_ => "balanced",
};
}
private RadioButton? GetDisplayModeRadio(string name)
{
if (MainSettingsTab?.Template == null) return null;
return MainSettingsTab.Template.FindName(name, MainSettingsTab) as RadioButton;
}
// ─── 에이전트 차단 섹션 → 기타 탭 이동 ──────────────────────────────────────
private void MoveBlockSectionToEtc()
@@ -1558,6 +1703,7 @@ public partial class SettingsWindow : Window
Service = currentService,
Endpoint = dlg.Endpoint,
ApiKey = dlg.ApiKey,
AllowInsecureTls = dlg.AllowInsecureTls,
AuthType = dlg.AuthType,
Cp4dUrl = dlg.Cp4dUrl,
Cp4dUsername = dlg.Cp4dUsername,
@@ -1576,7 +1722,7 @@ public partial class SettingsWindow : Window
var currentService = GetCurrentServiceSubTab();
var dlg = new ModelRegistrationDialog(currentService, row.Alias, currentModel,
row.Endpoint, row.ApiKey,
row.Endpoint, row.ApiKey, row.AllowInsecureTls,
row.AuthType ?? "bearer", row.Cp4dUrl ?? "", row.Cp4dUsername ?? "", cp4dPw);
dlg.Owner = this;
if (dlg.ShowDialog() == true)
@@ -1586,6 +1732,7 @@ public partial class SettingsWindow : Window
row.Service = currentService;
row.Endpoint = dlg.Endpoint;
row.ApiKey = dlg.ApiKey;
row.AllowInsecureTls = dlg.AllowInsecureTls;
row.AuthType = dlg.AuthType;
row.Cp4dUrl = dlg.Cp4dUrl;
row.Cp4dUsername = dlg.Cp4dUsername;
@@ -2051,9 +2198,9 @@ public partial class SettingsWindow : Window
{
AiEnabledToggle.IsChecked = enabled;
}
// AX Agent 탭 가시성
// AX Agent 상세 설정은 전용 창으로 분리 (탭은 숨김)
if (AgentTabItem != null)
AgentTabItem.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed;
AgentTabItem.Visibility = Visibility.Collapsed;
}
private void ApplyOperationModeState(string? mode)