AX Agent 대화 목록 필터 프레젠테이션 분리 및 사이드바 구조 정리
Some checks failed
Release Gate / gate (push) Has been cancelled
Some checks failed
Release Gate / gate (push) Has been cancelled
- ChatWindow에서 대화 목록 필터/정렬 interaction과 선호 저장 로직을 ConversationFilterPresentation partial로 분리 - 실행 중 보기, 최근/활동 정렬, 관련 버튼 UI 갱신을 메인 창 orchestration 코드 밖으로 이동 - README와 DEVELOPMENT 문서에 2026-04-06 11:11 (KST) 기준 구조 개선 누적 완료 범위 반영 - dotnet build 검증 경고 0, 오류 0 확인
This commit is contained in:
116
src/AxCopilot/Views/ChatWindow.ConversationFilterPresentation.cs
Normal file
116
src/AxCopilot/Views/ChatWindow.ConversationFilterPresentation.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using AxCopilot.Models;
|
||||
|
||||
namespace AxCopilot.Views;
|
||||
|
||||
public partial class ChatWindow
|
||||
{
|
||||
private void BtnFailedOnlyFilter_Click(object sender, RoutedEventArgs e) { }
|
||||
|
||||
private void BtnRunningOnlyFilter_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_runningOnlyFilter = false;
|
||||
UpdateConversationRunningFilterUi();
|
||||
PersistConversationListPreferences();
|
||||
RefreshConversationList();
|
||||
}
|
||||
|
||||
private void BtnQuickRunningFilter_Click(object sender, RoutedEventArgs e)
|
||||
=> BtnRunningOnlyFilter_Click(sender, e);
|
||||
|
||||
private void BtnQuickHotSort_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_sortConversationsByRecent = false;
|
||||
UpdateConversationSortUi();
|
||||
PersistConversationListPreferences();
|
||||
RefreshConversationList();
|
||||
}
|
||||
|
||||
private void BtnConversationSort_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_sortConversationsByRecent = !_sortConversationsByRecent;
|
||||
UpdateConversationSortUi();
|
||||
PersistConversationListPreferences();
|
||||
RefreshConversationList();
|
||||
}
|
||||
|
||||
private void UpdateConversationFailureFilterUi()
|
||||
{
|
||||
_failedOnlyFilter = false;
|
||||
UpdateSidebarModeMenu();
|
||||
}
|
||||
|
||||
private void UpdateConversationRunningFilterUi()
|
||||
{
|
||||
if (BtnRunningOnlyFilter == null || RunningOnlyFilterLabel == null)
|
||||
return;
|
||||
|
||||
BtnRunningOnlyFilter.Background = _runningOnlyFilter
|
||||
? BrushFromHex("#DBEAFE")
|
||||
: Brushes.Transparent;
|
||||
BtnRunningOnlyFilter.BorderBrush = _runningOnlyFilter
|
||||
? BrushFromHex("#93C5FD")
|
||||
: Brushes.Transparent;
|
||||
BtnRunningOnlyFilter.BorderThickness = _runningOnlyFilter
|
||||
? new Thickness(1)
|
||||
: new Thickness(0);
|
||||
RunningOnlyFilterLabel.Foreground = _runningOnlyFilter
|
||||
? BrushFromHex("#1D4ED8")
|
||||
: (TryFindResource("SecondaryText") as Brush ?? Brushes.Gray);
|
||||
RunningOnlyFilterLabel.Text = _runningConversationCount > 0
|
||||
? $"진행 {_runningConversationCount}"
|
||||
: "진행";
|
||||
BtnRunningOnlyFilter.ToolTip = _runningOnlyFilter
|
||||
? "실행 중인 대화만 표시 중"
|
||||
: _runningConversationCount > 0
|
||||
? $"현재 실행 중인 대화 {_runningConversationCount}개 보기"
|
||||
: "현재 실행 중인 대화만 보기";
|
||||
UpdateSidebarModeMenu();
|
||||
}
|
||||
|
||||
private void UpdateConversationSortUi()
|
||||
{
|
||||
if (BtnConversationSort == null || ConversationSortLabel == null)
|
||||
return;
|
||||
|
||||
ConversationSortLabel.Text = _sortConversationsByRecent ? "최근" : "활동";
|
||||
BtnConversationSort.Background = _sortConversationsByRecent
|
||||
? BrushFromHex("#EFF6FF")
|
||||
: BrushFromHex("#F8FAFC");
|
||||
BtnConversationSort.BorderBrush = _sortConversationsByRecent
|
||||
? BrushFromHex("#93C5FD")
|
||||
: BrushFromHex("#E2E8F0");
|
||||
BtnConversationSort.BorderThickness = new Thickness(1);
|
||||
ConversationSortLabel.Foreground = _sortConversationsByRecent
|
||||
? BrushFromHex("#1D4ED8")
|
||||
: (TryFindResource("SecondaryText") as Brush ?? Brushes.Gray);
|
||||
BtnConversationSort.ToolTip = _sortConversationsByRecent
|
||||
? "최신 업데이트 순으로 보는 중"
|
||||
: "에이전트 활동량과 실패를 우선으로 보는 중";
|
||||
}
|
||||
|
||||
private void ApplyConversationListPreferences(ChatConversation? conv)
|
||||
{
|
||||
_failedOnlyFilter = false;
|
||||
_runningOnlyFilter = false;
|
||||
_sortConversationsByRecent = string.Equals(conv?.ConversationSortMode, "recent", StringComparison.OrdinalIgnoreCase);
|
||||
UpdateConversationFailureFilterUi();
|
||||
UpdateConversationRunningFilterUi();
|
||||
UpdateConversationSortUi();
|
||||
}
|
||||
|
||||
private void PersistConversationListPreferences()
|
||||
{
|
||||
lock (_convLock)
|
||||
{
|
||||
var session = _appState.ChatSession;
|
||||
if (session == null)
|
||||
return;
|
||||
|
||||
session.SaveConversationListPreferences(_activeTab, _failedOnlyFilter, _runningOnlyFilter, _sortConversationsByRecent, _storage);
|
||||
_currentConversation = session.CurrentConversation;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2093,90 +2093,6 @@ public partial class ChatWindow : Window
|
||||
_conversationSearchTimer.Start();
|
||||
}
|
||||
|
||||
private void BtnFailedOnlyFilter_Click(object sender, RoutedEventArgs e) { }
|
||||
|
||||
private void BtnRunningOnlyFilter_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_runningOnlyFilter = false;
|
||||
UpdateConversationRunningFilterUi();
|
||||
PersistConversationListPreferences();
|
||||
RefreshConversationList();
|
||||
}
|
||||
|
||||
private void BtnQuickRunningFilter_Click(object sender, RoutedEventArgs e)
|
||||
=> BtnRunningOnlyFilter_Click(sender, e);
|
||||
|
||||
private void BtnQuickHotSort_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_sortConversationsByRecent = false;
|
||||
UpdateConversationSortUi();
|
||||
PersistConversationListPreferences();
|
||||
RefreshConversationList();
|
||||
}
|
||||
|
||||
private void BtnConversationSort_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_sortConversationsByRecent = !_sortConversationsByRecent;
|
||||
UpdateConversationSortUi();
|
||||
PersistConversationListPreferences();
|
||||
RefreshConversationList();
|
||||
}
|
||||
|
||||
private void UpdateConversationFailureFilterUi()
|
||||
{
|
||||
_failedOnlyFilter = false;
|
||||
UpdateSidebarModeMenu();
|
||||
}
|
||||
|
||||
private void UpdateConversationRunningFilterUi()
|
||||
{
|
||||
if (BtnRunningOnlyFilter == null || RunningOnlyFilterLabel == null)
|
||||
return;
|
||||
|
||||
BtnRunningOnlyFilter.Background = _runningOnlyFilter
|
||||
? BrushFromHex("#DBEAFE")
|
||||
: Brushes.Transparent;
|
||||
BtnRunningOnlyFilter.BorderBrush = _runningOnlyFilter
|
||||
? BrushFromHex("#93C5FD")
|
||||
: Brushes.Transparent;
|
||||
BtnRunningOnlyFilter.BorderThickness = _runningOnlyFilter
|
||||
? new Thickness(1)
|
||||
: new Thickness(0);
|
||||
RunningOnlyFilterLabel.Foreground = _runningOnlyFilter
|
||||
? BrushFromHex("#1D4ED8")
|
||||
: (TryFindResource("SecondaryText") as Brush ?? Brushes.Gray);
|
||||
RunningOnlyFilterLabel.Text = _runningConversationCount > 0
|
||||
? $"진행 {_runningConversationCount}"
|
||||
: "진행";
|
||||
BtnRunningOnlyFilter.ToolTip = _runningOnlyFilter
|
||||
? "실행 중인 대화만 표시 중"
|
||||
: _runningConversationCount > 0
|
||||
? $"현재 실행 중인 대화 {_runningConversationCount}개 보기"
|
||||
: "현재 실행 중인 대화만 보기";
|
||||
UpdateSidebarModeMenu();
|
||||
}
|
||||
|
||||
private void UpdateConversationSortUi()
|
||||
{
|
||||
if (BtnConversationSort == null || ConversationSortLabel == null)
|
||||
return;
|
||||
|
||||
ConversationSortLabel.Text = _sortConversationsByRecent ? "최근" : "활동";
|
||||
BtnConversationSort.Background = _sortConversationsByRecent
|
||||
? BrushFromHex("#EFF6FF")
|
||||
: BrushFromHex("#F8FAFC");
|
||||
BtnConversationSort.BorderBrush = _sortConversationsByRecent
|
||||
? BrushFromHex("#93C5FD")
|
||||
: BrushFromHex("#E2E8F0");
|
||||
BtnConversationSort.BorderThickness = new Thickness(1);
|
||||
ConversationSortLabel.Foreground = _sortConversationsByRecent
|
||||
? BrushFromHex("#1D4ED8")
|
||||
: (TryFindResource("SecondaryText") as Brush ?? Brushes.Gray);
|
||||
BtnConversationSort.ToolTip = _sortConversationsByRecent
|
||||
? "최신 업데이트 순으로 보는 중"
|
||||
: "에이전트 활동량과 실패를 우선으로 보는 중";
|
||||
}
|
||||
|
||||
private static string FormatDate(DateTime dt)
|
||||
{
|
||||
var diff = DateTime.Now - dt;
|
||||
@@ -6259,29 +6175,6 @@ public partial class ChatWindow : Window
|
||||
UpdateTaskSummaryIndicators();
|
||||
}
|
||||
|
||||
private void ApplyConversationListPreferences(ChatConversation? conv)
|
||||
{
|
||||
_failedOnlyFilter = false;
|
||||
_runningOnlyFilter = false;
|
||||
_sortConversationsByRecent = string.Equals(conv?.ConversationSortMode, "recent", StringComparison.OrdinalIgnoreCase);
|
||||
UpdateConversationFailureFilterUi();
|
||||
UpdateConversationRunningFilterUi();
|
||||
UpdateConversationSortUi();
|
||||
}
|
||||
|
||||
private void PersistConversationListPreferences()
|
||||
{
|
||||
lock (_convLock)
|
||||
{
|
||||
var session = _appState.ChatSession;
|
||||
if (session == null)
|
||||
return;
|
||||
|
||||
session.SaveConversationListPreferences(_activeTab, _failedOnlyFilter, _runningOnlyFilter, _sortConversationsByRecent, _storage);
|
||||
_currentConversation = session.CurrentConversation;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetRunStatusLabel(string? status)
|
||||
=> status switch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user