AX Agent timeline 조립 helper를 분리해 메시지 렌더 구조를 단순화한다
Some checks failed
Release Gate / gate (push) Has been cancelled
Some checks failed
Release Gate / gate (push) Has been cancelled
RenderMessages()가 직접 처리하던 visible 메시지/이벤트 필터링과 timestamp/order 기반 timeline action 조립을 ChatWindow.TimelinePresentation.cs로 이동해 메인 렌더 루프가 orchestration 중심으로 더 단순해지도록 정리했다. README와 DEVELOPMENT 문서에 2026-04-06 10:36 (KST) 기준 이력을 반영했고, dotnet build 검증 결과 경고 0 / 오류 0을 확인했다.
This commit is contained in:
@@ -2723,20 +2723,8 @@ public partial class ChatWindow : Window
|
||||
lock (_convLock) conv = _currentConversation;
|
||||
_appState.RestoreAgentRunHistory(conv?.AgentRunHistory);
|
||||
|
||||
var visibleMessages = conv?.Messages?.Where(msg =>
|
||||
{
|
||||
if (string.Equals(msg.Role, "system", StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (string.Equals(msg.Role, "assistant", StringComparison.OrdinalIgnoreCase)
|
||||
&& string.IsNullOrWhiteSpace(msg.Content))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}).ToList() ?? new List<ChatMessage>();
|
||||
var visibleEvents = (conv?.ShowExecutionHistory ?? true)
|
||||
? conv?.ExecutionEvents?.ToList() ?? new List<ChatExecutionEvent>()
|
||||
: new List<ChatExecutionEvent>();
|
||||
var visibleMessages = GetVisibleTimelineMessages(conv);
|
||||
var visibleEvents = GetVisibleTimelineEvents(conv);
|
||||
|
||||
if (conv == null || (visibleMessages.Count == 0 && visibleEvents.Count == 0))
|
||||
{
|
||||
@@ -2752,17 +2740,7 @@ public partial class ChatWindow : Window
|
||||
|
||||
EmptyState.Visibility = Visibility.Collapsed;
|
||||
|
||||
var timeline = new List<(DateTime Timestamp, int Order, Action Render)>();
|
||||
foreach (var msg in visibleMessages)
|
||||
timeline.Add((msg.Timestamp, 0, () => AddMessageBubble(msg.Role, msg.Content, animate: false, message: msg)));
|
||||
|
||||
foreach (var executionEvent in visibleEvents)
|
||||
{
|
||||
var restoredEvent = ToAgentEvent(executionEvent);
|
||||
timeline.Add((executionEvent.Timestamp, 1, () => AddAgentEventBanner(restoredEvent)));
|
||||
}
|
||||
|
||||
var orderedTimeline = timeline.OrderBy(x => x.Timestamp).ThenBy(x => x.Order).ToList();
|
||||
var orderedTimeline = BuildTimelineRenderActions(visibleMessages, visibleEvents);
|
||||
var hiddenCount = Math.Max(0, orderedTimeline.Count - _timelineRenderLimit);
|
||||
if (hiddenCount > 0)
|
||||
MessagePanel.Children.Add(CreateTimelineLoadMoreCard(hiddenCount));
|
||||
|
||||
Reference in New Issue
Block a user