AX Agent 실행 이벤트 재렌더를 배치형으로 조정
Some checks failed
Release Gate / gate (push) Has been cancelled

- OnAgentEvent가 실행 이벤트마다 본문 전체를 즉시 다시 그리지 않도록 execution history 전용 배치 렌더 타이머를 추가함

- Cowork/Code 실행 중 RenderMessages 호출을 120ms 단위로 묶어 본문 번쩍임과 잦은 로그 재배치를 줄임

- 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\ 경고 0 / 오류 0
This commit is contained in:
2026-04-05 12:34:53 +09:00
parent 8921f5da0f
commit a40cacea4d
3 changed files with 26 additions and 2 deletions

View File

@@ -83,6 +83,7 @@ public partial class ChatWindow : Window
private readonly DispatcherTimer _gitRefreshTimer;
private readonly DispatcherTimer _conversationSearchTimer;
private readonly DispatcherTimer _inputUiRefreshTimer;
private readonly DispatcherTimer _executionHistoryRenderTimer;
private CancellationTokenSource? _gitStatusRefreshCts;
private int _displayedLength; // 현재 화면에 표시된 글자 수
private ResourceDictionary? _agentThemeDictionary;
@@ -116,6 +117,7 @@ public partial class ChatWindow : Window
private int _sessionPostCompactionResponseCount;
private int _sessionPostCompactionPromptTokens;
private int _sessionPostCompactionCompletionTokens;
private bool _pendingExecutionHistoryAutoScroll;
private void ApplyQuickActionVisual(Button button, bool active, string activeBg, string activeFg)
{
if (button?.Content is not string text)
@@ -233,6 +235,15 @@ public partial class ChatWindow : Window
RefreshContextUsageVisual();
RefreshDraftQueueUi();
};
_executionHistoryRenderTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(120) };
_executionHistoryRenderTimer.Tick += (_, _) =>
{
_executionHistoryRenderTimer.Stop();
RenderMessages(preserveViewport: true);
if (_pendingExecutionHistoryAutoScroll)
AutoScrollIfNeeded();
_pendingExecutionHistoryAutoScroll = false;
};
KeyDown += ChatWindow_KeyDown;
UpdateConversationFailureFilterUi();
@@ -8536,6 +8547,8 @@ public partial class ChatWindow : Window
_cursorTimer.Stop();
_elapsedTimer.Stop();
_typingTimer.Stop();
_executionHistoryRenderTimer.Stop();
_pendingExecutionHistoryAutoScroll = false;
HideStickyProgress();
StopRainbowGlow();
_activeStreamText = null;
@@ -8592,6 +8605,13 @@ public partial class ChatWindow : Window
_ = Dispatcher.BeginInvoke(new Action(() => StartNextQueuedDraftIfAny()), DispatcherPriority.Background);
}
private void ScheduleExecutionHistoryRender(bool autoScroll = true)
{
_pendingExecutionHistoryAutoScroll |= autoScroll;
_executionHistoryRenderTimer.Stop();
_executionHistoryRenderTimer.Start();
}
// ─── 코워크 에이전트 지원 ────────────────────────────────────────────
private string BuildCoworkSystemPrompt()
@@ -8995,8 +9015,7 @@ public partial class ChatWindow : Window
AppendConversationExecutionEvent(evt, eventTab);
if (shouldShowExecutionHistory
&& string.Equals(eventTab, _activeTab, StringComparison.OrdinalIgnoreCase))
RenderMessages(preserveViewport: true);
AutoScrollIfNeeded();
ScheduleExecutionHistoryRender(autoScroll: true);
// 하단 상태바 업데이트
UpdateStatusBar(evt);